Skip to content

Commit 1875fd2

Browse files
authored
Merge branch 'main' into groupby-aggs-using-numpy-groupies
2 parents 638d98a + dbc02d4 commit 1875fd2

27 files changed

+245
-66
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ repos:
1313
- id: isort
1414
# https://github.com/python/black#version-control-integration
1515
- repo: https://github.com/psf/black
16-
rev: 21.11b1
16+
rev: 21.12b0
1717
hooks:
1818
- id: black
1919
- id: black-jupyter

asv_bench/asv.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
"distributed": [""],
6868
"flox": [""],
6969
"numpy_groupies": [""],
70+
"sparse": [""]
7071
},
7172

7273

asv_bench/benchmarks/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ def requires_dask():
2222
raise NotImplementedError()
2323

2424

25+
def requires_sparse():
26+
try:
27+
import sparse # noqa: F401
28+
except ImportError:
29+
raise NotImplementedError()
30+
31+
2532
def randn(shape, frac_nan=None, chunks=None, seed=0):
2633
rng = np.random.RandomState(seed)
2734
if chunks is None:

asv_bench/benchmarks/unstacking.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import numpy as np
2+
import pandas as pd
23

34
import xarray as xr
45

5-
from . import requires_dask
6+
from . import requires_dask, requires_sparse
67

78

89
class Unstacking:
@@ -27,3 +28,37 @@ def setup(self, *args, **kwargs):
2728
requires_dask()
2829
super().setup(**kwargs)
2930
self.da_full = self.da_full.chunk({"flat_dim": 25})
31+
32+
33+
class UnstackingSparse(Unstacking):
34+
def setup(self, *args, **kwargs):
35+
requires_sparse()
36+
37+
import sparse
38+
39+
data = sparse.random((500, 1000), random_state=0, fill_value=0)
40+
self.da_full = xr.DataArray(data, dims=list("ab")).stack(flat_dim=[...])
41+
self.da_missing = self.da_full[:-1]
42+
43+
mindex = pd.MultiIndex.from_arrays([np.arange(100), np.arange(100)])
44+
self.da_eye_2d = xr.DataArray(np.ones((100,)), dims="z", coords={"z": mindex})
45+
self.da_eye_3d = xr.DataArray(
46+
np.ones((100, 50)),
47+
dims=("z", "foo"),
48+
coords={"z": mindex, "foo": np.arange(50)},
49+
)
50+
51+
def time_unstack_to_sparse_2d(self):
52+
self.da_eye_2d.unstack(sparse=True)
53+
54+
def time_unstack_to_sparse_3d(self):
55+
self.da_eye_3d.unstack(sparse=True)
56+
57+
def peakmem_unstack_to_sparse_2d(self):
58+
self.da_eye_2d.unstack(sparse=True)
59+
60+
def peakmem_unstack_to_sparse_3d(self):
61+
self.da_eye_3d.unstack(sparse=True)
62+
63+
def time_unstack_pandas_slow(self):
64+
pass

ci/requirements/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
- bottleneck
99
- cartopy
1010
- cfgrib>=0.9
11-
- dask>=2.10
11+
- dask-core>=2.30
1212
- h5netcdf>=0.7.4
1313
- ipykernel
1414
- ipython

ci/requirements/environment-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies:
88
# - cdms2 # Not available on Windows
99
# - cfgrib # Causes Python interpreter crash on Windows: https://github.com/pydata/xarray/pull/3340
1010
- cftime
11-
- dask
11+
- dask-core
1212
- distributed
1313
- fsspec!=2021.7.0
1414
- h5netcdf

ci/requirements/environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies:
1010
- cdms2
1111
- cfgrib
1212
- cftime
13-
- dask
13+
- dask-core
1414
- distributed
1515
- fsspec!=2021.7.0
1616
- h5netcdf

ci/requirements/py37-min-all-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies:
1616
- cfgrib=0.9
1717
- cftime=1.2
1818
- coveralls
19-
- dask=2.30
19+
- dask-core=2.30
2020
- distributed=2.30
2121
- h5netcdf=0.8
2222
- h5py=2.10

doc/contributing.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,9 @@ to build the docs you need to use the environment file ``ci/requirements/doc.yml
318318
Building the documentation
319319
~~~~~~~~~~~~~~~~~~~~~~~~~~
320320

321-
Navigate to your local ``xarray/doc/`` directory in the console and run::
321+
To build the documentation run::
322322

323+
cd doc/
323324
make html
324325

325326
Then you can find the HTML output in the folder ``xarray/doc/_build/html/``.

doc/developers-meeting.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Developers meeting
2+
------------------
3+
4+
Xarray developers meet bi-weekly every other Wednesday.
5+
6+
The meeting occurs on `Zoom <https://us02web.zoom.us/j/88251613296?pwd=azZsSkU1UWJZTVFKNnhIUVdZcENUZz09>`__.
7+
8+
Notes for the meeting are kept `here <https://hackmd.io/@U4W-olO3TX-hc-cvbjNe4A/xarray-dev-meeting/edit>`__.
9+
10+
There is a `GitHub issue <https://github.com/pydata/xarray/issues/4001>`__ for changes to the meeting.
11+
12+
You can subscribe to this calendar to be notified of changes:
13+
14+
* `Google Calendar <https://calendar.google.com/calendar/embed?src=ucar.edu_2gjd5fuugcj4ol6ij7knj8krn8%40group.calendar.google.com&ctz=America%2FLos_Angeles>`__
15+
* `iCal <https://calendar.google.com/calendar/ical/ucar.edu_2gjd5fuugcj4ol6ij7knj8krn8%40group.calendar.google.com/public/basic.ics>`__
16+
17+
.. raw:: html
18+
19+
<iframe id="calendariframe" src="https://calendar.google.com/calendar/embed?ctz=local&amp;src=ucar.edu_2gjd5fuugcj4ol6ij7knj8krn8%40group.calendar.google.com" style="border: 0" width="800" height="600" frameborder="0" scrolling="no"></iframe>
20+
<script>document.getElementById("calendariframe").src = document.getElementById("calendariframe").src.replace("ctz=local", "ctz=" + Intl.DateTimeFormat().resolvedOptions().timeZone)</script>

0 commit comments

Comments
 (0)