From bd5139522c9d77608c68d25d283bdcdc230e6593 Mon Sep 17 00:00:00 2001 From: Carl Higgs Date: Tue, 4 Jul 2023 22:23:25 +1000 Subject: [PATCH] updated tests.py sensitivity analysis to mock up a more realistic comparison (cast the reference df to ints, so by rounding there is a difference); as per #340, the sensitivity analysis test is now fast and passes --- process/tests/tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/process/tests/tests.py b/process/tests/tests.py index ec10d135..e04bcedd 100644 --- a/process/tests/tests.py +++ b/process/tests/tests.py @@ -95,9 +95,14 @@ def test_7_sensitivity(self): with open(f'./configuration/regions/{comparison}.yml', 'w') as file: file.write(configuration) r = ghsci.Region(reference) - r.to_csv( - 'indicators_region', + df = r.get_df('indicators_region') + df.drop(columns=['geom'], inplace=True) + df[df.columns[(df.dtypes == 'float64').values]] = df[ + df.columns[(df.dtypes == 'float64').values] + ].astype(int) + df.to_csv( f"{r_comparison.config['region_dir']}/{r_comparison.codename}_indicators_region.csv", + index=False, ) r.compare(comparison)