Skip to content

Commit

Permalink
Add GAMS dollar control options in output.dd (#313)
Browse files Browse the repository at this point in the history
Closes #309
  • Loading branch information
olejandro authored Feb 4, 2025
1 parent 9d8795c commit d5a45bb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xl2times/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,12 +444,15 @@ def convert_parameter(tablename: str, df: DataFrame):
"ts.dd": ["ALL_TS"],
"milestonyr.dd": ["MILESTONYR"],
"output.dd": [
t for t in config.dd_table_order if t not in ["ALL_TS", "MILESTONYR"]
t for t in config.dd_table_order if t not in {"ALL_TS", "MILESTONYR"}
],
}

for fname, tablenames in tables_in_file.items():
with open(os.path.join(output_dir, fname), "w", encoding=encoding) as fout:
# Include GAMS dollar control options
if fname == "output.dd":
fout.write("$ONEPS\n$ONWARNING\n\n")
for tablename in [t for t in tablenames if t in tables]:
df = tables[tablename]
if tablename in sets:
Expand Down

0 comments on commit d5a45bb

Please sign in to comment.