-
-
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
Deprecate certain cftime frequency strings following pandas #8415
Merged
dcherian
merged 3 commits into
pydata:main
from
spencerkclark:update-cftime-frequency-strings
Nov 16, 2023
Merged
Deprecate certain cftime frequency strings following pandas #8415
dcherian
merged 3 commits into
pydata:main
from
spencerkclark:update-cftime-frequency-strings
Nov 16, 2023
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
spencerkclark
force-pushed
the
update-cftime-frequency-strings
branch
from
November 5, 2023 14:18
12e4b59
to
979017b
Compare
spencerkclark
force-pushed
the
update-cftime-frequency-strings
branch
from
November 5, 2023 14:19
979017b
to
d4839b1
Compare
Specifically the frequency strings "A", "AS", "Q", "M", "H", "T", "S", "L", "U", and "N" are deprecated in favor of "Y", "YS", "QE", "ME", "h", "min", "s", "ms", "us", and "ns", respectively.
spencerkclark
force-pushed
the
update-cftime-frequency-strings
branch
from
November 5, 2023 15:19
d4839b1
to
7738cf6
Compare
aulemahal
reviewed
Nov 6, 2023
spencerkclark
commented
Nov 7, 2023
Co-authored-by: Pascal Bourgault <[email protected]>
@spencerkclark are we good to merge here? |
Indeed I do not have anything to add. Thanks for taking a look earlier @aulemahal — are you on board with the changes I made to |
I am on board with these changes! Thanks. |
dcherian
added a commit
to rabernat/xarray
that referenced
this pull request
Nov 29, 2023
* main: [skip-ci] dev whats-new (pydata#8467) 2023.11.0 Whats-new (pydata#8461) migrate the other CI to python 3.11 (pydata#8416) preserve vlen string dtypes, allow vlen string fill_values (pydata#7869) Pin mypy < 1.7 (pydata#8458) Fix typos found by codespell (pydata#8457) [skip-ci] Small updates to IO docs. (pydata#8452) Deprecate certain cftime frequency strings following pandas (pydata#8415) Added driver parameter for h5netcdf (pydata#8360) Raise exception in to_dataset if resulting variable is also the name of a coordinate (pydata#8433) Automatic region detection and transpose for `to_zarr()` (pydata#8434) remove `cdms2` (pydata#8441) Remove PseudoNetCDF (pydata#8446) Pin pint to >=0.22 (pydata#8445) Remove keep_attrs from resample signature (pydata#8444) Rename `to_array` to `to_dataarray` (pydata#8438) Add missing DataArray.dt.total_seconds() method (pydata#8435) Declare Dataset, DataArray, Variable, GroupBy unhashable (pydata#8392)
4 tasks
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.
Following several upstream PRs in pandas, this PR deprecates cftime frequency strings
"A"
,"AS"
,"Q"
,"M"
,"H"
,"T"
,"S"
,"L"
, and"U"
in favor of"Y"
,"YS"
,"QE"
,"ME"
,"h"
,"min"
,"s"
,"ms"
, and"us"
. Similarly following pandas, it makes a breaking change to haveinfer_freq
return the latter frequencies instead of the former.There are a few places in the tests and one place in the code where we need some version-specific logic to retain support for older pandas versions. @aulemahal it would be great if you could take a look to make sure that I handled this breaking change properly / fully in the
date_range_like
case.I also took the liberty to transition to using
"Y"
,"YS"
,"h"
,"min"
,"s"
,"ms"
,"us"
, and"ns"
within our code, tests, and documentation to reduce the amount of warnings emitted. I have held off on switching to"QE"
,"ME"
, and anchored offsets involving"Y"
or"YS"
in pandas-related code since those are not supported in older versions of pandas.The deprecation warning looks like this:
convert_calendar
anddate_range_like
test failures in ⚠️ Nightly upstream-dev CI failed ⚠️ #8091whats-new.rst