Current versions of (pandas/xarray?) are now causing a failure in xarray.Dataset.to_netcdf with the datasets generated by viresclient where "Spacecraft" is stored as a pandas.Categorical, where this didn't happen before.
For example:
import pandas as pd
import xarray as xr
ds = xr.Dataset(
data_vars={
"x": ("t", pd.Categorical(["A", "B", "B", "A"], categories=["A", "B"]))
}
)
ds.to_netcdf("test.h5")
fails with:
TypeError: Cannot interpret 'CategoricalDtype(categories=['A', 'B'], ordered=False, categories_dtype=object)' as a data type
Current versions of (pandas/xarray?) are now causing a failure in
xarray.Dataset.to_netcdfwith the datasets generated by viresclient where "Spacecraft" is stored as apandas.Categorical, where this didn't happen before.VirES-Python-Client/src/viresclient/_data_handling.py
Line 238 in f15fa07
For example:
fails with: