Skip to content

Commit 77a860e

Browse files
Test that gradient inputs < 1.0 are interpeted as C/m instead of C/km (NREL#171)
1 parent 3be04ce commit 77a860e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/test_geophires_x.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,23 @@ def test_input_unit_conversion(self):
331331

332332
self.assertDictEqual(result_kilometers_input.result, result_meters_input.result)
333333

334+
result_gradient_c_per_m_input = client.get_geophires_result(
335+
GeophiresInputParameters(
336+
from_file_path=self._get_test_file_path(Path('examples/example1.txt')),
337+
params={
338+
'Gradient 1': 0.017 # Values less than 1.0 interpreted as being in degC/m (instead of degC/km)
339+
},
340+
)
341+
)
342+
del result_gradient_c_per_m_input.result['metadata']
343+
344+
self.assertEqual(
345+
result_gradient_c_per_m_input.result['SUMMARY OF RESULTS']['Geothermal gradient']['value'], 17.0
346+
)
347+
self.assertEqual(
348+
result_gradient_c_per_m_input.result['SUMMARY OF RESULTS']['Geothermal gradient']['unit'], 'degC/km'
349+
)
350+
334351
def test_fcr_sensitivity(self):
335352
def input_for_fcr(fcr: float) -> GeophiresInputParameters:
336353
return GeophiresInputParameters(

0 commit comments

Comments
 (0)