Skip to content

Commit

Permalink
Started work on issue #12 by renaming the output .gdx file to %scenar…
Browse files Browse the repository at this point in the history
…io_input_data.gdx instead of generic _gams_py_gdb0.gdx
  • Loading branch information
Mathias157 committed Sep 24, 2024
1 parent b082c2d commit 78d6840
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pybalmorel/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,15 @@ def load_incfiles(self,
# Initialize GAMS Workspace
ws = gams.GamsWorkspace(working_directory=model_folder)

# Set options
opt = ws.add_options()
opt.gdx = '%s_input_data.gdx'%scenario # Setting the output gdx name (note, could be overwritten by the cmd line options, which is intended)

# Load the GAMS model
model_db = ws.add_job_from_file(os.path.join(model_folder, read_file))
model_db = ws.add_job_from_file(os.path.join(model_folder, read_file), job_name=scenario)

# Run the GAMS file
model_db.run()
model_db.run(opt)

# Store the database (will take some minutes)
self.input_data[scenario] = model_db.get_out_db()
Expand Down

0 comments on commit 78d6840

Please sign in to comment.