-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 test_coding_times_cleanup
- Loading branch information
Showing
92 changed files
with
2,296 additions
and
1,867 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,5 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
- pre-commit-ci |
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,18 @@ | ||
import numpy as np | ||
|
||
import xarray as xr | ||
|
||
from . import parameterized | ||
|
||
|
||
@parameterized(["calendar"], [("standard", "noleap")]) | ||
class EncodeCFDatetime: | ||
def setup(self, calendar): | ||
self.units = "days since 2000-01-01" | ||
self.dtype = np.dtype("int64") | ||
self.times = xr.date_range( | ||
"2000", freq="D", periods=10000, calendar=calendar | ||
).values | ||
|
||
def time_encode_cf_datetime(self, calendar): | ||
xr.coding.times.encode_cf_datetime(self.times, self.units, calendar, self.dtype) |
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,49 @@ | ||
import re | ||
import textwrap | ||
|
||
import git | ||
from tlz.itertoolz import last, unique | ||
|
||
co_author_re = re.compile(r"Co-authored-by: (?P<name>[^<]+?) <(?P<email>.+)>") | ||
|
||
|
||
def main(): | ||
repo = git.Repo(".") | ||
|
||
most_recent_release = last(repo.tags) | ||
|
||
# extract information from commits | ||
contributors = {} | ||
for commit in repo.iter_commits(f"{most_recent_release.name}.."): | ||
matches = co_author_re.findall(commit.message) | ||
if matches: | ||
contributors.update({email: name for name, email in matches}) | ||
contributors[commit.author.email] = commit.author.name | ||
|
||
# deduplicate and ignore | ||
# TODO: extract ignores from .github/release.yml | ||
ignored = ["dependabot", "pre-commit-ci"] | ||
unique_contributors = unique( | ||
contributor | ||
for contributor in contributors.values() | ||
if contributor.removesuffix("[bot]") not in ignored | ||
) | ||
|
||
sorted_ = sorted(unique_contributors) | ||
if len(sorted_) > 1: | ||
names = f"{', '.join(sorted_[:-1])} and {sorted_[-1]}" | ||
else: | ||
names = "".join(sorted_) | ||
|
||
statement = textwrap.dedent( | ||
f"""\ | ||
Thanks to the {len(sorted_)} contributors to this release: | ||
{names} | ||
""".rstrip() | ||
) | ||
|
||
print(statement) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ dependencies: | |
- netcdf4 | ||
- numba | ||
- numbagg | ||
- numpy<2 | ||
- numpy | ||
- packaging | ||
- pandas | ||
- pint>=0.22 | ||
|
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 |
---|---|---|
|
@@ -23,7 +23,7 @@ dependencies: | |
- netcdf4 | ||
- numba | ||
- numbagg | ||
- numpy<2 | ||
- numpy | ||
- packaging | ||
- pandas | ||
# - pint>=0.22 | ||
|
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 |
---|---|---|
|
@@ -26,7 +26,7 @@ dependencies: | |
- numba | ||
- numbagg | ||
- numexpr | ||
- numpy<2 | ||
- numpy | ||
- opt_einsum | ||
- packaging | ||
- pandas | ||
|
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,30 @@ | ||
{ | ||
"version": 1, | ||
"refs": { | ||
".zgroup": "{\"zarr_format\":2}", | ||
"foo/.zarray": "{\"chunks\":[4,5],\"compressor\":null,\"dtype\":\"<f8\",\"fill_value\":\"NaN\",\"filters\":null,\"order\":\"C\",\"shape\":[4,5],\"zarr_format\":2}", | ||
"foo/.zattrs": "{\"_ARRAY_DIMENSIONS\":[\"x\",\"y\"],\"coordinates\":\"z\"}", | ||
"foo/0.0": [ | ||
"saved_on_disk.h5", | ||
8192, | ||
160 | ||
], | ||
"x/.zarray": "{\"chunks\":[4],\"compressor\":null,\"dtype\":\"<i8\",\"fill_value\":null,\"filters\":null,\"order\":\"C\",\"shape\":[4],\"zarr_format\":2}", | ||
"x/.zattrs": "{\"_ARRAY_DIMENSIONS\":[\"x\"]}", | ||
"x/0": [ | ||
"saved_on_disk.h5", | ||
8352, | ||
32 | ||
], | ||
"y/.zarray": "{\"chunks\":[5],\"compressor\":null,\"dtype\":\"<i8\",\"fill_value\":null,\"filters\":null,\"order\":\"C\",\"shape\":[5],\"zarr_format\":2}", | ||
"y/.zattrs": "{\"_ARRAY_DIMENSIONS\":[\"y\"],\"calendar\":\"proleptic_gregorian\",\"units\":\"days since 2000-01-01 00:00:00\"}", | ||
"y/0": [ | ||
"saved_on_disk.h5", | ||
8384, | ||
40 | ||
], | ||
"z/.zarray": "{\"chunks\":[4],\"compressor\":null,\"dtype\":\"|O\",\"fill_value\":null,\"filters\":[{\"allow_nan\":true,\"check_circular\":true,\"encoding\":\"utf-8\",\"ensure_ascii\":true,\"id\":\"json2\",\"indent\":null,\"separators\":[\",\",\":\"],\"skipkeys\":false,\"sort_keys\":true,\"strict\":true}],\"order\":\"C\",\"shape\":[4],\"zarr_format\":2}", | ||
"z/0": "[\"a\",\"b\",\"c\",\"d\",\"|O\",[4]]", | ||
"z/.zattrs": "{\"_ARRAY_DIMENSIONS\":[\"x\"]}" | ||
} | ||
} |
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
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
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.