pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

Updating the Import Statement to Use GAMS new API

Open AnhTran01 opened this issue 6 months ago • 3 comments

Summary

Updating the attempt_import statement in pyomo\solvers\plugins\solvers\GAMS.py from gdxcc to gams.core.gdx to use GAMS new API.

Rationale

The attempt_import statement returns gdxcc_available as a boolean value that parses the solver result into a .gdx file if it is true or a .dat file if it is false. The data file format may affect parsing performance post-solved.

Description

gdxcc, gdxcc_available = attempt_import('gdxcc') # old interface
gdxcc, gdxcc_available = attempt_import('gams.core.gdx') # new interface

Additional information

We are currently comparing the data parsing time after solving between the .dat and .gdx data file formats. The model used for the test and the .pkl time data will be added below.

AnhTran01 avatar Jun 10 '25 19:06 AnhTran01

@boxblox @abhosekar

AnhTran01 avatar Jun 10 '25 20:06 AnhTran01

@AnhTran01, would changing the import for GDX imply a minimum supported GAMS version (i.e., when did the import path change)?

jsiirola avatar Jun 11 '25 02:06 jsiirola

@jsiirola we changed the structure of the api back in GAMS 45 (we just released GAMS 50 in beta a few days ago)... so the minimum version would look something like pip install gamsapi>=45

boxblox avatar Jun 11 '25 19:06 boxblox