Skip to content

Commit 068aac7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into patch-1
* upstream/master: (75 commits) Implement idxmax and idxmin functions (pydata#3871) Update pre-commit-config.yaml (pydata#3911) Revert "Use `fixes` in PR template (pydata#3886)" (pydata#3912) update the docstring of diff (pydata#3909) Un-xfail test_dayofyear_after_cftime_range (pydata#3907) Limit repr of arrays containing long strings (pydata#3900) expose a few zarr backend functions as semi-public api (pydata#3897) Use drawstyle instead of linestyle in plot.step. (pydata#3274) Implementation of polyfit and polyval (pydata#3733) misplaced quote in whatsnew (pydata#3889) Rename ordered_dict_intersection -> compat_dict_intersection (pydata#3887) Control attrs of result in `merge()`, `concat()`, `combine_by_coords()` and `combine_nested()` (pydata#3877) xfail test_uamiv_format_write (pydata#3885) Use `fixes` in PR template (pydata#3886) Tweaks to "how_to_release" (pydata#3882) whatsnew section for 0.16.0 Release v0.15.1 whatsnew for 0.15.1 (pydata#3879) update panel documentation (pydata#3880) reword the whats-new entry for unit support (pydata#3878) ...
2 parents 4f0b873 + 1416d5a commit 068aac7

Some content is hidden

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

84 files changed

+6218
-910
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ assignees: ''
77

88
---
99

10+
<!-- A short summary of the issue, if appropriate -->
11+
12+
1013
#### MCVE Code Sample
1114
<!-- In order for the maintainers to efficiently understand and prioritize issues, we ask you post a "Minimal, Complete and Verifiable Example" (MCVE): http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports -->
1215

@@ -22,8 +25,11 @@ assignees: ''
2225
<!-- this should explain why the current behavior is a problem and why the expected output is a better solution -->
2326

2427

25-
#### Output of ``xr.show_versions()``
26-
<details>
27-
# Paste the output here xr.show_versions() here
28+
#### Versions
29+
30+
<details><summary>Output of `xr.show_versions()`</summary>
31+
32+
<!-- Paste the output here xr.show_versions() here -->
33+
2834

2935
</details>

.pre-commit-config.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ repos:
55
rev: 4.3.21-2
66
hooks:
77
- id: isort
8+
files: .+\.py$
89
# https://github.com/python/black#version-control-integration
910
- repo: https://github.com/python/black
1011
rev: stable
1112
hooks:
1213
- id: black
13-
- repo: https://github.com/pre-commit/pre-commit-hooks
14-
rev: v2.2.3
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.7.9
1516
hooks:
1617
- id: flake8
1718
- repo: https://github.com/pre-commit/mirrors-mypy

HOW_TO_RELEASE.md

+49-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
How to issue an xarray release in 14 easy steps
1+
How to issue an xarray release in 16 easy steps
22

33
Time required: about an hour.
44

@@ -20,32 +20,37 @@ Time required: about an hour.
2020
```
2121
pytest
2222
```
23-
4. On the master branch, commit the release in git:
23+
4. Check that the ReadTheDocs build is passing.
24+
5. On the master branch, commit the release in git:
2425
```
25-
git commit -a -m 'Release v0.X.Y'
26+
git commit -am 'Release v0.X.Y'
2627
```
27-
5. Tag the release:
28+
6. Tag the release:
2829
```
2930
git tag -a v0.X.Y -m 'v0.X.Y'
3031
```
31-
6. Build source and binary wheels for pypi:
32+
7. Build source and binary wheels for pypi:
3233
```
3334
git clean -xdf # this deletes all uncommited changes!
3435
python setup.py bdist_wheel sdist
3536
```
36-
7. Use twine to register and upload the release on pypi. Be careful, you can't
37+
8. Use twine to check the package build:
38+
```
39+
twine check dist/xarray-0.X.Y*
40+
```
41+
9. Use twine to register and upload the release on pypi. Be careful, you can't
3742
take this back!
3843
```
3944
twine upload dist/xarray-0.X.Y*
4045
```
4146
You will need to be listed as a package owner at
4247
https://pypi.python.org/pypi/xarray for this to work.
43-
8. Push your changes to master:
48+
10. Push your changes to master:
4449
```
4550
git push upstream master
4651
git push upstream --tags
4752
```
48-
9. Update the stable branch (used by ReadTheDocs) and switch back to master:
53+
11. Update the stable branch (used by ReadTheDocs) and switch back to master:
4954
```
5055
git checkout stable
5156
git rebase master
@@ -55,20 +60,45 @@ Time required: about an hour.
5560
It's OK to force push to 'stable' if necessary. (We also update the stable
5661
branch with `git cherrypick` for documentation only fixes that apply the
5762
current released version.)
58-
10. Add a section for the next release (v.X.(Y+1)) to doc/whats-new.rst.
59-
11. Commit your changes and push to master again:
63+
12. Add a section for the next release (v.X.Y+1) to doc/whats-new.rst:
64+
```
65+
.. _whats-new.0.X.Y+1:
66+
67+
v0.X.Y+1 (unreleased)
68+
---------------------
69+
70+
Breaking changes
71+
~~~~~~~~~~~~~~~~
72+
73+
74+
New Features
75+
~~~~~~~~~~~~
76+
77+
78+
Bug fixes
79+
~~~~~~~~~
80+
81+
82+
Documentation
83+
~~~~~~~~~~~~~
84+
85+
86+
Internal Changes
87+
~~~~~~~~~~~~~~~~
88+
```
89+
13. Commit your changes and push to master again:
6090
```
61-
git commit -a -m 'New whatsnew section'
91+
git commit -am 'New whatsnew section'
6292
git push upstream master
6393
```
6494
You're done pushing to master!
65-
12. Issue the release on GitHub. Click on "Draft a new release" at
95+
14. Issue the release on GitHub. Click on "Draft a new release" at
6696
https://github.com/pydata/xarray/releases. Type in the version number, but
6797
don't bother to describe it -- we maintain that on the docs instead.
68-
13. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
98+
15. Update the docs. Login to https://readthedocs.org/projects/xray/versions/
6999
and switch your new release tag (at the bottom) from "Inactive" to "Active".
70100
It should now build automatically.
71-
14. Issue the release announcement! For bug fix releases, I usually only email
101+
16. Issue the release announcement! For bug fix releases, I usually only email
72102
[email protected]. For major/feature releases, I will email a broader
73103
list (no more than once every 3-6 months):
74104
@@ -83,15 +113,17 @@ Time required: about an hour.
83113
```
84114
git log "$(git tag --sort="v:refname" | sed -n 'x;$p').." --format="%aN" | sort -u
85115
```
86-
or by replacing `v0.X.Y` with the _previous_ release in:
116+
or by substituting the _previous_ release in:
87117
```
88-
git log v0.X.Y.. --format="%aN" | sort -u
118+
git log v0.X.Y-1.. --format="%aN" | sort -u
89119
```
120+
NB: copying this output into a Google Groups form can cause
121+
[issues](https://groups.google.com/forum/#!topic/xarray/hK158wAviPs) with line breaks, so take care
90122
91123
Note on version numbering:
92124
93125
We follow a rough approximation of semantic version. Only major releases (0.X.0)
94-
show include breaking changes. Minor releases (0.X.Y) are for bug fixes and
126+
should include breaking changes. Minor releases (0.X.Y) are for bug fixes and
95127
backwards compatible new features, but if a sufficient number of new features
96128
have arrived we will issue a major release even if there are no compatibility
97129
breaks.

azure-pipelines.yml

+10-9
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ jobs:
3232
steps:
3333
- template: ci/azure/unit-tests.yml
3434

35-
- job: MacOSX
36-
strategy:
37-
matrix:
38-
py38:
39-
conda_env: py38
40-
pool:
41-
vmImage: 'macOS-10.13'
42-
steps:
43-
- template: ci/azure/unit-tests.yml
35+
# excluded while waiting for https://github.com/conda-forge/libwebp-feedstock/issues/26
36+
# - job: MacOSX
37+
# strategy:
38+
# matrix:
39+
# py38:
40+
# conda_env: py38
41+
# pool:
42+
# vmImage: 'macOS-10.15'
43+
# steps:
44+
# - template: ci/azure/unit-tests.yml
4445

4546
- job: Windows
4647
strategy:

ci/azure/install.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ steps:
1919
--upgrade \
2020
matplotlib \
2121
numpy \
22-
pandas \
2322
scipy
2423
python -m pip install \
2524
--no-deps \
@@ -29,7 +28,9 @@ steps:
2928
git+https://github.com/zarr-developers/zarr \
3029
git+https://github.com/Unidata/cftime \
3130
git+https://github.com/mapbox/rasterio \
32-
git+https://github.com/pydata/bottleneck
31+
git+https://github.com/hgrecco/pint \
32+
git+https://github.com/pydata/bottleneck \
33+
git+https://github.com/pandas-dev/pandas
3334
condition: eq(variables['UPSTREAM_DEV'], 'true')
3435
displayName: Install upstream dev dependencies
3536

ci/requirements/doc.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,22 @@ dependencies:
66
- python=3.8
77
- bottleneck
88
- cartopy
9-
- cfgrib
10-
- h5netcdf
9+
- cfgrib>=0.9
10+
- dask>=2.10
11+
- h5netcdf>=0.7.4
1112
- ipykernel
1213
- ipython
13-
- iris
14+
- iris>=2.3
1415
- jupyter_client
1516
- nbsphinx
16-
- netcdf4
17+
- netcdf4>=1.5
1718
- numba
18-
- numpy
19+
- numpy>=1.17
1920
- numpydoc
20-
- pandas
21-
- rasterio
21+
- pandas>=1.0
22+
- rasterio>=1.1
2223
- seaborn
2324
- setuptools
24-
- sphinx
25-
- sphinx_rtd_theme
26-
- zarr
25+
- sphinx>=2.3
26+
- sphinx_rtd_theme>=0.4
27+
- zarr>=2.4

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

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ dependencies:
2626
- isort
2727
- lxml=4.4 # Optional dep of pydap
2828
- matplotlib=3.1
29+
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
2930
- mypy=0.761 # Must match .pre-commit-config.yaml
3031
- nc-time-axis=1.2
3132
- netcdf4=1.4

ci/requirements/py36-min-nep18.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ dependencies:
88
- coveralls
99
- dask=2.4
1010
- distributed=2.4
11+
- msgpack-python=0.6 # remove once distributed is bumped. distributed GH3491
1112
- numpy=1.17
1213
- pandas=0.25
13-
- pint=0.9 # Actually not enough as it doesn't implement __array_function__yet!
14+
- pint=0.11
1415
- pip
1516
- pytest
1617
- pytest-cov

conftest.py

+11
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,14 @@ def pytest_runtest_setup(item):
2121
pytest.skip(
2222
"set --run-network-tests to run test requiring an " "internet connection"
2323
)
24+
25+
26+
@pytest.fixture(autouse=True)
27+
def add_standard_imports(doctest_namespace):
28+
import numpy as np
29+
import pandas as pd
30+
import xarray as xr
31+
32+
doctest_namespace["np"] = np
33+
doctest_namespace["pd"] = pd
34+
doctest_namespace["xr"] = xr

doc/api-hidden.rst

-2
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,6 @@
379379
Variable.min
380380
Variable.no_conflicts
381381
Variable.notnull
382-
Variable.pad_with_fill_value
383382
Variable.prod
384383
Variable.quantile
385384
Variable.rank
@@ -453,7 +452,6 @@
453452
IndexVariable.min
454453
IndexVariable.no_conflicts
455454
IndexVariable.notnull
456-
IndexVariable.pad_with_fill_value
457455
IndexVariable.prod
458456
IndexVariable.quantile
459457
IndexVariable.rank

doc/api.rst

+27
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Top-level functions
3030
zeros_like
3131
ones_like
3232
dot
33+
polyval
3334
map_blocks
3435
show_versions
3536
set_options
@@ -165,18 +166,22 @@ Computation
165166
Dataset.groupby_bins
166167
Dataset.rolling
167168
Dataset.rolling_exp
169+
Dataset.weighted
168170
Dataset.coarsen
169171
Dataset.resample
170172
Dataset.diff
171173
Dataset.quantile
172174
Dataset.differentiate
173175
Dataset.integrate
176+
Dataset.polyfit
174177

175178
**Aggregation**:
176179
:py:attr:`~Dataset.all`
177180
:py:attr:`~Dataset.any`
178181
:py:attr:`~Dataset.argmax`
179182
:py:attr:`~Dataset.argmin`
183+
:py:attr:`~Dataset.idxmax`
184+
:py:attr:`~Dataset.idxmin`
180185
:py:attr:`~Dataset.max`
181186
:py:attr:`~Dataset.mean`
182187
:py:attr:`~Dataset.median`
@@ -220,6 +225,7 @@ Reshaping and reorganizing
220225
Dataset.to_stacked_array
221226
Dataset.shift
222227
Dataset.roll
228+
Dataset.pad
223229
Dataset.sortby
224230
Dataset.broadcast_like
225231

@@ -340,6 +346,7 @@ Computation
340346
DataArray.groupby_bins
341347
DataArray.rolling
342348
DataArray.rolling_exp
349+
DataArray.weighted
343350
DataArray.coarsen
344351
DataArray.dt
345352
DataArray.resample
@@ -349,13 +356,16 @@ Computation
349356
DataArray.quantile
350357
DataArray.differentiate
351358
DataArray.integrate
359+
DataArray.polyfit
352360
DataArray.str
353361

354362
**Aggregation**:
355363
:py:attr:`~DataArray.all`
356364
:py:attr:`~DataArray.any`
357365
:py:attr:`~DataArray.argmax`
358366
:py:attr:`~DataArray.argmin`
367+
:py:attr:`~DataArray.idxmax`
368+
:py:attr:`~DataArray.idxmin`
359369
:py:attr:`~DataArray.max`
360370
:py:attr:`~DataArray.mean`
361371
:py:attr:`~DataArray.median`
@@ -399,6 +409,7 @@ Reshaping and reorganizing
399409
DataArray.to_unstacked_dataset
400410
DataArray.shift
401411
DataArray.roll
412+
DataArray.pad
402413
DataArray.sortby
403414
DataArray.broadcast_like
404415

@@ -577,6 +588,22 @@ Rolling objects
577588
core.rolling.DatasetRolling.reduce
578589
core.rolling_exp.RollingExp
579590

591+
Weighted objects
592+
================
593+
594+
.. autosummary::
595+
:toctree: generated/
596+
597+
core.weighted.DataArrayWeighted
598+
core.weighted.DataArrayWeighted.mean
599+
core.weighted.DataArrayWeighted.sum
600+
core.weighted.DataArrayWeighted.sum_of_weights
601+
core.weighted.DatasetWeighted
602+
core.weighted.DatasetWeighted.mean
603+
core.weighted.DatasetWeighted.sum
604+
core.weighted.DatasetWeighted.sum_of_weights
605+
606+
580607
Coarsen objects
581608
===============
582609

0 commit comments

Comments
 (0)