Uh oh!
There was an error while loading. Please reload this page.
Enhance and move ISO-8601 parser to coding.times - #9899
Conversation
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.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
for more information, see https://pre-commit.ci
kmuehlbauer
commented
Dec 17, 2024
@dcherian Thanks for the review, I've addressed according your comments and suggestions. |
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @kmuehlbauer—this looks nice. I guess so long as we accept a flexible number of digits in the year it will be hard to extend beyond five-digit years, which is totally fine for now.
Per @dcherian's TODO, I tried my hand at adding a hypothesis strategy for generating cftime objects in kmuehlbauer#2.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Spencer Clark <spencerkclark@gmail.com>
for more information, see https://pre-commit.ci
Uh oh!
There was an error while loading. Please reload this page.
headtr1ck
left a comment
There was a problem hiding this comment.
Let's take the opportunity and add some typing.
But looks good, thanks.
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.
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.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Michael Niklas <mick.niklas@gmail.com>
for more information, see https://pre-commit.ci
kmuehlbauer
commented
Dec 30, 2024
Thanks @headtr1ck for the review and typing addendum. |
kmuehlbauer
commented
Dec 30, 2024
Thanks @spencerkclark for reviewing and the additions! |
spencerkclark
left a comment
There was a problem hiding this comment.
Thanks @kmuehlbauer! Though it passes CI, I'm happy to iterate further on the hypothesis portion in this or a follow-up PR if needed. It's fairly low-stakes / orthogonal to the main contribution.
| return self.min_value + datetime.timedelta(microseconds=result) | ||
| class CFTimeStrategyISO8601(st.SearchStrategy): |
There was a problem hiding this comment.
@spencerkclark very nice!
I think the idiomatic way is to use composite but we can do that later.
* main: (63 commits) Fix zarr upstream tests (pydata#9927) Update pre-commit hooks (pydata#9925) split out CFDatetimeCoder, deprecate use_cftime as kwarg (pydata#9901) dev whats-new (pydata#9923) Whats-new 2025.01.0 (pydata#9919) Silence upstream Zarr warnings (pydata#9920) time coding refactor (pydata#9906) fix warning from scipy backend guess_can_open on directory (pydata#9911) Enhance and move ISO-8601 parser to coding.times (pydata#9899) Edit serialization error message (pydata#9916) friendlier error messages for missing chunk managers (pydata#9676) Bump codecov/codecov-action from 5.1.1 to 5.1.2 in the actions group (pydata#9915) Rewrite interp to use `apply_ufunc` (pydata#9881) Skip dask rolling (pydata#9909) Explicitly configure ReadTheDocs build to use conf.py (pydata#9908) Cache pre-existing Zarr arrays in Zarr backend (pydata#9861) Optimize idxmin, idxmax with dask (pydata#9800) remove unused "type: ignore" comments in test_plot.py (fixed in matplotlib 3.10.0) (pydata#9904) move scalar-handling logic into `possibly_convert_objects` (pydata#9900) Add missing DataTree attributes to docs (pydata#9876) ...
This enhances the ISO-8601 parser to check for signed years (eg, -0300 or +0010) as well as 5 digit years (eg. -10000, +20000, 10000). The relevant parsing code is moved to coding.times (to prevent circular import) as these functionality will be used in #9618 within coding.times.
whats-new.rst