Ignore:
Timestamp:
Feb 8, 2010 5:13:22 PM (10 years ago)
Author:
wehart
Message:

Setting up 'import' tests for the other simple examples.
These seem to work, but the internal code is too ugly. I'm
going to clean that up next to help explain what is going on...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • coopr.pyomo/trunk/coopr/pyomo/data/text.py

    r2274 r2289  
    4040            raise IOError, "Empty *.tab file"
    4141        elif len(tmp) == 1:
    42             self._info = ["param",self.options.param,":=",tmp[0][0]]
     42            if not self.options.param is None:
     43                self._info = ["param",self.options.param,":=",tmp[0][0]]
     44            elif len(self.options.symbol_map) == 1:
     45                self._info = ["param",self.options.symbol_map[self.options.symbol_map.keys()[0]],":=",tmp[0][0]]
     46            else:
     47                raise IOError, "Data looks like a parameter, but multiple parameter names have been specified: %s" % str(self.options.symbol_map)
    4348        else:
    4449            self._set_data(tmp[0], tmp[1:])
Note: See TracChangeset for help on using the changeset viewer.