[Bug]: xarray=2022.11.0
.plot()
breaks with time coordinates represented by cftime
#402
Labels
type: bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
type: devops
Testing, CI/CD, systems configuration
What happened?
xarray's
.plot
wrapper requires thenc-time-axis
package to plot time coordinates represented bycftime
objects.If
nc-time-axis
does not exist,xarray
throws the error:ImportError: Plotting of arrays of cftime.datetime objects or arrays indexed by cftime.datetime objects requires the optional
nc-time-axis(v1.2.0 or later) package.
UPDATE: It looks like installing
nc-time-axis
does not fix the problem. It produces this error now:TypeError: float() argument must be a string or a real number, not 'cftime._cftime.DatetimeProlepticGregorian'
I traced the error back to
xarray=2022.11.0
: pydata/xarray#7275. Thenc_time_axis
import inxarray
was accidentally removed and has since been restored in subsequent versions.What did you expect to happen?
Plotting should work fine like in previous versions of
xarray
.Minimal Complete Verifiable Example
Relevant log output
No response
Anything else we need to know?
We need to update the
xarray
version in our conda environment yml files to the latest one.Environment
xcdat=0.4.0
The text was updated successfully, but these errors were encountered: