Uh oh!
There was an error while loading. Please reload this page.
Implement cftime vectorization as discussed in PR #8322 - #8324
Conversation
kmuehlbauer
left a comment
There was a problem hiding this comment.
@antscloud Nice catch! I have two suggestion to get the test suite running.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
headtr1ck
commented
Jul 11, 2024
@antscloud are you willing to continue this? It would be a good addition. |
cff06d4 to
f28fc7dCompareantscloud
commented
Jul 14, 2024
Hi, sorry i completely forgot about this issue, i've implemented the suggestions and all the tests appear to pass, I hope it works in the CI 🤞 |
headtr1ck
commented
Jul 15, 2024
I didn't check in detail if we have a test that might cover this already and if yes, what the changes are. |
spencerkclark
commented
Jul 20, 2024
I don't think we currently do, but I think this new benchmark should cover it: #9262. |
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @antscloud! I think this looks good to me now. Could you add a what's new entry under a new Performance heading?
3 times faster, not bad |
Uh oh!
There was an error while loading. Please reload this page.
| dates = np.atleast_1d(dates) | ||
| # Find all the None position | ||
| none_position = np.equal(dates, None) |
There was a problem hiding this comment.
mypy complains here.
Not sure if this is an issue of wrong typing of numpy, or if this is not a recommended way of calling equals. (I think the None is the problem).
Co-authored-by: Michael Niklas <mick.niklas@gmail.com>
The mypy error is still there, not sure how to effectively fix it, maybe use kwargs instead or simply type ignore it. Otherwise this looks good and should get an entry in whats-new! |
Uh oh!
There was an error while loading. Please reload this page.
kmuehlbauer
commented
May 23, 2025
Thanks @antscloud! Still a valuable addition, which should be mentioned in |
Uh oh!
There was an error while loading. Please reload this page.
kmuehlbauer
commented
May 23, 2025
Great, either I messed up the merge or this fails now, because of other concurring changes in the past time. @spencerkclark Do you spot anything suspicious here? |
spencerkclark
commented
May 24, 2025
Thanks @kmuehlbauer for reviving this—I think the test failures are a manifestation of the cftime issue you found earlier (Unidata/cftime#354). The difference here from what was implemented in #9618 is that While the issue was fixed in Unidata/cftime#355, a new version of cftime has not yet been released. We could lobby for that, or raise an error in these circumstances. Independent of the cftime issue, there may be a reasonable case for raising (#10352). |
kmuehlbauer
commented
May 27, 2025
@spencerkclark Looks like this works after merging #10352. 🎉 |
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @antscloud! Sorry this took so long to push through. I went ahead and added a what's new entry on your behalf. Feel free to edit as you see fit, but otherwise I will merge on Thursday.
spencerkclark
commented
May 27, 2025
@kmuehlbauer I'm guessing you approve now, but giving you the chance to take another look and remove your requested change (which I think is resolved). |
spencerkclark
commented
May 30, 2025
The benchmark workflow failure is unrelated, so I am going to go ahead and merge. Thanks again @antscloud! |
* main: Fix performance regression in interp from pydata#9881 (pydata#10370) html repr: improve style for dropdown sections (pydata#10354) Grouper tweaks. (pydata#10362) Docs: Add links to getting help mermaid diagram (pydata#10324) Enforce ruff/flynt rules (FLY) (pydata#10375) Add missing AbstractWritableDataStore base methods and arguments (pydata#10343) Improve html repr in dark mode (Jupyterlab + Xarray docs) (pydata#10353) Pin Mypy to 1.15 (pydata#10378) use numpy dtype exposed by zarr array instead of metadata.data_type (pydata#10348) Fix doc typo for caption "Interoperability" (pydata#10374) Implement cftime vectorization as discussed in PR pydata#8322 (pydata#8324) Enforce ruff/flake8-pyi rules (PYI) (pydata#10359) Apply assorted ruff/Pylint rules (PL) / Enforce PLE rules (pydata#10366) (fix): pandas extension array repr for int64[pyarrow] (pydata#10317) Enforce ruff/flake8-implicit-str-concat rules (ISC) (pydata#10368) Enforce ruff/refurb rules (FURB) (pydata#10367) Ignore ruff/Pyflakes rule F401 more precisely (pydata#10369) Apply assorted ruff/flake8-simplify rules (SIM) (pydata#10364) Apply assorted ruff/flake8-pytest-style rules (PT) (pydata#10363) Fix "a array" misspelling (pydata#10365)
As discussed in #8322, here is the test for implementing the vectorization
Only this test seems to fail in
test_coding_times.py:xarray/xarray/tests/test_coding_times.py
Lines 1061 to 1071 in f895dc1
I don't really understand why though if you have an idea