Skip to content
forked from pydata/xarray

Commit b86623c

Browse files
committed
Merge remote-tracking branch 'upstream/master' into propagate-attrs
* upstream/master: (34 commits) Fix bug in computing means of cftime.datetime arrays (pydata#4344) fix some str accessor inconsistencies (pydata#4339) pin matplotlib in ci/requirements/doc.yml (pydata#4340) Clarify drop_vars return value. (pydata#4244) Support explicitly setting a dimension order with to_dataframe() (pydata#4333) Increase support window of all dependencies (pydata#4296) Implement interp for interpolating between chunks of data (dask) (pydata#4155) Add @mathause to current core developers. (pydata#4335) install sphinx-autosummary-accessors from conda-forge (pydata#4332) Use sphinx-accessors-autosummary (pydata#4323) ndrolling fixes (pydata#4329) DOC: fix typo argmin -> argmax in DataArray.argmax docstring (pydata#4327) pin sphinx to 3.1(pydata#4326) nd-rolling (pydata#4219) Implicit dask import 4164 (pydata#4318) allow customizing the inline repr of a duck array (pydata#4248) silence the known docs CI issues (pydata#4316) enh: fixed pydata#4302 (pydata#4315) Remove all unused and warn-raising methods from AbstractDataStore (pydata#4310) Fix map_blocks example (pydata#4305) ...
2 parents ad75394 + 26547d1 commit b86623c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1221
-645
lines changed

HOW_TO_RELEASE.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# How to issue an xarray release in 17 easy steps
1+
# How to issue an xarray release in 20 easy steps
22

33
Time required: about an hour.
44

@@ -23,9 +23,9 @@ upstream https://github.com/pydata/xarray (push)
2323
git log v{0.X.Y-1}.. --format=%aN | sort -u | perl -pe 's/\n/$1, /'
2424
```
2525
Add these into `whats-new.rst` somewhere :)
26-
2. Write a release summary: ~50 words describing the high level features. This
26+
3. Write a release summary: ~50 words describing the high level features. This
2727
will be used in the release emails, tweets, GitHub release notes, etc.
28-
3. Look over whats-new.rst and the docs. Make sure "What's New" is complete
28+
4. Look over whats-new.rst and the docs. Make sure "What's New" is complete
2929
(check the date!) and add the release summary at the top.
3030
Things to watch out for:
3131
- Important new features should be highlighted towards the top.
@@ -34,46 +34,46 @@ upstream https://github.com/pydata/xarray (push)
3434
due to a bad merge. Check for these before a release by using git diff,
3535
e.g., `git diff v{0.X.Y-1} whats-new.rst` where {0.X.Y-1} is the previous
3636
release.
37-
4. If possible, open a PR with the release summary and whatsnew changes.
38-
4. After merging, again ensure your master branch is synced to upstream:
37+
5. If possible, open a PR with the release summary and whatsnew changes.
38+
6. After merging, again ensure your master branch is synced to upstream:
3939
```sh
4040
git pull upstream master
4141
```
42-
4. If you have any doubts, run the full test suite one final time!
42+
7. If you have any doubts, run the full test suite one final time!
4343
```sh
4444
pytest
4545
```
46-
5. Check that the ReadTheDocs build is passing.
47-
6. On the master branch, commit the release in git:
46+
8. Check that the ReadTheDocs build is passing.
47+
9. On the master branch, commit the release in git:
4848
```s
4949
git commit -am 'Release v{0.X.Y}'
5050
```
51-
7. Tag the release:
51+
10. Tag the release:
5252
```sh
5353
git tag -a v{0.X.Y} -m 'v{0.X.Y}'
5454
```
55-
8. Build source and binary wheels for PyPI:
55+
11. Build source and binary wheels for PyPI:
5656
```sh
5757
git clean -xdf # this deletes all uncommitted changes!
5858
python setup.py bdist_wheel sdist
5959
```
60-
9. Use twine to check the package build:
60+
12. Use twine to check the package build:
6161
```sh
6262
twine check dist/xarray-{0.X.Y}*
6363
```
64-
10. Use twine to register and upload the release on PyPI. Be careful, you can't
64+
13. Use twine to register and upload the release on PyPI. Be careful, you can't
6565
take this back!
6666
```sh
6767
twine upload dist/xarray-{0.X.Y}*
6868
```
6969
You will need to be listed as a package owner at
7070
https://pypi.python.org/pypi/xarray for this to work.
71-
11. Push your changes to master:
71+
14. Push your changes to master:
7272
```sh
7373
git push upstream master
7474
git push upstream --tags
7575
```
76-
12. Update the stable branch (used by ReadTheDocs) and switch back to master:
76+
15. Update the stable branch (used by ReadTheDocs) and switch back to master:
7777
```sh
7878
git checkout stable
7979
git rebase master
@@ -83,7 +83,7 @@ upstream https://github.com/pydata/xarray (push)
8383
It's OK to force push to 'stable' if necessary. (We also update the stable
8484
branch with `git cherry-pick` for documentation only fixes that apply the
8585
current released version.)
86-
13. Add a section for the next release {0.X.Y+1} to doc/whats-new.rst:
86+
16. Add a section for the next release {0.X.Y+1} to doc/whats-new.rst:
8787
```
8888
.. _whats-new.{0.X.Y+1}:
8989
@@ -109,19 +109,19 @@ upstream https://github.com/pydata/xarray (push)
109109
Internal Changes
110110
~~~~~~~~~~~~~~~~
111111
```
112-
14. Commit your changes and push to master again:
112+
17. Commit your changes and push to master again:
113113
```sh
114114
git commit -am 'New whatsnew section'
115115
git push upstream master
116116
```
117117
You're done pushing to master!
118-
15. Issue the release on GitHub. Click on "Draft a new release" at
118+
18. Issue the release on GitHub. Click on "Draft a new release" at
119119
https://github.com/pydata/xarray/releases. Type in the version number
120120
and paste the release summary in the notes.
121-
16. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
121+
19. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
122122
and switch your new release tag (at the bottom) from "Inactive" to "Active".
123123
It should now build automatically.
124-
17. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
124+
20. Issue the release announcement to mailing lists & Twitter. For bug fix releases, I
125125
usually only email [email protected]. For major/feature releases, I will email a broader
126126
list (no more than once every 3-6 months):
127127

