Return custom name for DataArray

Open
#242 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Review issue #234 and the existing ds.cf["ssh"] lookup behavior first. Define a concrete inverse-lookup API for a DataArray, including how custom names are returned and how ambiguous or unmatched attributes are handled; done means the requested custom-name lookup has an agreed interface and coverage for the demonstrated case.

Written by the indexing model from the issue text.

Description

This came up in #234 and I want to capture the idea here:

I'd like to be able to not just ask for the "ssh" variable for example, but ask which type of variable I have. So in addition to:

ds.cf["ssh"]

returning the "ssh"-matching variable, I would like to be able to, for a DataArray da:

da.cf._get_custom_type()

to return "ssh", or somehow do the inverse search, returning the custom names that match the DataArray.

Dominant language
Python
Stars
181
Forks
49
Avg merge
43m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from xarray-contrib/cf-xarray

All issues in xarray-contrib/cf-xarray

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.