Skip to content

Commit a3cc075

Browse files
committed
Merge branch 'main' into get_slice_bound-kind
2 parents f8607aa + 214bbe0 commit a3cc075

Some content is hidden

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

76 files changed

+752
-411
lines changed

.github/workflows/ci-additional.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
$PYTEST_EXTRA_FLAGS
103103
104104
- name: Upload code coverage to Codecov
105-
uses: codecov/codecov-action@v2.0.3
105+
uses: codecov/codecov-action@v2.1.0
106106
with:
107107
file: ./coverage.xml
108108
flags: unittests,${{ matrix.env }}

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
path: pytest.xml
101101

102102
- name: Upload code coverage to Codecov
103-
uses: codecov/codecov-action@v2.0.3
103+
uses: codecov/codecov-action@v2.1.0
104104
with:
105105
file: ./coverage.xml
106106
flags: unittests

.pre-commit-config.yaml

Lines changed: 6 additions & 5 deletions
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.7b0
16+
rev: 21.9b0
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/keewis/blackdoc
@@ -30,20 +30,21 @@ repos:
3030
# - id: velin
3131
# args: ["--write", "--compact"]
3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v0.910
33+
rev: v0.910-1
3434
hooks:
3535
- id: mypy
36-
# Copied from setup.cfg
37-
exclude: "properties|asv_bench"
36+
# `properies` & `asv_bench` are copied from setup.cfg.
37+
# `_typed_ops.py` is added since otherwise mypy will complain (but notably only in pre-commit)
38+
exclude: "properties|asv_bench|_typed_ops.py"
3839
additional_dependencies: [
3940
# Type stubs
4041
types-python-dateutil,
4142
types-pkg_resources,
4243
types-PyYAML,
4344
types-pytz,
45+
typing-extensions==3.10.0.0,
4446
# Dependencies that are typed
4547
numpy,
46-
typing-extensions==3.10.0.0,
4748
]
4849
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
4950
# - repo: https://github.com/asottile/pyupgrade

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ to support our efforts.
105105
History
106106
-------
107107

108-
xarray is an evolution of an internal tool developed at `The Climate
108+
Xarray is an evolution of an internal tool developed at `The Climate
109109
Corporation`__. It was originally written by Climate Corp researchers Stephan
110110
Hoyer, Alex Kleeman and Eugene Brevdo and was released as open source in
111111
May 2014. The project was renamed from "xray" in January 2016. Xarray became a
@@ -131,16 +131,16 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131131
See the License for the specific language governing permissions and
132132
limitations under the License.
133133

134-
xarray bundles portions of pandas, NumPy and Seaborn, all of which are available
134+
Xarray bundles portions of pandas, NumPy and Seaborn, all of which are available
135135
under a "3-clause BSD" license:
136136
- pandas: setup.py, xarray/util/print_versions.py
137137
- NumPy: xarray/core/npcompat.py
138138
- Seaborn: _determine_cmap_params in xarray/core/plot/utils.py
139139

140-
xarray also bundles portions of CPython, which is available under the "Python
140+
Xarray also bundles portions of CPython, which is available under the "Python
141141
Software Foundation License" in xarray/core/pycompat.py.
142142

143-
xarray uses icons from the icomoon package (free version), which is
143+
Xarray uses icons from the icomoon package (free version), which is
144144
available under the "CC BY 4.0" license.
145145

146146
The full text of these licenses are included in the licenses directory.

asv_bench/benchmarks/groupby.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import numpy as np
2+
3+
import xarray as xr
4+
5+
from . import parameterized, requires_dask
6+
7+
8+
class GroupBy:
9+
def setup(self, *args, **kwargs):
10+
self.ds = xr.Dataset(
11+
{
12+
"a": xr.DataArray(np.r_[np.arange(500.0), np.arange(500.0)]),
13+
"b": xr.DataArray(np.arange(1000.0)),
14+
}
15+
)
16+
17+
@parameterized(["method"], [("sum", "mean")])
18+
def time_agg(self, method):
19+
return getattr(self.ds.groupby("a"), method)()
20+
21+
22+
class GroupByDask(GroupBy):
23+
def setup(self, *args, **kwargs):
24+
requires_dask()
25+
super().setup(**kwargs)
26+
self.ds = self.ds.chunk({"dim_0": 50})
27+
28+
29+
class GroupByDataFrame(GroupBy):
30+
def setup(self, *args, **kwargs):
31+
super().setup(**kwargs)
32+
self.ds = self.ds.to_dataframe()
33+
34+
35+
class GroupByDaskDataFrame(GroupBy):
36+
def setup(self, *args, **kwargs):
37+
requires_dask()
38+
super().setup(**kwargs)
39+
self.ds = self.ds.chunk({"dim_0": 50}).to_dataframe()

ci/requirements/doc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ dependencies:
2323
- pooch
2424
- pip
2525
- pydata-sphinx-theme>=0.4.3
26+
- pyproj
2627
- rasterio>=1.1
2728
- seaborn
2829
- setuptools

doc/api.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Top-level functions
3535
map_blocks
3636
show_versions
3737
set_options
38+
get_options
3839
unify_chunks
3940

4041
Dataset
@@ -598,8 +599,8 @@ Universal functions
598599

599600
.. warning::
600601

601-
With recent versions of numpy, dask and xarray, NumPy ufuncs are now
602-
supported directly on all xarray and dask objects. This obviates the need
602+
With recent versions of NumPy, Dask and xarray, NumPy ufuncs are now
603+
supported directly on all xarray and Dask objects. This obviates the need
603604
for the ``xarray.ufuncs`` module, which should not be used for new code
604605
unless compatibility with versions of NumPy prior to v1.13 is
605606
required. They will be removed once support for NumPy prior to

doc/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@
260260
ogp_image = "https://xarray.pydata.org/en/stable/_static/dataset-diagram-logo.png"
261261
ogp_custom_meta_tags = [
262262
'<meta name="twitter:card" content="summary_large_image" />',
263-
'<meta property="twitter:site" content="@xarray_dev />',
264-
'<meta name="image" property="og:image" content="https://xarray.pydata.org/en/stable/_static/dataset-diagram-logo.png">',
263+
'<meta property="twitter:site" content="@xarray_dev" />',
264+
'<meta name="image" property="og:image" content="https://xarray.pydata.org/en/stable/_static/dataset-diagram-logo.png" />',
265265
]
266266

267267
# Redirects for pages that were moved to new locations

doc/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Some other important things to know about the docs:
257257
tutorial-like overviews per topic together with some other information
258258
(what's new, installation, etc).
259259

260-
- The docstrings follow the **Numpy Docstring Standard**, which is used widely
260+
- The docstrings follow the **NumPy Docstring Standard**, which is used widely
261261
in the Scientific Python community. This standard specifies the format of
262262
the different sections of the docstring. See `this document
263263
<https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard>`_

doc/ecosystem.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Geosciences
5050
Machine Learning
5151
~~~~~~~~~~~~~~~~
5252
- `ArviZ <https://arviz-devs.github.io/arviz/>`_: Exploratory analysis of Bayesian models, built on top of xarray.
53+
- `Darts <https://github.com/unit8co/darts/>`_: User-friendly modern machine learning for time series in Python.
5354
- `Elm <https://ensemble-learning-models.readthedocs.io>`_: Parallel machine learning on xarray data structures
5455
- `sklearn-xarray (1) <https://phausamann.github.io/sklearn-xarray>`_: Combines scikit-learn and xarray (1).
5556
- `sklearn-xarray (2) <https://sklearn-xarray.readthedocs.io/en/latest/>`_: Combines scikit-learn and xarray (2).

0 commit comments

Comments
 (0)