Skip to content

Commit ac37672

Browse files
committed
Merge branch 'main' into repr_length_updates
* main: (31 commits) Refactor index vs. coordinate variable(s) (pydata#5636) pre-commit: autoupdate hook versions (pydata#5685) Flexible Indexes: Avoid len(index) in map_blocks (pydata#5670) Speed up _mapping_repr (pydata#5661) update the link to `scipy`'s intersphinx file (pydata#5665) Bump styfle/cancel-workflow-action from 0.9.0 to 0.9.1 (pydata#5663) pre-commit: autoupdate hook versions (pydata#5660) fix the binder environment (pydata#5650) Update api.rst (pydata#5639) Kwargs to rasterio open (pydata#5609) Bump codecov/codecov-action from 1 to 2.0.2 (pydata#5633) new blank whats-new for v0.19.1 v0.19.0 release notes (pydata#5632) remove deprecations scheduled for 0.19 (pydata#5630) Make typing-extensions optional (pydata#5624) Plots get labels from pint arrays (pydata#5561) Add to_numpy() and as_numpy() methods (pydata#5568) pin fsspec (pydata#5627) pre-commit: autoupdate hook versions (pydata#5617) Add dataarray scatter with 3d support (pydata#4909) ...
2 parents 3896e8e + 4bb9d9c commit ac37672

Some content is hidden

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

51 files changed

+1979
-752
lines changed

.binder/environment.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: xarray-examples
22
channels:
33
- conda-forge
44
dependencies:
5-
- python=3.8
5+
- python=3.9
66
- boto3
77
- bottleneck
88
- cartopy
@@ -26,6 +26,7 @@ dependencies:
2626
- pandas
2727
- pint
2828
- pip
29+
- pooch
2930
- pydap
3031
- pynio
3132
- rasterio

.github/workflows/cancel-duplicate-runs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ jobs:
1010
runs-on: ubuntu-latest
1111
if: github.repository == 'pydata/xarray'
1212
steps:
13-
- uses: styfle/[email protected].0
13+
- uses: styfle/[email protected].1
1414
with:
1515
workflow_id: ${{ github.event.workflow.id }}

.github/workflows/ci-additional.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
$PYTEST_EXTRA_FLAGS
104104
105105
- name: Upload code coverage to Codecov
106-
uses: codecov/codecov-action@v1
106+
uses: codecov/codecov-action@v2.0.2
107107
with:
108108
file: ./coverage.xml
109109
flags: unittests,${{ matrix.env }}

.github/workflows/ci-pre-commit-autoupdate.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3636
EXECUTE_COMMANDS: |
3737
python -m pre_commit autoupdate
38-
python .github/workflows/sync_linter_versions.py .pre-commit-config.yaml ci/requirements/mypy_only
3938
python -m pre_commit run --all-files
4039
COMMIT_MESSAGE: 'pre-commit: autoupdate hook versions'
4140
COMMIT_NAME: 'github-actions[bot]'

.github/workflows/ci.yaml

+1-1
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@v1
103+
uses: codecov/codecov-action@v2.0.2
104104
with:
105105
file: ./coverage.xml
106106
flags: unittests

.github/workflows/sync_linter_versions.py

-76
This file was deleted.

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ repos:
88
- id: check-yaml
99
# isort should run before black as black sometimes tweaks the isort output
1010
- repo: https://github.com/PyCQA/isort
11-
rev: 5.9.1
11+
rev: 5.9.3
1212
hooks:
1313
- id: isort
1414
# https://github.com/python/black#version-control-integration
1515
- repo: https://github.com/psf/black
16-
rev: 21.6b0
16+
rev: 21.7b0
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/keewis/blackdoc
20-
rev: v0.3.3
20+
rev: v0.3.4
2121
hooks:
2222
- id: blackdoc
2323
- repo: https://gitlab.com/pycqa/flake8
@@ -30,7 +30,6 @@ repos:
3030
# - id: velin
3131
# args: ["--write", "--compact"]
3232
- repo: https://github.com/pre-commit/mirrors-mypy
33-
# version must correspond to the one in .github/workflows/ci-additional.yaml
3433
rev: v0.910
3534
hooks:
3635
- id: mypy
@@ -44,6 +43,7 @@ repos:
4443
types-pytz,
4544
# Dependencies that are typed
4645
numpy,
46+
typing-extensions==3.10.0.0,
4747
]
4848
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
4949
# - repo: https://github.com/asottile/pyupgrade

asv_bench/benchmarks/repr.py

+22
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1+
import numpy as np
12
import pandas as pd
23

34
import xarray as xr
45

56

