File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3+ import copy
34import os
45import sys
56from pathlib import Path
7+ from typing import Any
68
79from pint .facets .plain import PlainQuantity
810
@@ -63,6 +65,22 @@ def calc_time(r: GeophiresXResult) -> float:
6365 speedup_pct = ((calc_time_15_sec - calc_time_8_sec ) / calc_time_15_sec ) * 100
6466 _log (f'Speedup: { speedup_pct :.2f} %' )
6567
68+ def no_metadata (r : GeophiresXResult ) -> dict [str , Any ]:
69+ ret = copy .deepcopy (r .result )
70+ del ret ['Simulation Metadata' ]
71+ del ret ['metadata' ]
72+ return ret
73+
74+ result_12_nm = no_metadata (_get_result (12 ))
75+ result_15_nm = no_metadata (result_15 )
76+ try :
77+ self .assertDictAlmostEqual (result_15_nm , result_12_nm , percent = 1 )
78+ except AssertionError as ae :
79+ try :
80+ self .assertDictEqual (result_15_nm , result_12_nm )
81+ except AssertionError as ae_with_dict_diff :
82+ raise ae from ae_with_dict_diff
83+
6684 # noinspection PyMethodMayBeStatic
6785 def _new_model (self , input_file = None ) -> Model :
6886 stash_cwd = Path .cwd ()
You can’t perform that action at this time.
0 commit comments