-
-
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
Revert .oindex
and .vindex
additions in _ElementwiseFunctionArray
, NativeEndiannessArray
, and BoolTypeArray
classes
#8921
base: main
Are you sure you want to change the base?
Revert .oindex
and .vindex
additions in _ElementwiseFunctionArray
, NativeEndiannessArray
, and BoolTypeArray
classes
#8921
Conversation
…`, `NativeEndiannessArray`, and `BoolTypeArray` classes
@ocraft, when you get a chance do you mind try this branch and confirming whether this fixes your issue in #8909? as @dcherian noted, the minimal verifiable example you provided in #8909 (comment) wasn't reproducible on his end. |
aacbe04
to
721aaf1
Compare
Ok, I started from scratch and created venv with this set of packages (newest version of xarray and scipy with deps):
and my example results in error as in #8909 (comment)
I got:
|
…ayMixin subclasses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yuck but ok :)
@ocraft, when you get a chance can you confirm this fully addresses the issue on your end? |
I have this error: |
Can we add the reproducer as a test case please |
@andersy005 can we add a test here please? |
i wanted to mention that, as i revisit this issue to add a test, i'm learning the temporary fix may become more complex than initially thought. should we attempt to fix this going forward (as part of the adding support for oindex/vindex to BackendArray) rather than reverting to the previous behavior? |
i can confirm that this issue is fully resolved on In [1]: import xarray as xr
...:
...: ds = xr.Dataset()
...: ds['A'] = xr.DataArray([[1, 'a'], [2,'b']],dims=['x','y'])
...: ds.to_netcdf('/tmp/test.nc')
...: ds2 = xr.open_dataset('/tmp/test.nc')
...: ds2.sel(y=[1]).to_netcdf('/tmp/test.nc')
In [2]:
In [2]: xr.show_versions()
INSTALLED VERSIONS
------------------
commit: e96e70e04dc21607173d7cdcd9dba2c121d6aab6
python: 3.12.3 | packaged by conda-forge | (main, Apr 15 2024, 18:35:20) [Clang 16.0.6 ]
python-bits: 64
OS: Darwin
OS-release: 23.4.0
machine: arm64
processor: arm
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: ('en_US', 'UTF-8')
libhdf5: None
libnetcdf: None
xarray: 2024.3.1.dev39+g04cca97a0
pandas: 2.2.2
numpy: 1.26.4
scipy: 1.13.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
zarr: None
cftime: None
nc_time_axis: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 69.5.1
pip: 24.0
conda: None
pytest: None
mypy: None
IPython: 8.22.2
sphinx: None |
As noted in #8909, the use of
.oindex
and.vindex
properties in coding/* appears to have broken some backends (e.g. scipy). This PR reverts those changes. We plan to bundle these changes into a separate backends feature branch (see this comment, which will be merged once we are confident about its impact on downstream dependencies.whats-new.rst
api.rst