-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allows numpy.bool_ attrs when writing with h5netcdf engine #4981
Comments
Can you post an issue about that with an error message? You can always make your change, and open a PR, and have the CI check it :) . PRs are very welcome! |
Very cool to hear you're using xarray in your quantum computing framework! This sounds like a reasonable change to me. A PR would indeed be very welcome! |
Done #4985 |
PR created #4986 |
Hey, guys!! Does any of you have backends expertise? A review of PR #4986 from someone with knowledge on the topic would be appreciated so much 🥺 One collaborator already approves the hotfix but is waiting for an additional approval Kind regards |
What happened:
Round trip dataset using
h5netcdf
+invalid_netcdf=True
fails for bool attribute due to lack of support in xarray fornumpy.bool_
(note that is not the same asnumpy.bool
)What you expected to happen:
Attributes of
numpy.bool_
type should be supported because theh5netcdf
has no issue with it.Minimal Complete Verifiable Example:
Raises:
Anything else we need to know?:
Xarray is awesome!! Thank you, guys! ❤
We are adopting it fully for a quantum computing experimental framework (Quantify). This issue is very critical for us at the moment 😭
For reference, the following works in
h5netcdf
:How to fix:
In
/xarray/backends/api.py:221
:add
np.bool_
:I did a quick test (
xarray-0.17.1.dev3+g48378c4b
) and it seems to work, but the tests (without any changes to the code) fail on my local clone of the repo so it would be more difficult to go through a PR for this.Considering that it is a single line of code, could this be deployed relatively easily into the master branch by some maintainer? That would be highly appreciated! 🥺
Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.6 | packaged by conda-forge | (default, Jan 7 2020, 22:05:27)
[Clang 9.0.1 ]
python-bits: 64
OS: Darwin
OS-release: 18.7.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
libhdf5: 1.10.4
libnetcdf: None
xarray: 0.17.0
pandas: 1.0.1
numpy: 1.19.3
scipy: 1.5.4
netCDF4: None
pydap: None
h5netcdf: 0.10.0
h5py: 2.10.0
Nio: None
zarr: 2.6.1
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.1.3
cartopy: None
seaborn: 0.11.0
numbagg: None
pint: None
setuptools: 45.2.0.post20200209
pip: 20.0.2
conda: None
pytest: 5.3.5
IPython: 7.12.0
sphinx: 3.2.1
The text was updated successfully, but these errors were encountered: