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

Function sliding_window_view

xarray/core/duck_array_ops.py:135–147  ·  view source on GitHub ↗
(array, window_shape, axis=None, **kwargs)

Source from the content-addressed store, hash-verified

133
134
135def sliding_window_view(array, window_shape, axis=None, **kwargs):
136 # TODO: some libraries (e.g. jax) don't have this, implement an alternative?
137 xp = get_array_namespace(array)
138 # sliding_window_view will not dispatch arbitrary kwargs (automatic_rechunk),
139 # so we need to hand-code this.
140 func = _dask_or_eager_func(
141 "sliding_window_view",
142 eager_module=xp.lib.stride_tricks,
143 dask_module=dask_array_compat,
144 dask_only_kwargs=("automatic_rechunk",),
145 numpy_only_kwargs=("subok", "writeable"),
146 )
147 return func(array, window_shape, axis=axis, **kwargs)
148
149
150def round(array):

Callers

nothing calls this directly

Calls 3

get_array_namespaceFunction · 0.90
_dask_or_eager_funcFunction · 0.85
funcFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…