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

Method setup

asv_bench/benchmarks/rolling.py:21–37  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

19
20class Rolling:
21 def setup(self, *args, **kwargs):
22 self.ds = xr.Dataset(
23 {
24 "var1": (("x", "y"), randn_xy),
25 "var2": (("x", "t"), randn_xt),
26 "var3": (("t",), randn_t),
27 },
28 coords={
29 "x": np.arange(nx),
30 "y": np.linspace(0, 1, ny),
31 "t": pd.date_range("1970-01-01", periods=nt, freq="D"),
32 "x_coords": ("x", np.linspace(1.1, 2.1, nx)),
33 },
34 )
35 self.da_long = xr.DataArray(
36 randn_long, dims="x", coords={"x": np.arange(long_nx) * 0.1}
37 )
38
39 @parameterized(
40 ["func", "center", "use_bottleneck"],

Callers 1

setupMethod · 0.45

Calls 2

arangeMethod · 0.80
linspaceMethod · 0.80

Tested by

no test coverage detected