7+
class Repr:
8+
def setup(self):
9+
a = np.arange(0, 100)
10+
data_vars = dict()
11+
for i in a:
12+
data_vars[f"long_variable_name_{i}"] = xr.DataArray(
13+
name=f"long_variable_name_{i}",
14+
data=np.arange(0, 20),
15+
dims=[f"long_coord_name_{i}_x"],
16+
coords={f"long_coord_name_{i}_x": np.arange(0, 20) * 2},
17+
)
18+
self.ds = xr.Dataset(data_vars)
19+
self.ds.attrs = {f"attr_{k}": 2 for k in a}
20+
21+
def time_repr(self):
22+
repr(self.ds)
23+
24+
def time_repr_html(self):
25+
self.ds._repr_html_()
26+
27+
628
class ReprMultiIndex:
729
def setup(self):
830
index = pd.MultiIndex.from_product(

ci/install-upstream-wheels.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ conda uninstall -y --force \
77
matplotlib \
88
dask \
99
distributed \
10+
fsspec \
1011
zarr \
1112
cftime \
1213
rasterio \
@@ -40,4 +41,5 @@ python -m pip install \
4041
git+https://github.com/mapbox/rasterio \
4142
git+https://github.com/hgrecco/pint \
4243
git+https://github.com/pydata/bottleneck \
43-
git+https://github.com/pydata/sparse
44+
git+https://github.com/pydata/sparse \
45+
git+https://github.com/intake/filesystem_spec

ci/requirements/environment-windows.yml

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ dependencies:
1010
- cftime
1111
- dask
1212
- distributed
13+
- fsspec!=2021.7.0
1314
- h5netcdf
1415
- h5py
1516
- hdf5

ci/requirements/environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ dependencies:
1212
- cftime
1313
- dask
1414
- distributed
15+
- fsspec!=2021.7.0
1516
- h5netcdf
1617
- h5py
1718
- hdf5

doc/api-hidden.rst

-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
core.rolling.DatasetCoarsen.var
5555
core.rolling.DatasetCoarsen.boundary
5656
core.rolling.DatasetCoarsen.coord_func
57-
core.rolling.DatasetCoarsen.keep_attrs
5857
core.rolling.DatasetCoarsen.obj
5958
core.rolling.DatasetCoarsen.side
6059
core.rolling.DatasetCoarsen.trim_excess
@@ -120,7 +119,6 @@
120119
core.rolling.DatasetRolling.var
121120
core.rolling.DatasetRolling.center
122121
core.rolling.DatasetRolling.dim
123-
core.rolling.DatasetRolling.keep_attrs
124122
core.rolling.DatasetRolling.min_periods
125123
core.rolling.DatasetRolling.obj
126124
core.rolling.DatasetRolling.rollings
@@ -199,7 +197,6 @@
199197
core.rolling.DataArrayCoarsen.var
200198
core.rolling.DataArrayCoarsen.boundary
201199
core.rolling.DataArrayCoarsen.coord_func
202-
core.rolling.DataArrayCoarsen.keep_attrs
203200
core.rolling.DataArrayCoarsen.obj
204201
core.rolling.DataArrayCoarsen.side
205202
core.rolling.DataArrayCoarsen.trim_excess
@@ -263,7 +260,6 @@
263260
core.rolling.DataArrayRolling.var
264261
core.rolling.DataArrayRolling.center
265262
core.rolling.DataArrayRolling.dim
266-
core.rolling.DataArrayRolling.keep_attrs
267263
core.rolling.DataArrayRolling.min_periods
268264
core.rolling.DataArrayRolling.obj
269265
core.rolling.DataArrayRolling.window

doc/api.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ Top-level functions
2424
combine_by_coords
2525
combine_nested
2626
where
27-
set_options
2827
infer_freq
2928
full_like
3029
zeros_like
@@ -686,6 +685,7 @@ Dataset methods
686685
open_zarr
687686
Dataset.to_netcdf
688687
Dataset.to_pandas
688+
Dataset.as_numpy
689689
Dataset.to_zarr
690690
save_mfdataset
691691
Dataset.to_array
@@ -716,6 +716,8 @@ DataArray methods
716716
DataArray.to_pandas
717717
DataArray.to_series
718718
DataArray.to_dataframe
719+
DataArray.to_numpy
720+
DataArray.as_numpy
719721
DataArray.to_index
720722
DataArray.to_masked_array
721723
DataArray.to_cdms2

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@
313313
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
314314
"iris": ("https://scitools-iris.readthedocs.io/en/latest", None),
315315
"numpy": ("https://numpy.org/doc/stable", None),
316-
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
316+
"scipy": ("https://docs.scipy.org/doc/scipy", None),
317317
"numba": ("https://numba.pydata.org/numba-doc/latest", None),
318318
"matplotlib": ("https://matplotlib.org/stable/", None),
319319
"dask": ("https://docs.dask.org/en/latest", None),

doc/getting-started-guide/installing.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Required dependencies
88

99
- Python (3.7 or later)
1010
- setuptools (40.4 or later)
11-
- typing-extensions (3.10 or later)
1211
- `numpy <http://www.numpy.org/>`__ (1.17 or later)
1312
- `pandas <http://pandas.pydata.org/>`__ (1.0 or later)
1413

@@ -96,7 +95,7 @@ dependencies:
9695
- **setuptools:** 42 months (but no older than 40.4)
9796
- **numpy:** 18 months
9897
(`NEP-29 <https://numpy.org/neps/nep-0029-deprecation_policy.html>`_)
99-
- **dask and dask.distributed:** 12 months (but no older than 2.9)
98+
- **dask and dask.distributed:** 12 months
10099
- **sparse, pint** and other libraries that rely on
101100
`NEP-18 <https://numpy.org/neps/nep-0018-array-function-protocol.html>`_
102101
for integration: very latest available versions only, until the technology will have

0 commit comments

Comments
 (0)