bradfordboyle / pyglpk

Updated fork of T. Finley's PyGLPK module
GNU General Public License v3.0
14 stars 11 forks source link

Incorrect documentation for lp.write #4

Closed snorfalorpagus closed 9 years ago

snorfalorpagus commented 9 years ago

There is an error in the documentation for the lp.write function.

https://github.com/bradfordboyle/pyglpk/blob/e51a75b6d28004e7dee6c0c6c1e0b3cc3136b700/src/lp.c#L829

Documentation lists keyword as cpxlp but correct is prob.

I will fix this - this issue is a reminder for me to do it!

snorfalorpagus commented 9 years ago

Frustratingly, the LPX.__init__ method uses cpxlp:

https://github.com/bradfordboyle/pyglpk/blob/e51a75b6d28004e7dee6c0c6c1e0b3cc3136b700/src/lp.c#L115

I think we either need to change one of these for consistency, or make them both work (i.e. accept either cpxlp or prob kwargs).

bradfordboyle commented 9 years ago

Yes this is an inconsistency. The source of this is that originally there was both lpx_write_cpxlp() and lpx_print_prob(), which mapped to cpxlp and prob keywords of LPX.write(). In GLPK 4.55, the functions glp_read_lp/gl_write_lp() read/write CPLEX LP format. It would seem that the keyword arg for LPX.write() should be changed from prob to cpxlp. This would be consistent with LPX.__init__.

bradfordboyle commented 9 years ago

Both LPX.__init__() and LPX.write() have support for CPLEX LP and GLPK LP/MIP format. The prob keyword has been changed to glp. See 239e753.

snorfalorpagus commented 9 years ago

:+1: