Skip to content

Commit 8ecbb39

Browse files
committed
Merge branch 'main' into pr/5763
2 parents de437eb + 69dec51 commit 8ecbb39

Some content is hidden

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

83 files changed

+940
-555
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: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ 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
19+
- id: black-jupyter
1920
- repo: https://github.com/keewis/blackdoc
2021
rev: v0.3.4
2122
hooks:
@@ -30,20 +31,21 @@ repos:
3031
# - id: velin
3132
# args: ["--write", "--compact"]
3233
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v0.910
34+
rev: v0.910-1
3435
hooks:
3536
- id: mypy
36-
# Copied from setup.cfg
37-
exclude: "properties|asv_bench"
37+
# `properies` & `asv_bench` are copied from setup.cfg.
38+
# `_typed_ops.py` is added since otherwise mypy will complain (but notably only in pre-commit)
39+
exclude: "properties|asv_bench|_typed_ops.py"
3840
additional_dependencies: [
3941
# Type stubs
4042
types-python-dateutil,
4143
types-pkg_resources,
4244
types-PyYAML,
4345
types-pytz,
46+
typing-extensions==3.10.0.0,
4447
# Dependencies that are typed
4548
numpy,
46-
typing-extensions==3.10.0.0,
4749
]
4850
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
4951
# - 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()

asv_bench/benchmarks/import_xarray.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class ImportXarray:
2+
def setup(self, *args, **kwargs):
3+
def import_xr():
4+
import xarray # noqa: F401
5+
6+
self._import_xr = import_xr
7+
8+
def time_import_xarray(self):
9+
self._import_xr()

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>`_

0 commit comments

Comments
 (0)