coin-or / python-mip

Python-MIP: collection of Python tools for the modeling and solution of Mixed-Integer Linear programs
Eclipse Public License 2.0
514 stars 89 forks source link

Model.write() behaves differently with .lp and .mps formats #299

Closed ryanjoneil closed 1 year ago

ryanjoneil commented 1 year ago

Describe the bug

If I write the same model to two different files:

m.write('foo.lp')
m.write('foo.mps')

I get two files with different characteristics:

Expected behavior

In the example above, I expect to get two files:

I do not expect the .mps.mps repeated extension.

I only expect the output to be gzipped if I explicitly add a .gz extension the filename.

Desktop (please complete the following information):

rschwarz commented 1 year ago

I think the model.write method simply delegates the call to the underlying solver (CBC or Gurobi), so the offending behavior is likely defined there.

sebheger commented 1 year ago

@ryanjoneil Thanks for reporting this. But, I will close this as it is a duplicate of #164

ryanjoneil commented 1 year ago

I have some follow-up questions, but I will put those on #164.