PSpecialValues.gms : Test handling of Special Values in object oriented Python API

Description

Contributor: Clemens Westphal, January 2015


Small Model of Type : Python


Category : GAMS API library


Main file : PSpecialValues.gms

$TITLE 'Test handling of Special Values in object oriented Python API' (PSPECIALVALUES,SEQ=48)

$ontext
Contributor: Clemens Westphal, January 2015
$offtext


$set srcRoot %gams.sysdir%apifiles%system.dirsep%Python%system.dirsep%

$                             set C ;
$if %system.filesys% == UNIX $set C :
$                             set SET set
$if %system.filesys% == UNIX $set SET export

* The C extension comes with the system, this is only required when doing manual changes there
$if not set rebuildCExtension $goto haveCExtension

$call cd "%srcRoot%api" && %sysenv.PYTHON27% setup.py build --build-lib .
$if errorlevel 1 $abort 'Problem running dist utils (setup.py)'

$label haveCExtension

$call %SET% PYTHONPATH=%srcRoot%api && %sysenv.PYTHON27% "%srcRoot%special_values.py" "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing special_values.py'

$escape &
$ifThen not %sysenv.PYTHON26% == %&sysenv.PYTHON26%&
$call %SET% PYTHONPATH=%srcRoot%api_26 && %sysenv.PYTHON26% "%srcRoot%special_values.py" "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing special_values.py with Python 2.6'
$endif

$ifThen not %sysenv.PYTHON34% == %&sysenv.PYTHON34%&
$call %SET% PYTHONPATH=%srcRoot%api_34 && %sysenv.PYTHON34% "%srcRoot%special_values.py" "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing special_values.py with Python 3.4'
$endif

$ifThen not %sysenv.PYTHON36% == %&sysenv.PYTHON36%&
$call %SET% PYTHONPATH=%srcRoot%api_36 && %sysenv.PYTHON36% "%srcRoot%special_values.py" "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing special_values.py with Python 3.6'
$endif