Skip to content

Commit 5a0ba46

Browse files
committed
$Merge branch 'main' into grouper-objects
* main: (34 commits) Update whats-new.rst Fix binning by unsorted array (pydata#7762) Bump codecov/codecov-action from 3.1.1 to 3.1.2 (pydata#7760) Fix typing errors using mypy 1.2 (pydata#7752) [skip-ci] dev whats-new Add whats-new for v2023.04.0 (pydata#7757) remove the `black` hook (pydata#7756) reword the what's new entry for the `pandas` 2.0 dtype changes (pydata#7755) restructure the contributing guide (pydata#7681) Continue to use nanosecond-precision Timestamps in precision-sensitive areas (pydata#7731) minor doc updates to clarify extensions using accessors (pydata#7751) align: Avoid reindexing when join="exact" (pydata#7736) `pandas=2.0` support (pydata#7724) Clarify vectorized indexing documentation (pydata#7747) Avoid recasting a CFTimeIndex (pydata#7735) fix typo (pydata#7746) [pre-commit.ci] pre-commit autoupdate (pydata#7745) Bump pypa/gh-action-pypi-publish from 1.8.4 to 1.8.5 (pydata#7743) preserve boolean dtype in encoding (pydata#7720) [skip-ci] Add alignment benchmarks (pydata#7738) ...
2 parents 2188a17 + 4f5675c commit 5a0ba46

Some content is hidden

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

75 files changed

+1865
-577
lines changed

.github/config.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Comment to be posted to on first time issues
2+
newIssueWelcomeComment: >
3+
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
4+
5+
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
6+
7+
See the [Contributing Guide](https://docs.xarray.dev/en/latest/contributing.html) for more.
8+
9+
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
10+
11+
Thank you!
12+
13+
# Comment to be posted to on PRs from first time contributors in your repository
14+
newPRWelcomeComment: >
15+
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
16+
17+
If you have questions, some answers may be found in our [contributing guidelines](http://docs.xarray.dev/en/stable/contributing.html).
18+
19+
# Comment to be posted to on pull requests merged by a first time user
20+
firstPRMergeComment: >
21+
Congratulations on completing your first pull request! Welcome to Xarray!
22+
We are proud of you, and hope to see you again!
23+
![celebration gif](https://media.giphy.com/media/umYMU8G2ixG5mJBDo5/giphy.gif)

.github/workflows/ci-additional.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ jobs:
119119
python xarray/util/print_versions.py
120120
- name: Install mypy
121121
run: |
122-
python -m pip install 'mypy<0.990'
122+
python -m pip install mypy --force-reinstall
123123
124124
- name: Run mypy
125125
run: |
126126
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
127127
128128
- name: Upload mypy coverage to Codecov
129-
uses: codecov/[email protected].1
129+
uses: codecov/[email protected].2
130130
with:
131131
file: mypy_report/cobertura.xml
132132
flags: mypy
@@ -173,14 +173,14 @@ jobs:
173173
python xarray/util/print_versions.py
174174
- name: Install mypy
175175
run: |
176-
python -m pip install 'mypy<0.990'
176+
python -m pip install mypy --force-reinstall
177177
178178
- name: Run mypy
179179
run: |
180180
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report
181181
182182
- name: Upload mypy coverage to Codecov
183-
uses: codecov/[email protected].1
183+
uses: codecov/[email protected].2
184184
with:
185185
file: mypy_report/cobertura.xml
186186
flags: mypy39

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
path: pytest.xml
140140

141141
- name: Upload code coverage to Codecov
142-
uses: codecov/[email protected].1
142+
uses: codecov/[email protected].2
143143
with:
144144
file: ./coverage.xml
145145
flags: unittests

.github/workflows/pypi-release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
7373
- name: Publish package to TestPyPI
7474
if: github.event_name == 'push'
75-
uses: pypa/[email protected].3
75+
uses: pypa/[email protected].5
7676
with:
7777
user: __token__
7878
password: ${{ secrets.TESTPYPI_TOKEN }}
@@ -90,7 +90,7 @@ jobs:
9090
name: releases
9191
path: dist
9292
- name: Publish package to PyPI
93-
uses: pypa/[email protected].3
93+
uses: pypa/[email protected].5
9494
with:
9595
user: __token__
9696
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/testpypi-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
7979
- name: Publish package to TestPyPI
8080
if: github.event_name == 'push'
81-
uses: pypa/[email protected].3
81+
uses: pypa/[email protected].5
8282
with:
8383
user: __token__
8484
password: ${{ secrets.TESTPYPI_TOKEN }}

.pre-commit-config.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,24 @@ repos:
1616
files: ^xarray/
1717
- repo: https://github.com/charliermarsh/ruff-pre-commit
1818
# Ruff version.
19-
rev: 'v0.0.259'
19+
rev: 'v0.0.261'
2020
hooks:
2121
- id: ruff
2222
args: ["--fix"]
2323
# https://github.com/python/black#version-control-integration
2424
- repo: https://github.com/psf/black
25-
rev: 23.1.0
25+
rev: 23.3.0
2626
hooks:
27-
- id: black
2827
- id: black-jupyter
2928
- repo: https://github.com/keewis/blackdoc
3029
rev: v0.3.8
3130
hooks:
3231
- id: blackdoc
3332
exclude: "generate_aggregations.py"
34-
additional_dependencies: ["black==23.1.0"]
33+
additional_dependencies: ["black==23.3.0"]
3534
- id: blackdoc-autoupdate-black
3635
- repo: https://github.com/pre-commit/mirrors-mypy
37-
rev: v1.1.1
36+
rev: v1.2.0
3837
hooks:
3938
- id: mypy
4039
# Copied from setup.cfg

asv_bench/asv.conf.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868
"distributed": [""],
6969
"flox": [""],
7070
"numpy_groupies": [""],
71-
"sparse": [""]
71+
"sparse": [""],
72+
"cftime": [""]
7273
},
7374

7475

asv_bench/benchmarks/alignment.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import numpy as np
2+
3+
import xarray as xr
4+
5+
from . import parameterized, requires_dask
6+
7+
ntime = 365 * 30
8+
nx = 50
9+
ny = 50
10+
11+
rng = np.random.default_rng(0)
12+
13+
14+
class Align:
15+
def setup(self, *args, **kwargs):
16+
data = rng.standard_normal((ntime, nx, ny))
17+
self.ds = xr.Dataset(
18+
{"temperature": (("time", "x", "y"), data)},
19+
coords={
20+
"time": xr.date_range("2000", periods=ntime),
21+
"x": np.arange(nx),
22+
"y": np.arange(ny),
23+
},
24+
)
25+
self.year = self.ds.time.dt.year
26+
self.idx = np.unique(rng.integers(low=0, high=ntime, size=ntime // 2))
27+
self.year_subset = self.year.isel(time=self.idx)
28+
29+
@parameterized(["join"], [("outer", "inner", "left", "right", "exact", "override")])
30+
def time_already_aligned(self, join):
31+
xr.align(self.ds, self.year, join=join)
32+
33+
@parameterized(["join"], [("outer", "inner", "left", "right")])
34+
def time_not_aligned(self, join):
35+
xr.align(self.ds, self.year[-100:], join=join)
36+
37+
@parameterized(["join"], [("outer", "inner", "left", "right")])
38+
def time_not_aligned_random_integers(self, join):
39+
xr.align(self.ds, self.year_subset, join=join)
40+
41+
42+
class AlignCFTime(Align):
43+
def setup(self, *args, **kwargs):
44+
super().setup()
45+
self.ds["time"] = xr.date_range("2000", periods=ntime, calendar="noleap")
46+
self.year = self.ds.time.dt.year
47+
self.year_subset = self.year.isel(time=self.idx)
48+
49+
50+
class AlignDask(Align):
51+
def setup(self, *args, **kwargs):
52+
requires_dask()
53+
super().setup()
54+
self.ds = self.ds.chunk({"time": 100})

ci/requirements/all-but-dask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies:
2525
- numbagg
2626
- numpy<1.24
2727
- packaging
28-
- pandas<2
28+
- pandas
2929
- pint
3030
- pip
3131
- pseudonetcdf

ci/requirements/doc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ dependencies:
1919
- numba
2020
- numpy>=1.21,<1.24
2121
- packaging>=21.3
22-
- pandas>=1.4,<2
22+
- pandas>=1.4
2323
- pooch
2424
- pip
2525
- pre-commit

0 commit comments

Comments
 (0)