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 1
1
from __future__ import annotations
2
2
3
+ import copy
3
4
import os
4
5
import sys
5
6
from pathlib import Path
7
+ from typing import Any
6
8
7
9
from pint .facets .plain import PlainQuantity
8
10
@@ -63,6 +65,22 @@ def calc_time(r: GeophiresXResult) -> float:
63
65
speedup_pct = ((calc_time_15_sec - calc_time_8_sec ) / calc_time_15_sec ) * 100
64
66
_log (f'Speedup: { speedup_pct :.2f} %' )
65
67
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
+
66
84
# noinspection PyMethodMayBeStatic
67
85
def _new_model (self , input_file = None ) -> Model :
68
86
stash_cwd = Path .cwd ()
You can’t perform that action at this time.
0 commit comments