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
|
@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 |
* Making decoding arrays lazy too * Add IndexingAdapter mixin class * Cleanup backends some more * Revert "Add IndexingAdapter mixin class" This reverts commit 930f24d. * Fix scipy backend * Add scipy-only CI job xref #8909 * Pin array-api-strict * Fix doctest * Add test for #8909 Closes #8909, #8921 * Remove user warning * fix types * Add whats-new * fix types * Fix docs build
As noted in #8909, the use of
.oindexand.vindexproperties 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.rstapi.rst