Skip to content
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

Fixes for Pandas v2.0 #1344

Merged
merged 10 commits into from Apr 3, 2023
Merged

Fixes for Pandas v2.0 #1344

merged 10 commits into from Apr 3, 2023

Conversation

aulemahal
Copy link
Collaborator

@aulemahal aulemahal commented Apr 3, 2023

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
  • Tests for the changes have been added (for bug fixes / features)
    • (If applicable) Documentation has been added / updated (for bug fixes / features)
  • CHANGES.rst has been updated (with summary of main changes)
    • Link to issue (:issue:number) and pull request (:pull:number) has been added

What kind of change does this PR introduce?

  • In xclim.core.missing.MissingBase.prepare, we transform nanoseconds into days. Pandas' timedelta doesn't support it anymore, but we only need the array, so I passed through numpy directly instead.
  • In xclim.sdba.base.Grouper.get_index, we relied on the deprecated DatetimeIndex.dt.week, here I used the suggested DatetimeIndex.dt.isocalendar().week instead.
  • Also removed the equals test in the make_criteria unittest, it wasn't necessary and failed because of the changed dim order.
  • Noted in changelogs that xclim v0.42.0 will be the last version to explicitly support Python3.8.

Does this PR introduce a breaking change?

It shouldn't. This should be completely compatible with pandas 1.5 and a few earlier releases.

Other information:

#1268

@github-actions github-actions bot added the sdba Issues concerning the sdba submodule. label Apr 3, 2023
CHANGES.rst Outdated Show resolved Hide resolved
@github-actions github-actions bot added the approved Approved for additional tests label Apr 3, 2023
@Zeitsperre Zeitsperre mentioned this pull request Apr 3, 2023
5 tasks
@Zeitsperre Zeitsperre changed the title Fixes for pandas 2 Fixes for Pandas v2.0 Apr 3, 2023
@Zeitsperre Zeitsperre merged commit b62712d into prepare_v042 Apr 3, 2023
13 checks passed
@Zeitsperre Zeitsperre deleted the adapt-pd2 branch April 3, 2023 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for additional tests sdba Issues concerning the sdba submodule.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants