-
-
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
Future of DataArray.rename
#6704
Comments
This is the sort of thing we can discuss briefly on our dev call — which you would be more than welcome to attend and participate in @headtr1ck. It's at 8.30AM PT every second Wednesday, including this coming Wednesday. I think there's an issue about it (though am on a plane wifi connection so currently difficult to search...). Unfortunately I've been poor at attendance recently given my schedule, but I have been trying to rearrange things so I can start attending again. |
that's #4001 |
I feel honored thanks! But given that I will become a father any day now, I don't think I will be able to join regularly... |
Congrats on the forthcoming arrival! Ofc, no stress if you can't make the meeting, and obv zero stress if you can't make lots of them. |
There is also anther issue discussing this: #4825 |
Should we call it The later might make more sense, but then it wouldn't mirror |
As discussed on the call:
After the call, I realize that I didn't mention that |
|
Yes, renaming dimensions and/or coordinates should be properly handled by indexes. Xarray's For example,
|
Sorry I think I misunderstood the question. If that means "should rename_dims also rename the (dimension) coordinates", then I think the answer should be no. With the explicit indexes refactor coordinates and indexes are less tightly coupled, i.e., in the mid/long term we want to drop the concept of a "dimension coordinate with an implicit index". So I think |
Found this after hitting the issue (and realize I have commented a few times a year ago...) Note that there's some overlap between this & #6238 & #4825. @benbovy 's comments at #6238 (comment) & #4825 (comment) seem compelling to me... |
What is your issue?
In #6665 the question came up what to do with
DataArray.rename
in light of the new index refactor.To be consistent with
Dataset
we should introduce aDataArray.rename_dims
DataArray.rename_vars
DataArray.rename
Several open questions about the behavior (Similar things apply to
Dataset.rename{, _dims, _vars}
):rename_dims
also rename indexes (dimension coordinates)?rename_vars
also rename the DataArray?DataArray
has the same name as one of its coordinates?rename
still rename everything (like it is now) or only the name (Possibly with some deprecation cycle)?The current implementation of
DataArray.rename
is a bit inconsistent:As stated by @max-sixty in #6665 (comment)_:
The text was updated successfully, but these errors were encountered: