-
-
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.
override
units
for datetime64/timedelta64 variables to preserve int…
…eger dtype (#8201) * remove `dtype` from encoding for datetime64/timedelta64 variables to prevent unnecessary casts * adapt tests * add whats-new.rst entry * Update xarray/coding/times.py Co-authored-by: Spencer Clark <[email protected]> * Update doc/whats-new.rst Co-authored-by: Spencer Clark <[email protected]> * add test per review suggestion, replace .kind-check with np.issubdtype-check * align timedelta64 check with datetime64 check * override units instead of dtype * remove print statement * warn in case of serialization to floating point, too * align if-else * Add instructions to warnings * Fix test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * use warnings.catch_warnings * Update doc/whats-new.rst Co-authored-by: Spencer Clark <[email protected]> --------- Co-authored-by: Spencer Clark <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
77eaa8b
commit a4f80b2
Showing
3 changed files
with
132 additions
and
45 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
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