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

Function test_clip

xarray/tests/test_dataset.py:8267–8279  ·  view source on GitHub ↗
(ds)

Source from the content-addressed store, hash-verified

8265
8266
8267def test_clip(ds) -> None:
8268 result = ds.clip(min=0.5)
8269 assert all((result.min(...) >= 0.5).values())
8270
8271 result = ds.clip(max=0.5)
8272 assert all((result.max(...) <= 0.5).values())
8273
8274 result = ds.clip(min=0.25, max=0.75)
8275 assert all((result.min(...) >= 0.25).values())
8276 assert all((result.max(...) <= 0.75).values())
8277
8278 result = ds.clip(min=ds.mean("y"), max=ds.mean("y"))
8279 assert result.sizes == ds.sizes
8280
8281
8282class TestDropDuplicates:

Callers

nothing calls this directly

Calls 5

clipMethod · 0.45
valuesMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
meanMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…