File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,21 @@ def check_run_abi(ref_path: str | Path):
130
130
ref_str = file .read ()
131
131
ref = AbinitInputFile .from_string (ref_str )
132
132
# Ignore the pseudos as the directory depends on the pseudo root directory
133
- diffs = user .get_differences (ref , ignore_vars = ["pseudos" ])
133
+ # The `get_differences` method doesn't take into account floating point
134
+ # precision - this check might fail, e.g., (real CI example):
135
+ # ```
136
+ # The variable 'tsmear' is different in the two files:
137
+ # - this file: '0.0036749322175665 Ha'
138
+ # - other file: '0.0036749322175655 Ha'`
139
+ # ```
140
+ diffs = user .get_differences (ref , ignore_vars = ["pseudos" , "tsmear" ])
134
141
# TODO: should we still add some check on the pseudos here ?
135
142
assert diffs == [], f"'run.abi' is different from reference:\n { diffs } "
136
143
144
+ for fp_key in ("tsmear" ,):
145
+ if (ref_val := ref .datasets [0 ].get (fp_key )) is not None :
146
+ assert user .datasets [0 ].get (fp_key ) == pytest .approx (ref_val )
147
+
137
148
138
149
def check_abinit_input_json (ref_path : str | Path ):
139
150
from abipy .abio .inputs import AbinitInput
You can’t perform that action at this time.
0 commit comments