Skip to content

Commit

Permalink
Merge branch 'main' into repr_length_updates
Browse files Browse the repository at this point in the history
* 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)
  ...
  • Loading branch information
st-bender committed Aug 10, 2021
2 parents 3896e8e + 4bb9d9c commit ac37672
Show file tree
Hide file tree
Showing 51 changed files with 1,979 additions and 752 deletions.
3 changes: 2 additions & 1 deletion .binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: xarray-examples
channels:
- conda-forge
dependencies:
- python=3.8
- python=3.9
- boto3
- bottleneck
- cartopy
Expand All @@ -26,6 +26,7 @@ dependencies:
- pandas
- pint
- pip
- pooch
- pydap
- pynio
- rasterio
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cancel-duplicate-runs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'pydata/xarray'
steps:
- uses: styfle/cancel-workflow-action@0.9.0
- uses: styfle/cancel-workflow-action@0.9.1
with:
workflow_id: ${{ github.event.workflow.id }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ jobs:
$PYTEST_EXTRA_FLAGS
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.xml
flags: unittests,${{ matrix.env }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-pre-commit-autoupdate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EXECUTE_COMMANDS: |
python -m pre_commit autoupdate
python .github/workflows/sync_linter_versions.py .pre-commit-config.yaml ci/requirements/mypy_only
python -m pre_commit run --all-files
COMMIT_MESSAGE: 'pre-commit: autoupdate hook versions'
COMMIT_NAME: 'github-actions[bot]'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
path: pytest.xml

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2.0.2
with:
file: ./coverage.xml
flags: unittests
Expand Down
76 changes: 0 additions & 76 deletions .github/workflows/sync_linter_versions.py

This file was deleted.

8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ repos:
- id: check-yaml
# isort should run before black as black sometimes tweaks the isort output
- repo: https://github.com/PyCQA/isort
rev: 5.9.1
rev: 5.9.3
hooks:
- id: isort
# https://github.com/python/black#version-control-integration
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 21.7b0
hooks:
- id: black
- repo: https://github.com/keewis/blackdoc
rev: v0.3.3
rev: v0.3.4
hooks:
- id: blackdoc
- repo: https://gitlab.com/pycqa/flake8
Expand All @@ -30,7 +30,6 @@ repos:
# - id: velin
# args: ["--write", "--compact"]
- repo: https://github.com/pre-commit/mirrors-mypy
# version must correspond to the one in .github/workflows/ci-additional.yaml
rev: v0.910
hooks:
- id: mypy
Expand All @@ -44,6 +43,7 @@ repos:
types-pytz,
# Dependencies that are typed
numpy,
typing-extensions==3.10.0.0,
]
# run this occasionally, ref discussion https://github.com/pydata/xarray/pull/3194
# - repo: https://github.com/asottile/pyupgrade
Expand Down
22 changes: 22 additions & 0 deletions asv_bench/benchmarks/repr.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,30 @@
import numpy as np
import pandas as pd

import xarray as xr


class Repr:
def setup(self):
a = np.arange(0, 100)
data_vars = dict()
for i in a:
data_vars[f"long_variable_name_{i}"] = xr.DataArray(
name=f"long_variable_name_{i}",
data=np.arange(0, 20),
dims=[f"long_coord_name_{i}_x"],
coords={f"long_coord_name_{i}_x": np.arange(0, 20) * 2},
)
self.ds = xr.Dataset(data_vars)
self.ds.attrs = {f"attr_{k}": 2 for k in a}

def time_repr(self):
repr(self.ds)

def time_repr_html(self):
self.ds._repr_html_()


class ReprMultiIndex:
def setup(self):
index = pd.MultiIndex.from_product(
Expand Down
4 changes: 3 additions & 1 deletion ci/install-upstream-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ conda uninstall -y --force \
matplotlib \
dask \
distributed \
fsspec \
zarr \
cftime \
rasterio \
Expand Down Expand Up @@ -40,4 +41,5 @@ python -m pip install \
git+https://github.com/mapbox/rasterio \
git+https://github.com/hgrecco/pint \
git+https://github.com/pydata/bottleneck \
git+https://github.com/pydata/sparse
git+https://github.com/pydata/sparse \
git+https://github.com/intake/filesystem_spec
1 change: 1 addition & 0 deletions ci/requirements/environment-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies:
- cftime
- dask
- distributed
- fsspec!=2021.7.0
- h5netcdf
- h5py
- hdf5
Expand Down
1 change: 1 addition & 0 deletions ci/requirements/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- cftime
- dask
- distributed
- fsspec!=2021.7.0
- h5netcdf
- h5py
- hdf5
Expand Down
4 changes: 0 additions & 4 deletions doc/api-hidden.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
core.rolling.DatasetCoarsen.var
core.rolling.DatasetCoarsen.boundary
core.rolling.DatasetCoarsen.coord_func
core.rolling.DatasetCoarsen.keep_attrs
core.rolling.DatasetCoarsen.obj
core.rolling.DatasetCoarsen.side
core.rolling.DatasetCoarsen.trim_excess
Expand Down Expand Up @@ -120,7 +119,6 @@
core.rolling.DatasetRolling.var
core.rolling.DatasetRolling.center
core.rolling.DatasetRolling.dim
core.rolling.DatasetRolling.keep_attrs
core.rolling.DatasetRolling.min_periods
core.rolling.DatasetRolling.obj
core.rolling.DatasetRolling.rollings
Expand Down Expand Up @@ -199,7 +197,6 @@
core.rolling.DataArrayCoarsen.var
core.rolling.DataArrayCoarsen.boundary
core.rolling.DataArrayCoarsen.coord_func
core.rolling.DataArrayCoarsen.keep_attrs
core.rolling.DataArrayCoarsen.obj
core.rolling.DataArrayCoarsen.side
core.rolling.DataArrayCoarsen.trim_excess
Expand Down Expand Up @@ -263,7 +260,6 @@
core.rolling.DataArrayRolling.var
core.rolling.DataArrayRolling.center
core.rolling.DataArrayRolling.dim
core.rolling.DataArrayRolling.keep_attrs
core.rolling.DataArrayRolling.min_periods
core.rolling.DataArrayRolling.obj
core.rolling.DataArrayRolling.window
Expand Down
4 changes: 3 additions & 1 deletion doc/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Top-level functions
combine_by_coords
combine_nested
where
set_options
infer_freq
full_like
zeros_like
Expand Down Expand Up @@ -686,6 +685,7 @@ Dataset methods
open_zarr
Dataset.to_netcdf
Dataset.to_pandas
Dataset.as_numpy
Dataset.to_zarr
save_mfdataset
Dataset.to_array
Expand Down Expand Up @@ -716,6 +716,8 @@ DataArray methods
DataArray.to_pandas
DataArray.to_series
DataArray.to_dataframe
DataArray.to_numpy
DataArray.as_numpy
DataArray.to_index
DataArray.to_masked_array
DataArray.to_cdms2
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
"iris": ("https://scitools-iris.readthedocs.io/en/latest", None),
"numpy": ("https://numpy.org/doc/stable", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"scipy": ("https://docs.scipy.org/doc/scipy", None),
"numba": ("https://numba.pydata.org/numba-doc/latest", None),
"matplotlib": ("https://matplotlib.org/stable/", None),
"dask": ("https://docs.dask.org/en/latest", None),
Expand Down
3 changes: 1 addition & 2 deletions doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Required dependencies

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

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

0 comments on commit ac37672

Please sign in to comment.