Closed Zyantist closed 1 month ago
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. See the Contributing Guide for more. It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. Thank you!
thanks for the detailed report.
I believe this is the same as #9399, which was fixed by #9403 (and I can't reproduce on main
with numpy>=2.1
). We're only waiting on a release now, which should happen soon(-ish).
Thank you for the quick reply. I justed tested it with the main branch and it works indeed
What happened?
Upgrading numpy from 1.26.4 to 2.1.2 breaks my code. I went through several pages of issues looking for "concat", but none seemed to fit.
The xr.concat method applied to a list of DataArrays that are to be concatenated along a scalar coordinate seems to no longer work. When the DataArrays are created, it used to convert a scalar coord of
np.str_
type to a numpy array with dtype<U...
. This conversion seems to be gone and, without it, my code no longer works.Instead a rather cryptic error message appears (full traceback below, here the last bit):
self.data with latest numpy is just a string version of a UUID (was formerly converted to a numpy array) and the indexer is (None, Ellipsis).
What did you expect to happen?
In contrast to the output posted below in the "Minimal Complete Verifiable Example" and "Relevant log output", I expected this output that I get with numpy version 1.26.4 :
Where the `xarr1.coords["scalar_coord"] looks like this (an array created from a scalar):
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
I created a fresh fedora container and created two new virtual environments in which I executed the exact same code to ensure this really has just to do with xarray and numpy versions.
I went through all 3 pages of open issues on "concat" and read those that appeared to possibly be relevant, but none seemed to match my case. Truely sorry if I overlooked something!
Environment