Skip to content

Commit abd9f9a

Browse files
Ignore calculation time in test_input_with_non_default_units
1 parent 0943549 commit abd9f9a

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed

docs/_images/geophires-favicon.png

43.3 KB
Loading

tests/test_geophires_x_client.py

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -440,36 +440,44 @@ def test_input_hashing(self):
440440
self.assertNotEqual(hash(input1), hash(input3))
441441

442442
def test_input_with_non_default_units(self):
443+
def delete_metadata(r: GeophiresXResult) -> GeophiresXResult:
444+
del r.result['metadata']
445+
del r.result['Simulation Metadata']['Calculation Time']
446+
447+
return r
448+
443449
client = GeophiresXClient()
444-
result_default_units = client.get_geophires_result(
445-
GeophiresInputParameters(
446-
{
447-
'Print Output to Console': 0,
448-
'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value,
449-
'Reservoir Model': 1,
450-
'Time steps per year': 1,
451-
'Reservoir Depth': 3,
452-
'Gradient 1': 50,
453-
'Maximum Temperature': 250,
454-
}
450+
result_default_units = delete_metadata(
451+
client.get_geophires_result(
452+
GeophiresInputParameters(
453+
{
454+
'Print Output to Console': 0,
455+
'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value,
456+
'Reservoir Model': 1,
457+
'Time steps per year': 1,
458+
'Reservoir Depth': 3,
459+
'Gradient 1': 50,
460+
'Maximum Temperature': 250,
461+
}
462+
)
455463
)
456464
).result
457-
del result_default_units['metadata']
458465

459-
result_non_default_units = client.get_geophires_result(
460-
GeophiresInputParameters(
461-
{
462-
'Print Output to Console': 0,
463-
'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value,
464-
'Reservoir Model': 1,
465-
'Time steps per year': 1,
466-
'Reservoir Depth': '3000 meter',
467-
'Gradient 1': 50,
468-
'Maximum Temperature': 250,
469-
}
466+
result_non_default_units = delete_metadata(
467+
client.get_geophires_result(
468+
GeophiresInputParameters(
469+
{
470+
'Print Output to Console': 0,
471+
'End-Use Option': EndUseOption.DIRECT_USE_HEAT.value,
472+
'Reservoir Model': 1,
473+
'Time steps per year': 1,
474+
'Reservoir Depth': '3000 meter',
475+
'Gradient 1': 50,
476+
'Maximum Temperature': 250,
477+
}
478+
)
470479
)
471480
).result
472-
del result_non_default_units['metadata']
473481

474482
self.assertDictEqual(result_default_units, result_non_default_units)
475483

0 commit comments

Comments
 (0)