ci/min_deps_check.py

+20-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@
2323
"pytest-env",
2424
}
2525

26-
POLICY_MONTHS = {"python": 42, "numpy": 24, "pandas": 12, "scipy": 12}
27-
POLICY_MONTHS_DEFAULT = 6
28-
26+
POLICY_MONTHS = {"python": 42, "numpy": 24, "setuptools": 42}
27+
POLICY_MONTHS_DEFAULT = 12
28+
POLICY_OVERRIDE = {
29+
# dask < 2.9 has trouble with nan-reductions
30+
# TODO remove this special case and the matching note in installing.rst
31+
# after January 2021.
32+
"dask": (2, 9),
33+
"distributed": (2, 9),
34+
# setuptools-scm doesn't work with setuptools < 36.7 (Nov 2017).
35+
# The conda metadata is malformed for setuptools < 38.4 (Jan 2018)
36+
# (it's missing a timestamp which prevents this tool from working).
37+
# TODO remove this special case and the matching note in installing.rst
38+
# after July 2021.
39+
"setuptools": (38, 4),
40+
}
2941
has_errors = False
3042

3143

@@ -151,6 +163,11 @@ def process_pkg(
151163
policy_minor = minor
152164
policy_published_actual = published
153165

166+
try:
167+
policy_major, policy_minor = POLICY_OVERRIDE[pkg]
168+
except KeyError:
169+
pass
170+
154171
if (req_major, req_minor) < (policy_major, policy_minor):
155172
status = "<"
156173
elif (req_major, req_minor) > (policy_major, policy_minor):

ci/requirements/doc.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ dependencies:
1313
- ipython
1414
- iris>=2.3
1515
- jupyter_client
16+
- matplotlib-base=3.3.0
1617
- nbsphinx
1718
- netcdf4>=1.5
1819
- numba
1920
- numpy>=1.17
20-
- pandas>=1.0
21+
# FIXME https://github.com/pydata/xarray/issues/4287
22+
# - pandas>=1.0
23+
- pandas=1.0
2124
- rasterio>=1.1
2225
- seaborn
2326
- setuptools
24-
- sphinx>=2.3
27+
- sphinx=3.1
2528
- sphinx_rtd_theme>=0.4
29+
- sphinx-autosummary-accessors
2630
- zarr>=2.4

ci/requirements/py36-bare-minimum.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ dependencies:
1010
- pytest-env
1111
- numpy=1.15
1212
- pandas=0.25
13-
- setuptools=41.2
13+
- setuptools=38.4

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies:
4343
- rasterio=1.0
4444
- scipy=1.3
4545
- seaborn=0.9
46-
- setuptools=41.2
46+
- setuptools=38.4
4747
# - sparse # See py36-min-nep18.yml
4848
- toolz=0.10
4949
- zarr=2.3

ci/requirements/py36-min-nep18.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ dependencies:
1515
- pytest
1616
- pytest-cov
1717
- pytest-env
18-
- scipy=1.2
19-
- setuptools=41.2
18+
- scipy=1.3
19+
- setuptools=38.4
2020
- sparse=0.8

doc/api-hidden.rst

-28
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,10 @@
665665
backends.NetCDF4DataStore.encode
666666
backends.NetCDF4DataStore.encode_attribute
667667
backends.NetCDF4DataStore.encode_variable
668-
backends.NetCDF4DataStore.get
669668
backends.NetCDF4DataStore.get_attrs
670669
backends.NetCDF4DataStore.get_dimensions
671670
backends.NetCDF4DataStore.get_encoding
672671
backends.NetCDF4DataStore.get_variables
673-
backends.NetCDF4DataStore.items
674-
backends.NetCDF4DataStore.keys
675672
backends.NetCDF4DataStore.load
676673
backends.NetCDF4DataStore.open
677674
backends.NetCDF4DataStore.open_store_variable
@@ -685,27 +682,20 @@
685682
backends.NetCDF4DataStore.store
686683
backends.NetCDF4DataStore.store_dataset
687684
backends.NetCDF4DataStore.sync
688-
backends.NetCDF4DataStore.values
689-
backends.NetCDF4DataStore.attrs
690685
backends.NetCDF4DataStore.autoclose
691-
backends.NetCDF4DataStore.dimensions
692686
backends.NetCDF4DataStore.ds
693687
backends.NetCDF4DataStore.format
694688
backends.NetCDF4DataStore.is_remote
695689
backends.NetCDF4DataStore.lock
696-
backends.NetCDF4DataStore.variables
697690

698691
backends.H5NetCDFStore.close
699692
backends.H5NetCDFStore.encode
700693
backends.H5NetCDFStore.encode_attribute
701694
backends.H5NetCDFStore.encode_variable
702-
backends.H5NetCDFStore.get
703695
backends.H5NetCDFStore.get_attrs
704696
backends.H5NetCDFStore.get_dimensions
705697
backends.H5NetCDFStore.get_encoding
706698
backends.H5NetCDFStore.get_variables
707-
backends.H5NetCDFStore.items
708-
backends.H5NetCDFStore.keys
709699
backends.H5NetCDFStore.load
710700
backends.H5NetCDFStore.open_store_variable
711701
backends.H5NetCDFStore.prepare_variable
@@ -718,39 +708,25 @@
718708
backends.H5NetCDFStore.store
719709
backends.H5NetCDFStore.store_dataset
720710
backends.H5NetCDFStore.sync
721-
backends.H5NetCDFStore.values
722-
backends.H5NetCDFStore.attrs
723-
backends.H5NetCDFStore.dimensions
724711
backends.H5NetCDFStore.ds
725-
backends.H5NetCDFStore.variables
726712

727713
backends.PydapDataStore.close
728-
backends.PydapDataStore.get
729714
backends.PydapDataStore.get_attrs
730715
backends.PydapDataStore.get_dimensions
731716
backends.PydapDataStore.get_encoding
732717
backends.PydapDataStore.get_variables
733-
backends.PydapDataStore.items
734-
backends.PydapDataStore.keys
735718
backends.PydapDataStore.load
736719
backends.PydapDataStore.open
737720
backends.PydapDataStore.open_store_variable
738-
backends.PydapDataStore.values
739-
backends.PydapDataStore.attrs
740-
backends.PydapDataStore.dimensions
741-
backends.PydapDataStore.variables
742721

743722
backends.ScipyDataStore.close
744723
backends.ScipyDataStore.encode
745724
backends.ScipyDataStore.encode_attribute
746725
backends.ScipyDataStore.encode_variable
747-
backends.ScipyDataStore.get
748726
backends.ScipyDataStore.get_attrs
749727
backends.ScipyDataStore.get_dimensions
750728
backends.ScipyDataStore.get_encoding
751729
backends.ScipyDataStore.get_variables
752-
backends.ScipyDataStore.items
753-
backends.ScipyDataStore.keys
754730
backends.ScipyDataStore.load
755731
backends.ScipyDataStore.open_store_variable
756732
backends.ScipyDataStore.prepare_variable
@@ -763,11 +739,7 @@
763739
backends.ScipyDataStore.store
764740
backends.ScipyDataStore.store_dataset
765741
backends.ScipyDataStore.sync
766-
backends.ScipyDataStore.values
767-
backends.ScipyDataStore.attrs
768-
backends.ScipyDataStore.dimensions
769742
backends.ScipyDataStore.ds
770-
backends.ScipyDataStore.variables
771743

772744
backends.FileManager.acquire
773745
backends.FileManager.acquire_context

doc/api.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,9 @@ Universal functions
572572
With recent versions of numpy, dask and xarray, NumPy ufuncs are now
573573
supported directly on all xarray and dask objects. This obviates the need
574574
for the ``xarray.ufuncs`` module, which should not be used for new code
575-
unless compatibility with versions of NumPy prior to v1.13 is required.
575+
unless compatibility with versions of NumPy prior to v1.13 is
576+
required. They will be removed once support for NumPy prior to
577+
v1.17 is dropped.
576578

577579
These functions are copied from NumPy, but extended to work on NumPy arrays,
578580
dask arrays and all xarray objects. You can find them in the ``xarray.ufuncs``

doc/computation.rst

+11-4
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,16 @@ a value when aggregating:
188188
r = arr.rolling(y=3, center=True, min_periods=2)
189189
r.mean()
190190
191+
From version 0.17, xarray supports multidimensional rolling,
192+
193+
.. ipython:: python
194+
195+
r = arr.rolling(x=2, y=3, min_periods=2)
196+
r.mean()
197+
191198
.. tip::
192199

193-
Note that rolling window aggregations are faster and use less memory when bottleneck_ is installed. This only applies to numpy-backed xarray objects.
200+
Note that rolling window aggregations are faster and use less memory when bottleneck_ is installed. This only applies to numpy-backed xarray objects with 1d-rolling.
194201

195202
.. _bottleneck: https://github.com/pydata/bottleneck/
196203

@@ -227,9 +234,9 @@ windowed rolling, convolution, short-time FFT etc.
227234
.. ipython:: python
228235
229236
# rolling with 2-point stride
230-
rolling_da = r.construct("window_dim", stride=2)
237+
rolling_da = r.construct(x="x_win", y="y_win", stride=2)
231238
rolling_da
232-
rolling_da.mean("window_dim", skipna=False)
239+
rolling_da.mean(["x_win", "y_win"], skipna=False)
233240
234241
Because the ``DataArray`` given by ``r.construct('window_dim')`` is a view
235242
of the original array, it is memory efficient.
@@ -238,7 +245,7 @@ You can also use ``construct`` to compute a weighted rolling sum:
238245
.. ipython:: python
239246
240247
weight = xr.DataArray([0.25, 0.5, 0.25], dims=["window"])
241-
arr.rolling(y=3).construct("window").dot(weight)
248+
arr.rolling(y=3).construct(y="window").dot(weight)
242249
243250
.. note::
244251
numpy's Nan-aggregation functions such as ``nansum`` copy the original array.

0 commit comments

Comments
 (0)