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
[X] I would be willing/able to open a Pull Request to contribute this feature.
Addressing a Problem?
A bare
extract_dataset
on a dataset that has assets both inside and outside thedatetime64
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 injectuse_cftime=True
when it sees thatdf.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