forked from pydata/xarray
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
$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) ...
- Loading branch information
Showing
75 changed files
with
1,865 additions
and
577 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Comment to be posted to on first time issues | ||
newIssueWelcomeComment: > | ||
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! | ||
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. | ||
See the [Contributing Guide](https://docs.xarray.dev/en/latest/contributing.html) for more. | ||
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. | ||
Thank you! | ||
# Comment to be posted to on PRs from first time contributors in your repository | ||
newPRWelcomeComment: > | ||
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. | ||
If you have questions, some answers may be found in our [contributing guidelines](http://docs.xarray.dev/en/stable/contributing.html). | ||
# Comment to be posted to on pull requests merged by a first time user | ||
firstPRMergeComment: > | ||
Congratulations on completing your first pull request! Welcome to Xarray! | ||
We are proud of you, and hope to see you again! | ||
![celebration gif](https://media.giphy.com/media/umYMU8G2ixG5mJBDo5/giphy.gif) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,14 +119,14 @@ jobs: | |
python xarray/util/print_versions.py | ||
- name: Install mypy | ||
run: | | ||
python -m pip install 'mypy<0.990' | ||
python -m pip install mypy --force-reinstall | ||
- name: Run mypy | ||
run: | | ||
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report | ||
- name: Upload mypy coverage to Codecov | ||
uses: codecov/[email protected].1 | ||
uses: codecov/[email protected].2 | ||
with: | ||
file: mypy_report/cobertura.xml | ||
flags: mypy | ||
|
@@ -173,14 +173,14 @@ jobs: | |
python xarray/util/print_versions.py | ||
- name: Install mypy | ||
run: | | ||
python -m pip install 'mypy<0.990' | ||
python -m pip install mypy --force-reinstall | ||
- name: Run mypy | ||
run: | | ||
python -m mypy --install-types --non-interactive --cobertura-xml-report mypy_report | ||
- name: Upload mypy coverage to Codecov | ||
uses: codecov/[email protected].1 | ||
uses: codecov/[email protected].2 | ||
with: | ||
file: mypy_report/cobertura.xml | ||
flags: mypy39 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,7 +139,7 @@ jobs: | |
path: pytest.xml | ||
|
||
- name: Upload code coverage to Codecov | ||
uses: codecov/[email protected].1 | ||
uses: codecov/[email protected].2 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,7 +72,7 @@ jobs: | |
- name: Publish package to TestPyPI | ||
if: github.event_name == 'push' | ||
uses: pypa/[email protected].3 | ||
uses: pypa/[email protected].5 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TESTPYPI_TOKEN }} | ||
|
@@ -90,7 +90,7 @@ jobs: | |
name: releases | ||
path: dist | ||
- name: Publish package to PyPI | ||
uses: pypa/[email protected].3 | ||
uses: pypa/[email protected].5 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,7 @@ jobs: | |
- name: Publish package to TestPyPI | ||
if: github.event_name == 'push' | ||
uses: pypa/[email protected].3 | ||
uses: pypa/[email protected].5 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TESTPYPI_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import numpy as np | ||
|
||
import xarray as xr | ||
|
||
from . import parameterized, requires_dask | ||
|
||
ntime = 365 * 30 | ||
nx = 50 | ||
ny = 50 | ||
|
||
rng = np.random.default_rng(0) | ||
|
||
|
||
class Align: | ||
def setup(self, *args, **kwargs): | ||
data = rng.standard_normal((ntime, nx, ny)) | ||
self.ds = xr.Dataset( | ||
{"temperature": (("time", "x", "y"), data)}, | ||
coords={ | ||
"time": xr.date_range("2000", periods=ntime), | ||
"x": np.arange(nx), | ||
"y": np.arange(ny), | ||
}, | ||
) | ||
self.year = self.ds.time.dt.year | ||
self.idx = np.unique(rng.integers(low=0, high=ntime, size=ntime // 2)) | ||
self.year_subset = self.year.isel(time=self.idx) | ||
|
||
@parameterized(["join"], [("outer", "inner", "left", "right", "exact", "override")]) | ||
def time_already_aligned(self, join): | ||
xr.align(self.ds, self.year, join=join) | ||
|
||
@parameterized(["join"], [("outer", "inner", "left", "right")]) | ||
def time_not_aligned(self, join): | ||
xr.align(self.ds, self.year[-100:], join=join) | ||
|
||
@parameterized(["join"], [("outer", "inner", "left", "right")]) | ||
def time_not_aligned_random_integers(self, join): | ||
xr.align(self.ds, self.year_subset, join=join) | ||
|
||
|
||
class AlignCFTime(Align): | ||
def setup(self, *args, **kwargs): | ||
super().setup() | ||
self.ds["time"] = xr.date_range("2000", periods=ntime, calendar="noleap") | ||
self.year = self.ds.time.dt.year | ||
self.year_subset = self.year.isel(time=self.idx) | ||
|
||
|
||
class AlignDask(Align): | ||
def setup(self, *args, **kwargs): | ||
requires_dask() | ||
super().setup() | ||
self.ds = self.ds.chunk({"time": 100}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ dependencies: | |
- numbagg | ||
- numpy<1.24 | ||
- packaging | ||
- pandas<2 | ||
- pandas | ||
- pint | ||
- pip | ||
- pseudonetcdf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ dependencies: | |
- numexpr | ||
- numpy | ||
- packaging | ||
- pandas<2 | ||
- pandas | ||
- pint | ||
- pip | ||
- pooch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ dependencies: | |
# - numbagg | ||
- numpy | ||
- packaging | ||
- pandas<2 | ||
- pandas | ||
- pint | ||
- pip | ||
- pre-commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ dependencies: | |
- numbagg | ||
- numpy<1.24 | ||
- packaging | ||
- pandas<2 | ||
- pandas | ||
- pint | ||
- pip | ||
- pre-commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ dependencies: | |
- numexpr | ||
- numpy<1.24 | ||
- packaging | ||
- pandas<2 | ||
- pandas | ||
- pint | ||
- pip | ||
- pooch | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.