Skip to content

Commit 779cc3a

Browse files
log speedup
1 parent a38fc4f commit 779cc3a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/geophires_x_tests/test_reservoir.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def test_reservoir_lithostatic_pressure(self):
3535
self.assertEqual('megapascal', p.units)
3636

3737
def test_gringarten_stehfest_precision(self):
38+
def _log(msg) -> None:
39+
print(f'[DEBUG][test_gringarten_stehfest_precision] {msg}')
40+
3841
def _get_result(gringarten_stehfest_precision: int) -> GeophiresXResult:
3942
return GeophiresXClient(enable_caching=False).get_geophires_result(
4043
ImmutableGeophiresInputParameters(
@@ -53,11 +56,13 @@ def calc_time(r: GeophiresXResult) -> float:
5356
calc_time_15_sec = calc_time(result_15)
5457
calc_time_8_sec = calc_time(result_8)
5558

56-
msg = f'calc_time_15_sec={calc_time_15_sec}, calc_time_8_sec={calc_time_8_sec}'
57-
print(f'[DEBUG] {msg}')
59+
_log(f'calc_time_15_sec={calc_time_15_sec}, calc_time_8_sec={calc_time_8_sec}')
5860

5961
self.assertLess(calc_time_8_sec, calc_time_15_sec)
6062

63+
speedup_pct = ((calc_time_15_sec - calc_time_8_sec) / calc_time_15_sec) * 100
64+
_log(f'Speedup: {speedup_pct:.2f}%')
65+
6166
# noinspection PyMethodMayBeStatic
6267
def _new_model(self, input_file=None) -> Model:
6368
stash_cwd = Path.cwd()

0 commit comments

Comments
 (0)