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

Method test_polyfit_weighted

xarray/tests/test_dataset.py:7453–7463  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

7451 assert len(out.data_vars) == 0
7452
7453 def test_polyfit_weighted(self) -> None:
7454 ds = create_test_data(seed=1)
7455 ds = ds.broadcast_like(ds) # test more than 2 dimensions (issue #9972)
7456 ds_copy = ds.copy(deep=True)
7457
7458 expected = ds.polyfit("dim2", 2)
7459 actual = ds.polyfit("dim2", 2, w=np.ones(ds.sizes["dim2"]))
7460 xr.testing.assert_identical(expected, actual)
7461
7462 # Make sure weighted polyfit does not change the original object (issue #5644)
7463 xr.testing.assert_identical(ds, ds_copy)
7464
7465 def test_polyfit_coord(self) -> None:
7466 # Make sure polyfit works when given a non-dimension coordinate.

Callers

nothing calls this directly

Calls 4

create_test_dataFunction · 0.90
broadcast_likeMethod · 0.45
copyMethod · 0.45
polyfitMethod · 0.45

Tested by

no test coverage detected