You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an dataarray with dtype np.bool_. When I write it using netcdf (engine h5netcdf, or default) and then read in a copy, the copy has dtype int8.
What you expected to happen:
The loaded data array should have dtype bool
Minimal Complete Verifiable Example:
I have had a hard time reducing this to a sample. The data array comes from a larger dataset which exhibits the same problem. I can copy the dataarray using copy() and it still exhibits the problem; however if I build a new data array using the constructor, the new array doesn't exhibit the problem. As far as I can tell, though, the original and the rebuilt dataarray are otherwise identical.
I am at a loss how to investigate why ci and ci3 don't survive round-trip, but ci2 does. Unfortunately, I also have been unable to produce a free-standing example -- whenever I try I get an object that survives round trip intact. I suspect that xarray internals is somewhere/somehow keeping a cache to the original ci (presumably still linked to the overall dataset from which ci came), and this is what is causing the problem, but I don't know where to look. (Suggestions welcome!)
What happened:
I have an dataarray with dtype
np.bool_
. When I write it using netcdf (engine h5netcdf, or default) and then read in a copy, the copy has dtype int8.What you expected to happen:
The loaded data array should have dtype bool
Minimal Complete Verifiable Example:
I have had a hard time reducing this to a sample. The data array comes from a larger dataset which exhibits the same problem. I can copy the dataarray using copy() and it still exhibits the problem; however if I build a new data array using the constructor, the new array doesn't exhibit the problem. As far as I can tell, though, the original and the rebuilt dataarray are otherwise identical.
Anything else we need to know?:
I am at a loss how to investigate why
ci
andci3
don't survive round-trip, butci2
does. Unfortunately, I also have been unable to produce a free-standing example -- whenever I try I get an object that survives round trip intact. I suspect that xarray internals is somewhere/somehow keeping a cache to the originalci
(presumably still linked to the overall dataset from whichci
came), and this is what is causing the problem, but I don't know where to look. (Suggestions welcome!)Environment:
Output of xr.show_versions()
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.8.5 (default, Sep 4 2020, 07:30:14)
[GCC 7.3.0]
python-bits: 64
OS: Linux
OS-release: 5.8.0-48-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.12.0
libnetcdf: None
xarray: 0.17.0
pandas: 1.2.4
numpy: 1.20.2
scipy: 1.6.2
netCDF4: None
pydap: None
h5netcdf: 0.10.0
h5py: 3.2.1
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: 2021.04.0
distributed: 2021.04.0
matplotlib: 3.4.1
cartopy: None
seaborn: None
numbagg: None
pint: None
setuptools: 51.0.0
pip: 20.3.1
conda: None
pytest: 6.2.3
IPython: 7.22.0
sphinx: None
The text was updated successfully, but these errors were encountered: