Skip to content

Commit

Permalink
Remove invalid formulas to prevent future errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmutel committed Jul 23, 2024
1 parent 6d4ae78 commit 777a8b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bw_simapro_csv/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,12 @@ def parameter_set_evaluate_each_formula(ps: ParameterSet) -> dict[str, float]:
logger.critical(
f"""
Division by zero in formula {ps.params[key]['formula']} on line {ps.params[key]['line_no']}.
Returning zero.
Returning zero, and moving `formula` to `invalid_formula`.
"""
)
value = 0
ps.params[key]["invalid_formula"] = ps.params[key]["formula"]
del ps.params[key]["formula"]
except NotImplementedError as exc:
raise FormulaReservedWord(
f"""
Expand Down

0 comments on commit 777a8b3

Please sign in to comment.