-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
promote floating-point numeric datetimes to 64-bit before decoding #9182
Merged
Conversation
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
scottyhq
approved these changes
Jun 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for taking care of this so quickly @keewis! the code and test look good to me!
spencerkclark
approved these changes
Jun 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @keewis—looks good to me too!
let's merge, then! |
dcherian
added a commit
to dcherian/xarray
that referenced
this pull request
Jun 28, 2024
* main: promote floating-point numeric datetimes to 64-bit before decoding (pydata#9182) also pin `numpy` in the all-but-dask CI (pydata#9184) temporarily remove `pydap` from CI (pydata#9183) temporarily pin `numpy<2` (pydata#9181) Change np.core.defchararray to np.char (pydata#9165) (pydata#9166) Fix example code formatting for CachingFileManager (pydata#9178) Slightly improve DataTree repr (pydata#9064) switch to unit `"D"` (pydata#9170) Docs: Add page with figure for navigating help resources (pydata#9147) Add test for pydata#9155 (pydata#9161) Remove mypy exclusions for a couple more libraries (pydata#9160) Include numbagg in type checks (pydata#9159) Improve zarr chunks docs (pydata#9140)
5 tasks
5 tasks
aulemahal
added a commit
to Ouranosinc/xclim
that referenced
this pull request
Jul 31, 2024
<!--Please ensure the PR fulfills the following requirements! --> <!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! --> ### Pull Request Checklist: - [x] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #1785 - [x] Tests for the changes have been added (for bug fixes / features) - [x] (If applicable) Documentation has been added / updated (for bug fixes / features) - [x] CHANGES.rst has been updated (with summary of main changes) - [x] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added ### What kind of change does this PR introduce? * Changes NaN and NAN to nan, Inf to inf. * Changes a test so the new data type promotion of numpy 2 fits our expected values * Relaxes a test for the same reason * Change expected unit order in some cases (new cf_xarray + pint) * Dimensionless units are now printed as "1". * Simplify `pint2cfunits`. * Add `ensure_absolute_tempetature` to its module's `__all__` and move `ensure_delta` up in the same module so both functions are near another in the file. ### Does this PR introduce a breaking change? Yes it does. Fixing numpy 2 issues made me fix pint 0.24.1 issues that made me fix cf_xarray issues which have solution that is not backwards-compatible and now pint and cf_xarray have updated pinned that imply a numpy >=2 pin. ### Other information: ~We will require 3 new pins :~ - Most problems with `create_ensemble` come from a np2 bug in xarray, which was fixed here pydata/xarray#9182. ~We are thus waiting for a release~. Xarray 2024.07.0 out on the 30th. - All units problem are solved with xarray-contrib/cf-xarray#523, which was released in cf-xarray 0.9.3. - The dimensionless unit thing requires pint 0.24.1 ~which requires numpy 2, so pinning this as well.~ UPDATE: No pins were added, but the behaviour of xclim will be different for dimensionless indicators depending on the cf_xarray/pint versions installed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It seems that because of the changed dtype casting rules in
numpy>=2
, the numeric timestamps are not automatically promoted to 64-bit floating point values anymore so we have to do this manually.whats-new.rst