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
Maybe its obvious now that I take a step back, but I'm going to guess that it's because "S12" is not in the dimensions of the variable and that somehow matters more to DataArray than Dataset.
If that's the case, the question is "how to put string coordinates on DataArrays".
I thought the answer was going to be the concat_characters=True option for open_dataarray. Not quite sure why that isnt working. Will try to look at the tests and make an MRE.
the first issue the same as for #9579: the data model of DataArray does not allow having dimensions on a coordinate that is not on the DataArray's variable (as you noticed). We've discussed extending it but have not made any progress yet, and either way I don't think that would really help you in this case.
concat_characters=True not working on open_dataarray is a different issue. Since open_dataarray is roughly equal to open_dataset + a getitem, could you try if open_dataset with concat_characters=True works? If not, we might have to figure out why (set decode_cf=False and check the dtype, it should be "S1"). A MRE would be very helpful in getting to the bottom of this.
What is your issue?
This SEEMS like a bug. I think it would take me quite a bit of tedious research on my own to tell if that's true, so I'm asking if this is a bug.
I have a netcdf file where I intentionally set the coodinates on the single variable via the metadata per https://docs.xarray.dev/en/stable/user-guide/io.html#coordinates so that I could ensure the file opens as a DataArray.
While it opens fine as a DataArray, the
node_maker_name
is missing from the coordinates.But if I open as a Dataset, there's
node_maker_name
as a coordinate.This inconsistency seems unnecessary on the face of it. So I think it's a bug.
Thanks in advance!
The text was updated successfully, but these errors were encountered: