@@ -40,11 +40,13 @@ def test_gringarten_stehfest_precision(self):
4040 def _log (msg ) -> None :
4141 print (f'[DEBUG][test_gringarten_stehfest_precision] { msg } ' )
4242
43+ param_name = 'Gringarten-Stehfest Precision'
44+
4345 def _get_result (gringarten_stehfest_precision : int ) -> GeophiresXResult :
4446 return GeophiresXClient (enable_caching = False ).get_geophires_result (
4547 ImmutableGeophiresInputParameters (
4648 from_file_path = self ._get_test_file_path ('generic-egs-case.txt' ),
47- params = {'Gringarten-Stehfest Precision' : gringarten_stehfest_precision },
49+ params = {param_name : gringarten_stehfest_precision },
4850 )
4951 )
5052
@@ -62,9 +64,28 @@ def calc_time(r: GeophiresXResult) -> float:
6264
6365 self .assertLess (calc_time_8_sec , calc_time_15_sec )
6466
67+ max_calc_time_8_sec = 1.0
68+ try :
69+ self .assertLessEqual (calc_time_8_sec , 1.0 )
70+ except AssertionError :
71+ _log (
72+ f'[WARNING] Calculation time for { param_name } =8 was greater than the expected maximum of '
73+ f'{ max_calc_time_8_sec } seconds. This may indicate a performance regression, '
74+ f'depending on the available compute resources.'
75+ )
76+
6577 speedup_pct = ((calc_time_15_sec - calc_time_8_sec ) / calc_time_15_sec ) * 100
6678 _log (f'Speedup: { speedup_pct :.2f} %' )
6779
80+ min_expected_speedup_pct = 25.0
81+ try :
82+ self .assertGreaterEqual (min_expected_speedup_pct , min_expected_speedup_pct )
83+ except AssertionError :
84+ _log (
85+ f'[WARNING] Speedup for { param_name } =8 was less than the expected minimum of '
86+ f'{ min_expected_speedup_pct } %. This may indicate a performance regression.'
87+ )
88+
6889 def no_metadata (r : GeophiresXResult ) -> dict [str , Any ]:
6990 ret = copy .deepcopy (r .result )
7091 del ret ['Simulation Metadata' ]
0 commit comments