-
-
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
Relax nanosecond datetime restriction in CF time decoding #9618
Open
kmuehlbauer
wants to merge
154
commits into
pydata:main
Choose a base branch
from
kmuehlbauer:any-time-resolution-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,145
−473
Open
Changes from all commits
Commits
Show all changes
154 commits
Select commit
Hold shift + click to select a range
7b5f323
implement default_precision_timestamp, refactor coding/times.py and c…
kmuehlbauer 8784f33
align tests with new time resolution behaviour
kmuehlbauer b45ab23
timedelta decoding, fsspec handling
kmuehlbauer 39086ef
fixes in coding/times.py
kmuehlbauer df49a40
add docs on time coding
kmuehlbauer adb8ca3
attempt fixing doc tests
kmuehlbauer 266b1ed
fix issue where out-of-bounds floating point values slipped in the pr…
kmuehlbauer 6d5f13b
convert to UTC first before stripping of tz in _unpack_time_units_and…
kmuehlbauer 5d68bfe
reorganize pandas compatibility code, remove unneeded code, attempt t…
kmuehlbauer 07bba69
another attempt to finally fix mypy
kmuehlbauer 6e7f0bb
refactor out _check_date_is_after_shift
kmuehlbauer b4a49bb
refactor out _maybe_strip_tz_from_timestamp
kmuehlbauer 2e1ff4f
more refactoring in coding.times.py
kmuehlbauer d5a7da0
more refactoring in coding.times.py
kmuehlbauer 821b68d
minor fix in time-coding.rst
kmuehlbauer d066edf
set default resolution to "s", which actually means, use pandas lowes…
kmuehlbauer ed22da1
Add section for default units, fix options
kmuehlbauer 8bf23f4
attempt to fix typing
kmuehlbauer c3a2b39
attempt to fix typing
kmuehlbauer 3c44aed
fix scalar datetime/timedelta
kmuehlbauer 48be73a
fix user docs
kmuehlbauer 7ac9983
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d86ad04
Fix variable tests, mostly datetime/timedelta is inittialized with us…
kmuehlbauer b5d0795
revert changes in _possible_convert_objects, this needs to be checked…
kmuehlbauer 60324f0
fix doc link
kmuehlbauer 6f2861a
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 1f07500
Apply suggestions from code review
kmuehlbauer 798b444
Merge branch 'main' into any-time-resolution-2
kmuehlbauer f487599
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 20d6c9d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7391948
remove outdated description
kmuehlbauer 308091c
use set instead list
kmuehlbauer 5f40b4e
remove global option
kmuehlbauer 2a65d8d
mypy thinks `unit` is Literal, because the pandas-stubs suggest so, b…
kmuehlbauer 43f7d61
ignore mypy arg-type
kmuehlbauer 59934b9
fix docstring of `default_precision_timestamp`
kmuehlbauer a01f9f3
add 'time_unit'-kwarg to decode_cf and descendent functions with "ns"…
kmuehlbauer 8b91128
fix tests
kmuehlbauer 0e351ca
fix more tests
kmuehlbauer 07a8e9c
fix docstring
kmuehlbauer 2be5739
use pd.Timestamp(np.datetime64(cftime)) to convert from cftime to numpy
kmuehlbauer b9d0a8e
use dt = np.datetime64(cftime.isoformat()) to convert from cftime to …
kmuehlbauer 08afc3b
fix time-coding.rst
kmuehlbauer edc55e1
use us in to_datetimeindex
kmuehlbauer bffe919
revert back to us for datetimeindex tests
kmuehlbauer 150b982
estimate fitting resolution for floating point values, when decoding …
kmuehlbauer 7113ceb
add test
kmuehlbauer 7f47f0b
refactor floating point decoding
kmuehlbauer 512808d
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 63c83f4
simplify recursive function, update tests
kmuehlbauer 0efbbeb
more refactoring, update tests
kmuehlbauer 2910250
add fixture, apply fixture to more tests.
kmuehlbauer 57d8d72
update time-coding.rst
kmuehlbauer 5333240
fix typing
kmuehlbauer 6f35c81
try to fix test, remove stale print
kmuehlbauer d0c17a4
another attempt to fix test
kmuehlbauer b2b6bb1
debug failing test
kmuehlbauer 5dbc8a7
refactor cftime fallback in datetime decoding
kmuehlbauer be0d3e0
Merge branch 'main' into any-time-resolution-2
kmuehlbauer f95408a
fix merge-collission
kmuehlbauer 609e15c
Merge branch 'main' into any-time-resolution-2
kmuehlbauer ec7f165
use CFDatetimeCoder instance to transport unit/use_cftime
kmuehlbauer 1f1cf1c
decode_times with CFDatetimeCoder
kmuehlbauer 14b1a88
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 05627dd
Merge branch 'main' into any-time-resolution-2
kmuehlbauer e7cbf3a
fix mypy, warning/error
kmuehlbauer fc87e04
api, docs, docstrings
kmuehlbauer 9ae645e
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 6e3ca57
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 277d1c6
docs, whats-new.rst
kmuehlbauer 81a9d94
fix whats-new.rst
kmuehlbauer be8642f
Merge branch 'main' into any-time-resolution-2
kmuehlbauer f3f62e5
Merge branch 'main' into any-time-resolution-2
kmuehlbauer c07df41
Merge remote-tracking branch 'origin/main' into any-time-resolution-2
kmuehlbauer 9653a01
fix tests after merge
kmuehlbauer f5822fd
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 66c0b9f
Apply suggestions from code review
kmuehlbauer ba51274
provide CFDatetimeCoder from xarray.coders
kmuehlbauer 3ba3e3f
provide CFDatetimeCoder from xarray.coders
kmuehlbauer 1ab43eb
provide CFDatetimeCoder from xarray.coders
kmuehlbauer 45ba9d3
fix tests as suggested by code review
kmuehlbauer 091a90d
Merge branch 'main' into any-time-resolution-2
kmuehlbauer ab3c9ed
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 53fe43a
Merge branch 'main' into any-time-resolution-2
kmuehlbauer a16a890
Move scalar handling logic into `_possibly_convert_objects` as sugges…
kmuehlbauer 4283f8a
Add note on ``proleptic_gregorian`` calendar
kmuehlbauer 0ba848d
remove time_resolution from docstring
kmuehlbauer 6cb8702
update time.coding.rst wrt default time unit
kmuehlbauer 5de8d0d
fix empty array
kmuehlbauer fc985d9
revert some tests to align with scalar logic handling
kmuehlbauer 799b750
Merge branch 'main' into any-time-resolution-2
kmuehlbauer a2d8e69
split out CFDatetimeCoder into coders, deprecate use_cftime as keywor…
kmuehlbauer d6fe956
add whats-new.rst entry
kmuehlbauer bd6a5d1
Apply suggestions from code review
kmuehlbauer 6557ef9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 759fb72
fix warning
kmuehlbauer 2118191
fix docstrings
kmuehlbauer 262295a
try fix typing
kmuehlbauer 941c4b5
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 6e41425
Merge branch 'main' into coders
kmuehlbauer adebafa
Apply suggestions from code review
kmuehlbauer 6cd81e5
Apply suggestions from code review
kmuehlbauer 1ae9a22
Merge branch 'main' into coders
kmuehlbauer 1cec644
Update xarray/conventions.py
kmuehlbauer 60aed87
Merge branch 'main' into coders
kmuehlbauer 797dc85
Merge branch 'main' into any-time-resolution-2-wip
kmuehlbauer 225c5b3
remove duplicate function (introduced when merging main)
kmuehlbauer 33a1563
Update deprecated directive
kmuehlbauer 4efe8b0
merge main into any-time-resolution-2
kmuehlbauer 21a0ec6
Merge branch 'main' into coders
kmuehlbauer 48dea20
merge coders into any-time-resolution-2
kmuehlbauer 1145f4b
fix typing
kmuehlbauer a9990cf
re-fix doctests
kmuehlbauer 5fa630f
merge main into any-time-resolution-2
kmuehlbauer 43c85d1
fix whats-new.rst after merging main
kmuehlbauer a4702d6
Apply suggestions from code review
kmuehlbauer 9bd292a
Apply suggestions from code review
kmuehlbauer 25b797e
rewrite recursive function using for-loop
kmuehlbauer 3bd8cf4
remove astype-construct in _possibly_convert_objects
kmuehlbauer 8b9c85a
Update xarray/coding/times.py
kmuehlbauer 2555d89
Merge branch 'main' into any-time-resolution-2
kmuehlbauer 3b2d861
add suggestions from code review
kmuehlbauer 66e181c
rephrase per suggestion
kmuehlbauer e380968
add article per suggestion
kmuehlbauer 305938c
Apply suggestions from code review
kmuehlbauer b32b02c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a2c46b1
fix scalar handling for timedelta based indexer
kmuehlbauer fa2c4b6
remove stale error message and "ignore:Converting non-default" in tes…
kmuehlbauer c65c9af
add per review suggestions
kmuehlbauer 21dffc1
add/remove todo
kmuehlbauer 8eeeb78
rename timeunit -> format
kmuehlbauer 7ad2183
return "ns" resolution per default for timedeltas, if not specified
kmuehlbauer 9e4cab6
Be specific on types/dtpyes
kmuehlbauer 5964a9e
add comment
kmuehlbauer 308391d
add suggestions from code review
kmuehlbauer 0e886d6
Merge branch 'main' into any-time-resolution-2
kmuehlbauer d494fe0
fix docs
kmuehlbauer ef6f722
fix test which isn't run for numpy2 atm
kmuehlbauer 4ea5241
add notes on to_datetime section, update examples showing usage of 'a…
kmuehlbauer 151e9cd
use np.timedelta64 for to_timedelta example, update as_unit example, …
kmuehlbauer 8ecda4e
remove note
kmuehlbauer 2bbf0ff
Apply suggestions from code review
kmuehlbauer 0308672
refactor timedelta decoding to _numbers_to_timedelta and res-use it w…
kmuehlbauer b043020
fix conventions test, add todo
kmuehlbauer 7182ce2
run times through pd.Timestamp to catch possible overflows
kmuehlbauer 470235e
fix tests for cftime_to_nptime
kmuehlbauer e619a4c
fix cftime_to_nptime in cftimeindex
kmuehlbauer 700e78d
introduce pd.Timestamp instance check
kmuehlbauer 4525ea1
warn if out-of-bound datetimes are encoded with standard calendar, fa…
kmuehlbauer 0b93dbd
fix time-coding.rst, add reference to time-series.rst.
kmuehlbauer b38cd7e
try to fix typing, ignore one
kmuehlbauer a2d1c96
try to fix docs
kmuehlbauer c4b2af3
revert doc-changes
kmuehlbauer 45a0d56
Add a non-ns test for polyval, polyfit
dcherian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Large diffs are not rendered by default.
Oops, something went wrong.
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.
Oops, something went wrong.
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.
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.
can we add an example with
xr.date_range
too please?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.
Honestly I might even just switch all of these to
xr.date_range