MCPcopy
hub / github.com/pydata/xarray / test_interpolate_na_nan_block_lengths

Function test_interpolate_na_nan_block_lengths

xarray/tests/test_missing.py:588–597  ·  view source on GitHub ↗
(y, lengths_expected)

Source from the content-addressed store, hash-verified

586 ],
587)
588def test_interpolate_na_nan_block_lengths(y, lengths_expected):
589 arr = [
590 [np.nan, 1, np.nan, np.nan, np.nan, np.nan, np.nan, np.nan, 4],
591 [np.nan, np.nan, np.nan, 1, np.nan, np.nan, 4, np.nan, np.nan],
592 ]
593 da = xr.DataArray(arr, dims=["x", "y"], coords={"x": [0, 1], "y": y})
594 index = get_clean_interp_index(da, dim="y", use_coordinate=True)
595 actual = _get_nan_block_lengths(da, dim="y", index=index)
596 expected = da.copy(data=lengths_expected)
597 assert_equal(actual, expected)
598
599
600@requires_cftime

Callers

nothing calls this directly

Calls 4

copyMethod · 0.95
get_clean_interp_indexFunction · 0.90
_get_nan_block_lengthsFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…