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

WIP: Support calendar-specific cftime.datetime instances #8942

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Apr 14, 2024

Since cftime version 1.3.0, the base cftime.datetime object can be calendar-aware, obviating the need for calendar-specific subclasses like cftime.DatetimeNoLeap. This PR aims to finally enable the use of these objects in xarray. We can also use this moment to remove cruft around accommodating inexact cftime datetime arithmetic, since that has been fixed since cftime version 1.2.0.

The idea will be to support both for a period of time and eventually drop support for the calendar-specific subclasses. I do not think too much should need to change within xarray—the main challenge will be to see if we can maintain adequate test coverage without multiplying the number of cftime tests by two. This draft PR is at least a start towards that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment