Skip to content

Commit

Permalink
round compute damages calculation to check for float errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JMGilbert committed Aug 23, 2022
1 parent f5ef58f commit cba401c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/dscim/menu/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ def save_wrap(self, *args, **kwargs):
elif isinstance(save, pd.DataFrame):
self.logger.info(f"Saving {filename_path}.csv")
save.to_csv(f"{filename_path}.csv", index=False)
else:
logger.warning(f"Skipped saving {name}.")

return out

Expand Down
2 changes: 1 addition & 1 deletion src/dscim/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def compute_damages(anomaly, betas, formula):
+ betas["np.power(anomaly, 2)"] * np.power(anomaly.temperature, 2)
+ betas["gmsl"] * anomaly.gmsl
+ betas["np.power(gmsl, 2)"] * np.power(anomaly.gmsl, 2)
)
).round(3)
elif (
formula == "damages ~ anomaly + np.power(anomaly, 2) + gmsl + np.power(gmsl, 2)"
):
Expand Down

0 comments on commit cba401c

Please # to comment.