Skip to content

Conversation

@dcherian
Copy link
Contributor

@dcherian dcherian commented Jul 7, 2025

No description provided.

1. Sadly {py:class}`pandas.IntervalIndex` supports numpy datetimes but not cftime.

```{important}
A pandas IntervalIndex models intervals using a single variable. The [Climate and Forecast Conventions](https://cfconventions.org/Data/cf-conventions/cf-conventions-1.11/cf-conventions.html#cell-boundaries), by contrast, model the intervals using two arrays: the intervals ("bounds" variable) and "central values".
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the implications of this are. For example, does this mean you can't directly save to a CF-compliant netCDF?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, not until pydata/xarray#10483 or pydata/xarray#10445 goes in

Copy link
Contributor

@scottyhq scottyhq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@dcherian dcherian enabled auto-merge (squash) July 7, 2025 12:56
@dcherian dcherian merged commit 1be8063 into xarray-contrib:main Jul 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants