Skip to content

Commit

Permalink
replace GAMS-InputDir by subprocess(cwd=...) (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhuppmann authored Feb 13, 2018
1 parent 8089995 commit 94d017d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions ixmp/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ def run_gams(model_file, args, gams_args=['LogOption=4']):
- `LogOption=4` prints output to stdout (not console) and the log file
"""
cmd = 'gams {} {}'.format(model_file, args)
cmd = '{} Inputdir={}'.format(cmd, os.path.dirname(model_file))
cmd = cmd.split() + gams_args
check_call(cmd, shell=os.name == 'nt')
file_path = os.path.dirname(model_file)
file_path = None if file_path == '' else file_path
check_call(cmd, shell=os.name == 'nt', cwd=file_path)
4 changes: 0 additions & 4 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,3 @@ def test_run_gams_api():
obs = scen.var('z')['lvl']
exp = 153.675
assert np.isclose(obs, exp)

# remove log and lst file
os.remove('transport_ixmp.log')
os.remove('transport_ixmp.lst')

0 comments on commit 94d017d

Please sign in to comment.