Pex2.gms : Test expert level Python API to read and write GDX, set options and execute GAMS

Description

Contributor: Lutz Westermann, October 2012


Small Model of Type : Python


Category : GAMS API library


Main file : Pex2.gms

$TITLE 'Test expert level Python API to read and write GDX, set options and execute GAMS' (PEX2,SEQ=19)

$ontext
Contributor: Lutz Westermann, October 2012
$offtext


$set srcRoot %gams.sysdir%apifiles%system.dirsep%Python%system.dirsep%
$                             set C ;
$if %system.filesys% == UNIX $set C :

$ifthen setenv PYTHON36
$  setEnv PYTHONPATH "%srcRoot%api_36%C%%srcRoot%gams"
$  call.checkErrorLevel cd . && "%sysenv.PYTHON36%" "%srcRoot%xp_example2.py" "%gams.sysdir%." model2.gms
$  call.checkErrorLevel gdxdiff demanddata.gdx demandwant.gdx
$endif
$ifthen setenv PYTHON37
$  setEnv PYTHONPATH "%srcRoot%api_37%C%%srcRoot%gams"
$  call.checkErrorLevel cd . && "%sysenv.PYTHON37%" "%srcRoot%xp_example2.py" "%gams.sysdir%." model2.gms
$  call.checkErrorLevel gdxdiff demanddata.gdx demandwant.gdx
$endif
$ifthen setenv PYTHON38
$  setEnv PYTHONPATH "%srcRoot%api_38%C%%srcRoot%gams"
$  call.checkErrorLevel cd . && "%sysenv.PYTHON38%" "%srcRoot%xp_example2.py" "%gams.sysdir%." model2.gms
$  call.checkErrorLevel gdxdiff demanddata.gdx demandwant.gdx
$endif
$ifthen setenv PYTHON39
$  setEnv PYTHONPATH "%srcRoot%api_39%C%%srcRoot%gams"
$  call.checkErrorLevel cd . && "%sysenv.PYTHON39%" "%srcRoot%xp_example2.py" "%gams.sysdir%." model2.gms
$  call.checkErrorLevel gdxdiff demanddata.gdx demandwant.gdx
$endif

$ifThen dExist "%gams.sysdir%GMSPython"
$  dropEnv PYTHONPATH
$  call.checkErrorLevel cd . && "%gams.sysdir%GMSPython%system.dirsep%python" "%srcRoot%xp_example2.py" "%gams.sysdir%." model2.gms
$  call.checkErrorLevel gdxdiff demanddata.gdx demandwant.gdx
$endIf