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 totally agree about prioritizing consistency and robustness!
But at the same time, one of the reasons why the flexible indexes goals and potential have not been realized yet is because of the amount of time it took trying to accommodate "legacy" behavior and API with the new Xarray data model.
Implicit handling of pandas.MultiIndex objects and swap_dims are good examples of such behavior / API: it was much easier to make it work using the concept of dimension coordinates than it is now using the broader concept of (multi-)indexed (non-)dimension coordinates. See #8646 for details.
At some point we need to make some sharp decisions if we want to move forward with this (e.g., leave swap_dims in a semi-broken state with a clear deprecation warning + suggest best alternatives). I'm happy to implement them.
Or if someone wants to take a stab at fixing those issues, please go for it! I did spend too much time on things like this (instead of working on features, documentation, examples, etc.) and it's been frustrating.
What happened?
I think there is a bug when renaming axis dimensions and variables.
loading a file having the following coordinates:
I want to rename these axes as
lat
andlon
(for the sake of consistency between different datasets):which returns:
so far, everything is fine. Now I want to do a shallow copy of this dataset:
which prints:
the
lat
/lon
dimensions are now renamed as in the initial version (latitude
/longitude
)!I attached below the input file I used.
test_model.nc.gz
What did you expect to happen?
I was expecting to have the dim and coord names as the dataset I copied.
Minimal Complete Verifiable Example
No response
MVCE confirmation
Relevant log output
No response
Anything else we need to know?
No response
Environment
INSTALLED VERSIONS
commit: None
python: 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0]
python-bits: 64
OS: Linux
OS-release: 5.4.0-150-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: fr_FR.UTF-8
LOCALE: ('fr_FR', 'UTF-8')
libhdf5: 1.14.3
libnetcdf: 4.9.2
xarray: 2024.9.0
pandas: 2.2.2
numpy: 2.1.0
scipy: 1.14.1
netCDF4: 1.7.1
pydap: None
h5netcdf: 1.3.0
h5py: 3.11.0
zarr: None
cftime: 1.6.4
nc_time_axis: None
iris: None
bottleneck: None
dask: 2024.9.0
distributed: 2024.8.1
matplotlib: None
cartopy: None
seaborn: None
numbagg: None
fsspec: 2024.6.1
cupy: None
pint: None
sparse: None
flox: None
numpy_groupies: None
setuptools: 72.2.0
pip: 24.2
conda: None
pytest: 8.3.2
mypy: None
IPython: 8.26.0
sphinx: 7.4.7
The text was updated successfully, but these errors were encountered: