Skip to content

Commit

Permalink
Test that gradient inputs < 1.0 are interpeted as C/m instead of C/km (
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareengineerprogrammer committed Jun 21, 2024
1 parent 3be04ce commit 77a860e
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/test_geophires_x.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 77a860e

Please sign in to comment.