Skip to content

Commit b5cc831

Browse files
authored
Merge branch 'master' into propagate-attrs
2 parents 092edea + 23dc2fc commit b5cc831

File tree

100 files changed

+3440
-2234
lines changed

Some content is hidden

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

100 files changed

+3440
-2234
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
repos:
33
# isort should run before black as black sometimes tweaks the isort output
44
- repo: https://github.com/timothycrosley/isort
5-
rev: 5.1.0
5+
rev: 5.4.2
66
hooks:
77
- id: isort
88
# https://github.com/python/black#version-control-integration
9-
- repo: https://github.com/python/black
10-
rev: stable
9+
- repo: https://github.com/psf/black
10+
rev: 20.8b1
1111
hooks:
1212
- id: black
1313
- repo: https://github.com/keewis/blackdoc
14-
rev: stable
14+
rev: v0.1.2
1515
hooks:
1616
- id: blackdoc
1717
- repo: https://gitlab.com/pycqa/flake8
1818
rev: 3.8.3
1919
hooks:
2020
- id: flake8
2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: v0.780 # Must match ci/requirements/*.yml
22+
rev: v0.782 # Must match ci/requirements/*.yml
2323
hooks:
2424
- id: mypy
2525
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194

ci/requirements/doc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ dependencies:
2424
- rasterio>=1.1
2525
- seaborn
2626
- setuptools
27-
- sphinx=3.1
27+
- sphinx=3.2
2828
- sphinx_rtd_theme>=0.4
2929
- sphinx-autosummary-accessors
3030
- zarr>=2.4
31+
- pip
32+
- pip:
33+
# relative to this file. Needs to be editable to be accepted.
34+
- -e ../..

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ dependencies:
2626
- isort
2727
- lxml=4.4 # Optional dep of pydap
2828
- matplotlib=3.1
29-
- mypy=0.761 # Must match .pre-commit-config.yaml
29+
- mypy=0.782 # Must match .pre-commit-config.yaml
3030
- nc-time-axis=1.2
3131
- netcdf4=1.4
3232
- numba=0.46

ci/requirements/py36.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py37-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py37.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- isort
2323
- lxml # Optional dep of pydap
2424
- matplotlib
25-
- mypy=0.761 # Must match .pre-commit-config.yaml
25+
- mypy=0.782 # Must match .pre-commit-config.yaml
2626
- nc-time-axis
2727
- netcdf4
2828
- numba

ci/requirements/py38-all-but-dask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- isort
2020
- lxml # Optional dep of pydap
2121
- matplotlib
22-
- mypy=0.761 # Must match .pre-commit-config.yaml
22+
- mypy=0.782 # Must match .pre-commit-config.yaml
2323
- nc-time-axis
2424
- netcdf4
2525
- numba

conftest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def pytest_runtest_setup(item):
2424

2525

2626
@pytest.fixture(autouse=True)
27-
def add_standard_imports(doctest_namespace):
27+
def add_standard_imports(doctest_namespace, tmpdir):
2828
import numpy as np
2929
import pandas as pd
3030

@@ -33,3 +33,9 @@ def add_standard_imports(doctest_namespace):
3333
doctest_namespace["np"] = np
3434
doctest_namespace["pd"] = pd
3535
doctest_namespace["xr"] = xr
36+
37+
# always seed numpy.random to make the examples deterministic
38+
np.random.seed(0)
39+
40+
# always switch to the temporary directory, so files get written there
41+
tmpdir.chdir()

doc/api-hidden.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
core.rolling.DatasetCoarsen.var
5353
core.rolling.DatasetCoarsen.boundary
5454
core.rolling.DatasetCoarsen.coord_func
55+
core.rolling.DatasetCoarsen.keep_attrs
5556
core.rolling.DatasetCoarsen.obj
5657
core.rolling.DatasetCoarsen.side
5758
core.rolling.DatasetCoarsen.trim_excess
@@ -104,6 +105,8 @@
104105
core.resample.DatasetResample.dims
105106
core.resample.DatasetResample.groups
106107

