From 77a860ead448dc534fcfe8d6a22e64fab80ce1d3 Mon Sep 17 00:00:00 2001 From: softwareengineerprogrammer <4056124+softwareengineerprogrammer@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:13:25 -0700 Subject: [PATCH] Test that gradient inputs < 1.0 are interpeted as C/m instead of C/km (https://github.com/NREL/GEOPHIRES-X/issues/171) --- tests/test_geophires_x.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_geophires_x.py b/tests/test_geophires_x.py index da0b6d26..02ca2d2e 100644 --- a/tests/test_geophires_x.py +++ b/tests/test_geophires_x.py @@ -331,6 +331,23 @@ def test_input_unit_conversion(self): self.assertDictEqual(result_kilometers_input.result, result_meters_input.result) + result_gradient_c_per_m_input = client.get_geophires_result( + GeophiresInputParameters( + from_file_path=self._get_test_file_path(Path('examples/example1.txt')), + params={ + 'Gradient 1': 0.017 # Values less than 1.0 interpreted as being in degC/m (instead of degC/km) + }, + ) + ) + del result_gradient_c_per_m_input.result['metadata'] + + self.assertEqual( + result_gradient_c_per_m_input.result['SUMMARY OF RESULTS']['Geothermal gradient']['value'], 17.0 + ) + self.assertEqual( + result_gradient_c_per_m_input.result['SUMMARY OF RESULTS']['Geothermal gradient']['unit'], 'degC/km' + ) + def test_fcr_sensitivity(self): def input_for_fcr(fcr: float) -> GeophiresInputParameters: return GeophiresInputParameters(