diff --git a/tests/test_reference_runs/test_pre_deployment.py b/tests/test_reference_runs/test_pre_deployment.py index c547ffe74b13c2c8daee8fd03ec0f81c87b599b1..b3faca674e9cb98f611b56e8dbc8af33723836f5 100644 --- a/tests/test_reference_runs/test_pre_deployment.py +++ b/tests/test_reference_runs/test_pre_deployment.py @@ -89,15 +89,19 @@ def validate_file( elif out_ds.dtype != ref_ds.dtype: changed.append((dsname, f"Dtype: {ref_ds.dtype} -> {out_ds.dtype}")) # noqa else: - nanable = np.issubdtype(ref_ds.dtype, np.floating) \ - or np.issubdtype(ref_ds.dtype, np.complexfloating) + floaty = np.issubdtype(ref_ds.dtype, np.floating) \ + or np.issubdtype(ref_ds.dtype, np.complexfloating) # Compare data incrementally rather than loading it all at once; # read in blocks of ~64 MB (arbitrary limit) along first axis. for chunk_slice in iter_sized_chunks(ref_ds, 64 * 1024 * 1024): ref_chunk = ref_ds[chunk_slice] out_chunk = out_ds[chunk_slice] - if not np.allclose(ref_chunk, out_chunk, equal_nan=nanable): # noqa + if floaty: + eq = np.allclose(ref_chunk, out_chunk, equal_nan=True) + else: + eq = np.array_equal(ref_chunk, out_chunk) + if not eq: # If just 1 entry, show the values if ref_ds.size == 1: r, o = np.squeeze(ref_chunk), np.squeeze(out_chunk)