Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
2.02k stars 518 forks source link

dat file empty 2d set error #258

Closed DLWoodruff closed 10 months ago

DLWoodruff commented 6 years ago

empty2d.zip The attached files have an example of an AMPL-format dat file with an empty 2 dimensional set that results in an error. A potential fix that seems like it might work is as follows: in PyomoModel.py in _tupelize add if len(list(data.keys())) == 1 and list(data.keys())[0] is None and len(data[None]) == 0: return None right before ans = {} but there is probably something better. To see the error, use something like: pyomo solve 2dDAT.py empty2d.dat --solver=cplex

mrmundt commented 2 years ago

@DLWoodruff @blnicho - I'm going through old bug reports. Is this bug still present in the most recent Pyomo version?

mrmundt commented 10 months ago

In an effort to clean up issues, we are moving some discussions to our Archived Design Discussions wiki.