108+
core.rolling.DatasetRolling.argmax
109+
core.rolling.DatasetRolling.argmin
107110
core.rolling.DatasetRolling.count
108111
core.rolling.DatasetRolling.max
109112
core.rolling.DatasetRolling.mean
@@ -115,11 +118,15 @@
115118
core.rolling.DatasetRolling.var
116119
core.rolling.DatasetRolling.center
117120
core.rolling.DatasetRolling.dim
121+
core.rolling.DatasetRolling.keep_attrs
118122
core.rolling.DatasetRolling.min_periods
119123
core.rolling.DatasetRolling.obj
120124
core.rolling.DatasetRolling.rollings
121125
core.rolling.DatasetRolling.window
122126

127+
core.weighted.DatasetWeighted.obj
128+
core.weighted.DatasetWeighted.weights
129+
123130
core.rolling_exp.RollingExp.mean
124131

125132
Dataset.argsort
@@ -188,6 +195,7 @@
188195
core.rolling.DataArrayCoarsen.var
189196
core.rolling.DataArrayCoarsen.boundary
190197
core.rolling.DataArrayCoarsen.coord_func
198+
core.rolling.DataArrayCoarsen.keep_attrs
191199
core.rolling.DataArrayCoarsen.obj
192200
core.rolling.DataArrayCoarsen.side
193201
core.rolling.DataArrayCoarsen.trim_excess
@@ -238,6 +246,8 @@
238246
core.resample.DataArrayResample.dims
239247
core.resample.DataArrayResample.groups
240248

249+
core.rolling.DataArrayRolling.argmax
250+
core.rolling.DataArrayRolling.argmin
241251
core.rolling.DataArrayRolling.count
242252
core.rolling.DataArrayRolling.max
243253
core.rolling.DataArrayRolling.mean
@@ -249,11 +259,15 @@
249259
core.rolling.DataArrayRolling.var
250260
core.rolling.DataArrayRolling.center
251261
core.rolling.DataArrayRolling.dim
262+
core.rolling.DataArrayRolling.keep_attrs
252263
core.rolling.DataArrayRolling.min_periods
253264
core.rolling.DataArrayRolling.obj
254265
core.rolling.DataArrayRolling.window
255266
core.rolling.DataArrayRolling.window_labels
256267

268+
core.weighted.DataArrayWeighted.obj
269+
core.weighted.DataArrayWeighted.weights
270+
257271
DataArray.argsort
258272
DataArray.clip
259273
DataArray.conj
@@ -277,6 +291,13 @@
277291
core.accessor_dt.DatetimeAccessor.days_in_month
278292
core.accessor_dt.DatetimeAccessor.daysinmonth
279293
core.accessor_dt.DatetimeAccessor.hour
294+
core.accessor_dt.DatetimeAccessor.is_leap_year
295+
core.accessor_dt.DatetimeAccessor.is_month_end
296+
core.accessor_dt.DatetimeAccessor.is_month_start
297+
core.accessor_dt.DatetimeAccessor.is_quarter_end
298+
core.accessor_dt.DatetimeAccessor.is_quarter_start
299+
core.accessor_dt.DatetimeAccessor.is_year_end
300+
core.accessor_dt.DatetimeAccessor.is_year_start
280301
core.accessor_dt.DatetimeAccessor.microsecond
281302
core.accessor_dt.DatetimeAccessor.minute
282303
core.accessor_dt.DatetimeAccessor.month
@@ -291,6 +312,14 @@
291312
core.accessor_dt.DatetimeAccessor.weekofyear
292313
core.accessor_dt.DatetimeAccessor.year
293314

315+
core.accessor_dt.TimedeltaAccessor.ceil
316+
core.accessor_dt.TimedeltaAccessor.floor
317+
core.accessor_dt.TimedeltaAccessor.round
318+
core.accessor_dt.TimedeltaAccessor.days
319+
core.accessor_dt.TimedeltaAccessor.microseconds
320+
core.accessor_dt.TimedeltaAccessor.nanoseconds
321+
core.accessor_dt.TimedeltaAccessor.seconds
322+
294323
core.accessor_str.StringAccessor.capitalize
295324
core.accessor_str.StringAccessor.center
296325
core.accessor_str.StringAccessor.contains
@@ -365,6 +394,7 @@
365394
Variable.min
366395
Variable.no_conflicts
367396
Variable.notnull
397+
Variable.pad
368398
Variable.prod
369399
Variable.quantile
370400
Variable.rank
@@ -407,6 +437,8 @@
407437

