home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 1275752720

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
1275752720 I_kwDOAMm_X85MCnEQ 6704 Future of `DataArray.rename` 43316012 open 0     11 2022-06-18T10:14:43Z 2023-09-11T00:53:31Z   COLLABORATOR      

What is your issue?

In https://github.com/pydata/xarray/pull/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 a

  • DataArray.rename_dims
  • DataArray.rename_vars
  • DataArray.rename

Several open questions about the behavior (Similar things apply to Dataset.rename{, _dims, _vars}):

  • [ ] Should rename_dims also rename indexes (dimension coordinates)?
  • [ ] Should rename_vars also rename the DataArray?
  • [ ] What to do if the DataArray has the same name as one of its coordinates?
  • [ ] Should 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 https://github.com/pydata/xarray/issues/6665#issuecomment-1154368202_: - rename operates on DataArray as described in https://github.com/pydata/xarray/pull/6665#issuecomment-1150810485.%C2%A0Generally I'm less keen on "different types have different semantics", and here a positional arg would mean a DataArray rename, and kwarg would mean var rename. But it does work locally to DataArray quite well. - rename only exists on DataArrays for the name of the DataArray, and we use rename_vars & rename_dims for both DataArrays & Datasets. So Dataset.rename is soft-deprecated.

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/6704/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 10 rows from issue in issue_comments
Powered by Datasette · Queries took 0.52ms · About: xarray-datasette