Changeset 3020


Ignore:
Timestamp:
Sep 19, 2010 2:34:40 AM (11 years ago)
Author:
wehart
Message:

Changes to the processing of header information to omit headers that are not
specified in a mapped_header array. This allows subsets of a specified
relational table to be selected by an 'import' command.

File:
1 edited

Legend:

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

    r2763 r3020  
    8282                if header in self.options.param_name:
    8383                    mapped_headers.append(self.options.param_name[header])
    84                 else:
    85                     mapped_headers.append(header)
    8684        #print "X", mapped_headers, self.options.param_name, \
    8785        #           self.options.index, self.options.format
     
    112110
    113111            self._info = ["set",self.options.set, ":"]
    114             self._info = self._info + list(mapped_headers[1:])
     112            self._info = self._info + list(headers[1:])
    115113            self._info = self._info + [":="]
    116114            for row in rows:
     
    119117        elif self.options.format == 'transposed_array':
    120118            self._info = ["param",self.options.param,"(tr)",":"]              \
    121                        + mapped_headers[1:]
     119                       + headers[1:]
    122120            self._info.append(":=")
    123121            for row in rows:
     
    125123
    126124        elif self.options.format == 'array':
    127             self._info = ["param",self.options.param,":"] + mapped_headers[1:]
     125            self._info = ["param",self.options.param,":"] + headers[1:]
    128126            self._info.append(":=")
    129127            for row in rows:
     
    155153            msg = "Unknown parameter format: '%s'"
    156154            raise ValueError, msg % self.options.format
     155        #print "FINAL",self._info
Note: See TracChangeset for help on using the changeset viewer.