408438
IndexVariable.all
409439
IndexVariable.any
440+
IndexVariable.argmax
441+
IndexVariable.argmin
410442
IndexVariable.argsort
411443
IndexVariable.astype
412444
IndexVariable.broadcast_equals
@@ -436,6 +468,7 @@
436468
IndexVariable.min
437469
IndexVariable.no_conflicts
438470
IndexVariable.notnull
471+
IndexVariable.pad
439472
IndexVariable.prod
440473
IndexVariable.quantile
441474
IndexVariable.rank
@@ -538,6 +571,16 @@
538571
ufuncs.tanh
539572
ufuncs.trunc
540573

574+
plot.plot
575+
plot.line
576+
plot.step
577+
plot.hist
578+
plot.contour
579+
plot.contourf
580+
plot.imshow
581+
plot.pcolormesh
582+
plot.scatter
583+
541584
plot.FacetGrid.map_dataarray
542585
plot.FacetGrid.set_titles
543586
plot.FacetGrid.set_ticks
@@ -547,11 +590,16 @@
547590
CFTimeIndex.any
548591
CFTimeIndex.append
549592
CFTimeIndex.argsort
593+
CFTimeIndex.argmax
594+
CFTimeIndex.argmin
550595
CFTimeIndex.asof
551596
CFTimeIndex.asof_locs
552597
CFTimeIndex.astype
598+
CFTimeIndex.calendar
599+
CFTimeIndex.ceil
553600
CFTimeIndex.contains
554601
CFTimeIndex.copy
602+
CFTimeIndex.days_in_month
555603
CFTimeIndex.delete
556604
CFTimeIndex.difference
557605
CFTimeIndex.drop
@@ -562,6 +610,7 @@
562610
CFTimeIndex.equals
563611
CFTimeIndex.factorize
564612
CFTimeIndex.fillna
613+
CFTimeIndex.floor
565614
CFTimeIndex.format
566615
CFTimeIndex.get_indexer
567616
CFTimeIndex.get_indexer_for
@@ -602,6 +651,7 @@
602651
CFTimeIndex.reindex
603652
CFTimeIndex.rename
604653
CFTimeIndex.repeat
654+
CFTimeIndex.round
605655
CFTimeIndex.searchsorted
606656
CFTimeIndex.set_names
607657
CFTimeIndex.set_value
@@ -688,15 +738,20 @@
688738
backends.NetCDF4DataStore.is_remote
689739
backends.NetCDF4DataStore.lock
690740

741+
backends.H5NetCDFStore.autoclose
691742
backends.H5NetCDFStore.close
692743
backends.H5NetCDFStore.encode
693744
backends.H5NetCDFStore.encode_attribute
694745
backends.H5NetCDFStore.encode_variable
746+
backends.H5NetCDFStore.format
695747
backends.H5NetCDFStore.get_attrs
696748
backends.H5NetCDFStore.get_dimensions
697749
backends.H5NetCDFStore.get_encoding
698750
backends.H5NetCDFStore.get_variables
751+
backends.H5NetCDFStore.is_remote
699752
backends.H5NetCDFStore.load
753+
backends.H5NetCDFStore.lock
754+
backends.H5NetCDFStore.open
700755
backends.H5NetCDFStore.open_store_variable
701756
backends.H5NetCDFStore.prepare_variable
702757
backends.H5NetCDFStore.set_attribute

doc/combining.rst

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,6 @@ in this manner.
244244
Combining along multiple dimensions
245245
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
246246

247-
.. note::
248-
249-
There are currently three combining functions with similar names:
250-
:py:func:`~xarray.auto_combine`, :py:func:`~xarray.combine_by_coords`, and
251-
:py:func:`~xarray.combine_nested`. This is because
252-
``auto_combine`` is in the process of being deprecated in favour of the other
253-
two functions, which are more general. If your code currently relies on
254-
``auto_combine``, then you will be able to get similar functionality by using
255-
``combine_nested``.
256-
257247
For combining many objects along multiple dimensions xarray provides
258248
:py:func:`~xarray.combine_nested` and :py:func:`~xarray.combine_by_coords`. These
259249
functions use a combination of ``concat`` and ``merge`` across different

0 commit comments

Comments
 (0)