From 41fb238b430e754ec3cee4db40beb3dc7cbb9d43 Mon Sep 17 00:00:00 2001 From: Mathias157 Date: Fri, 18 Oct 2024 16:31:52 +0200 Subject: [PATCH] Fixing EPS error --- src/Modules/aggregate_inputs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Modules/aggregate_inputs.py b/src/Modules/aggregate_inputs.py index 091f0c8..0957724 100644 --- a/src/Modules/aggregate_inputs.py +++ b/src/Modules/aggregate_inputs.py @@ -165,6 +165,13 @@ def aggregate_parameter(db: gams.GamsDatabase, .fillna(fillna) ) + # Writing eps if fillna == EPS + if fillna == 'EPS': + idx = df.query('Value <= 1e-9').index + df = df.astype('object') + df.loc[idx, 'Value'] = 'EPS' + + # Make IncFile prefix = "TABLE %s(%s) '%s'\n"%(symbol, ", ".join(symbol_columns[:-1]), db[symbol].text) suffix = '\n;'