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

Automatically use cftime for multi-file dataset going beyond 2262. #277

Open
1 task done
aulemahal opened this issue Oct 26, 2023 · 0 comments
Open
1 task done
Assignees
Labels
enhancement New feature or request

Comments

@aulemahal
Copy link
Collaborator

Addressing a Problem?

A bare extract_dataset on a dataset that has assets both inside and outside the datetime64 range will fail with : TypeError: Cannot combine along dimension 'time' with mixed types. Found: DatetimeProlepticGregorian, Timestamp. [...]

That's because files are opened individually. The ones inside the range were opened using numpy/pandas's default, while those outside reverted to cftime as told by a warning : SerializationWarning: Unable to decode time axis into full numpy.datetime64 objects, continuing using cftime.datetime objects instead, reason: dates out of range.

Potential Solution

xscen could inject use_cftime=True when it sees that df.date_start.min() < '1677-09-21T00:12:43.145224193' or df.date_end.max() > '2262-04-11T23:47:16.854775807'.

Additional context

Intake-esm has no notion of temporal coverage of the assets in the catalog, but xscen does.

Contribution

  • I would be willing/able to open a Pull Request to contribute this feature.
@aulemahal aulemahal added the enhancement New feature or request label Oct 26, 2023
@aulemahal aulemahal self-assigned this Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant