Skip to content
Snippets Groups Projects
Commit 303cb726 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Only use equal_nan=True to compare float datasets

parent 1d55b146
No related branches found
No related tags found
1 merge request!933[Tests] clearer comparison of HDF5 files
......@@ -75,7 +75,9 @@ def validate_file(
eq = False # One is an array, the other not
elif isinstance(ref_arr, np.ndarray):
# Both arrays
eq = np.array_equal(ref_arr, out_arr, equal_nan=True)
nanable = np.issubdtype(ref_arr.dtype, np.floating) \
or np.issubdtype(ref_arr.dtype, np.complexfloating)
eq = np.array_equal(ref_arr, out_arr, equal_nan=nanable)
else:
# Both single values
eq = ref_arr == out_arr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment