MCPcopy Index your code
hub / github.com/dask/dask / allclose

Function allclose

dask/array/utils.py:176–188  ·  view source on GitHub ↗
(a, b, equal_nan=False, **kwargs)

Source from the content-addressed store, hash-verified

174
175
176def allclose(a, b, equal_nan=False, **kwargs):
177 a = normalize_to_array(a)
178 b = normalize_to_array(b)
179 if getattr(a, "dtype", None) != "O":
180 if hasattr(a, "mask") or hasattr(b, "mask"):
181 return np.ma.allclose(a, b, masked_equal=True, **kwargs)
182 else:
183 return np.allclose(a, b, equal_nan=equal_nan, **kwargs)
184 if equal_nan:
185 return a.shape == b.shape and all(
186 np.isnan(b) if np.isnan(a) else a == b for (a, b) in zip(a.flat, b.flat)
187 )
188 return (a == b).all()
189
190
191def same_keys(a, b):

Callers 7

test_cov_fweightsFunction · 0.90
test_cov_aweightsFunction · 0.90
test_oneFunction · 0.90
test_twoFunction · 0.90
test_anovaFunction · 0.90
assert_eqFunction · 0.70

Calls 3

normalize_to_arrayFunction · 0.85
allFunction · 0.85
allMethod · 0.45

Tested by 6

test_cov_fweightsFunction · 0.72
test_cov_aweightsFunction · 0.72
test_oneFunction · 0.72
test_twoFunction · 0.72
test_anovaFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…