From cba401c7ba3e2449facaca697a491eb168435b45 Mon Sep 17 00:00:00 2001 From: JMGilbert Date: Tue, 23 Aug 2022 09:18:32 -0700 Subject: [PATCH] round compute damages calculation to check for float errors --- src/dscim/menu/decorators.py | 2 -- src/dscim/utils/utils.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dscim/menu/decorators.py b/src/dscim/menu/decorators.py index f6a64b3b..85ce9d45 100644 --- a/src/dscim/menu/decorators.py +++ b/src/dscim/menu/decorators.py @@ -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 diff --git a/src/dscim/utils/utils.py b/src/dscim/utils/utils.py index 7408f84d..b778a3c7 100644 --- a/src/dscim/utils/utils.py +++ b/src/dscim/utils/utils.py @@ -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)" ):