Skip to content

Commit 8ce7175

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix/4107
* upstream/master: (24 commits) Compatibility with dask 2021.02.0 (pydata#4884) Ensure maximum accuracy when encoding and decoding cftime.datetime values (pydata#4758) Fix `bounds_error=True` ignored with 1D interpolation (pydata#4855) add a drop_conflicts strategy for merging attrs (pydata#4827) update pre-commit hooks (mypy) (pydata#4883) ensure warnings cannot become errors in assert_ (pydata#4864) update pre-commit hooks (pydata#4874) small fixes for the docstrings of swap_dims and integrate (pydata#4867) Modify _encode_datetime_with_cftime for compatibility with cftime > 1.4.0 (pydata#4871) vélin (pydata#4872) don't skip the doctests CI (pydata#4869) fix da.pad example for numpy 1.20 (pydata#4865) temporarily pin dask (pydata#4873) Add units if "unit" is in the attrs. (pydata#4850) speed up the repr for big MultiIndex objects (pydata#4846) dim -> coord in DataArray.integrate (pydata#3993) WIP: backend interface, now it uses subclassing (pydata#4836) weighted: small improvements (pydata#4818) Update related-projects.rst (pydata#4844) iris update doc url (pydata#4845) ...
2 parents 1a1f431 + 2a34bfb commit 8ce7175

Some content is hidden

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

69 files changed

+1483
-892
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,3 @@
55
- [ ] Passes `pre-commit run --all-files`
66
- [ ] User visible changes (including notable bug fixes) are documented in `whats-new.rst`
77
- [ ] New functions/methods are listed in `api.rst`
8-
9-
10-
<sub>
11-
<h3>
12-
Overriding CI behaviors
13-
</h3>
14-
By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a <tt>[test-upstream]</tt> tag to the first line of the commit message. For documentation-only commits, you can skip the CI per commit by adding a <tt>[skip-ci]</tt> tag to the first line of the commit message
15-
</sub>

.github/workflows/ci-additional.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ jobs:
121121
doctest:
122122
name: Doctests
123123
runs-on: "ubuntu-latest"
124-
needs: detect-ci-trigger
125-
if: needs.detect-ci-trigger.outputs.triggered == 'false'
126124
defaults:
127125
run:
128126
shell: bash -l {0}

.pre-commit-config.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,20 @@ repos:
1717
hooks:
1818
- id: black
1919
- repo: https://github.com/keewis/blackdoc
20-
rev: v0.3.2
20+
rev: v0.3.3
2121
hooks:
2222
- id: blackdoc
2323
- repo: https://gitlab.com/pycqa/flake8
2424
rev: 3.8.4
2525
hooks:
2626
- id: flake8
27+
# - repo: https://github.com/Carreau/velin
28+
# rev: 0.0.8
29+
# hooks:
30+
# - id: velin
31+
# args: ["--write", "--compact"]
2732
- repo: https://github.com/pre-commit/mirrors-mypy
28-
rev: v0.790 # Must match ci/requirements/*.yml
33+
rev: v0.800
2934
hooks:
3035
- id: mypy
3136
exclude: "properties|asv_bench"

asv_bench/benchmarks/repr.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import pandas as pd
2+
3+
import xarray as xr
4+
5+
6+
class ReprMultiIndex:
7+
def setup(self, key):
8+
index = pd.MultiIndex.from_product(
9+
[range(10000), range(10000)], names=("level_0", "level_1")
10+
)
11+
series = pd.Series(range(100000000), index=index)
12+
self.da = xr.DataArray(series)
13+
14+
def time_repr(self):
15+
repr(self.da)
16+
17+
def time_repr_html(self):
18+
self.da._repr_html_()

asv_bench/benchmarks/unstacking.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,23 @@
77

88
class Unstacking:
99
def setup(self):
10-
data = np.random.RandomState(0).randn(1, 1000, 500)
11-
self.ds = xr.DataArray(data).stack(flat_dim=["dim_1", "dim_2"])
10+
data = np.random.RandomState(0).randn(500, 1000)
11+
self.da_full = xr.DataArray(data, dims=list("ab")).stack(flat_dim=[...])
12+
self.da_missing = self.da_full[:-1]
13+
self.df_missing = self.da_missing.to_pandas()
1214

1315
def time_unstack_fast(self):
14-
self.ds.unstack("flat_dim")
16+
self.da_full.unstack("flat_dim")
1517

1618
def time_unstack_slow(self):
17-
self.ds[:, ::-1].unstack("flat_dim")
19+
self.da_missing.unstack("flat_dim")
20+
21+
def time_unstack_pandas_slow(self):
22+
self.df_missing.unstack()
1823

1924

2025
class UnstackingDask(Unstacking):
2126
def setup(self, *args, **kwargs):
2227
requires_dask()
2328
super().setup(**kwargs)
24-
self.ds = self.ds.chunk({"flat_dim": 50})
29+
self.da_full = self.da_full.chunk({"flat_dim": 50})

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ dependencies:
88
# When upgrading python, numpy, or pandas, must also change
99
# doc/installing.rst and setup.py.
1010
- python=3.7
11-
- black
1211
- boto3=1.9
1312
- bottleneck=1.2
1413
- cartopy=0.17
@@ -18,16 +17,13 @@ dependencies:
1817
- coveralls
1918
- dask=2.9
2019
- distributed=2.9
21-
- flake8
2220
- h5netcdf=0.7
2321
- h5py=2.9 # Policy allows for 2.10, but it's a conflict-fest
2422
- hdf5=1.10
2523
- hypothesis
2624
- iris=2.2
27-
- isort
2825
- lxml=4.4 # Optional dep of pydap
2926
- matplotlib-base=3.1
30-
- mypy=0.782 # Must match .pre-commit-config.yaml
3127
- nc-time-axis=1.2
3228
- netcdf4=1.4
3329
- numba=0.46

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,19 @@ channels:
44
- nodefaults
55
dependencies:
66
- python=3.8
7-
- black
87
- boto3
98
- bottleneck
109
- cartopy
1110
- cdms2
1211
- cfgrib
1312
- cftime
1413
- coveralls
15-
- flake8
1614
- h5netcdf
1715
- h5py=2
1816
- hdf5
1917
- hypothesis
20-
- isort
2118
- lxml # Optional dep of pydap
2219
- matplotlib-base
23-
- mypy=0.790 # Must match .pre-commit-config.yaml
2420
- nc-time-axis
2521
- netcdf4
2622
- numba

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@
411411
intersphinx_mapping = {
412412
"python": ("https://docs.python.org/3/", None),
413413
"pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
414-
"iris": ("https://scitools.org.uk/iris/docs/latest", None),
414+
"iris": ("https://scitools-iris.readthedocs.io/en/latest", None),
415415
"numpy": ("https://numpy.org/doc/stable", None),
416416
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
417417
"numba": ("https://numba.pydata.org/numba-doc/latest", None),

doc/contributing.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,7 @@ PR checklist
836836
837837
- Write new tests if needed. See `"Test-driven development/code writing" <https://xarray.pydata.org/en/stable/contributing.html#test-driven-development-code-writing>`_.
838838
- Test the code using `Pytest <http://doc.pytest.org/en/latest/>`_. Running all tests (type ``pytest`` in the root directory) takes a while, so feel free to only run the tests you think are needed based on your PR (example: ``pytest xarray/tests/test_dataarray.py``). CI will catch any failing tests.
839+
- By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a <tt>[test-upstream]</tt> tag to the first line of the commit message. For documentation-only commits, you can skip the CI per commit by adding a "[skip-ci]" tag to the first line of the commit message.
839840
840841
- **Properly format your code** and verify that it passes the formatting guidelines set by `Black <https://black.readthedocs.io/en/stable/>`_ and `Flake8 <http://flake8.pycqa.org/en/latest/>`_. See `"Code formatting" <https://xarray.pydata.org/en/stablcontributing.html#code-formatting>`_. You can use `pre-commit <https://pre-commit.com/>`_ to run these automatically on each commit.
841842

doc/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ different approaches to handling metadata: Iris strictly interprets
166166
`CF conventions`_. Iris particularly shines at mapping, thanks to its
167167
integration with Cartopy_.
168168

169-
.. _Iris: http://scitools.org.uk/iris/
169+
.. _Iris: https://scitools-iris.readthedocs.io/en/stable/
170170
.. _Cartopy: http://scitools.org.uk/cartopy/docs/latest/
171171

172172
`UV-CDAT`__ is another Python library that implements in-memory netCDF-like

0 commit comments

Comments
 (0)