MCPcopy Index your code
hub / github.com/pydata/xarray / _get_valid_fill_mask

Function _get_valid_fill_mask

xarray/core/missing.py:565–576  ·  view source on GitHub ↗

helper function to determine values that can be filled when limit is not None

(arr, dim, limit)

Source from the content-addressed store, hash-verified

563
564
565def _get_valid_fill_mask(arr, dim, limit):
566 """helper function to determine values that can be filled when limit is not
567 None"""
568 kw = {dim: limit + 1}
569 # we explicitly use construct method to avoid copy.
570 new_dim = utils.get_temp_dimname(arr.dims, "_window")
571 return (
572 arr.isnull()
573 .rolling(min_periods=1, **kw)
574 .construct(new_dim, fill_value=False)
575 .sum(new_dim, skipna=False)
576 ) <= limit
577
578
579def _localize(obj: T, indexes_coords: SourceDest) -> tuple[T, SourceDest]:

Callers 1

interp_naFunction · 0.85

Calls 4

sumMethod · 0.45
constructMethod · 0.45
rollingMethod · 0.45
isnullMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…