should cf-xarray change the meaning of .keys?

Open
#105 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Review the change introduced by #104 alongside xarray Dataset.keys behavior. Decide whether .cf.keys() should retain its current special-key behavior or be renamed/redefined, and document the chosen API semantics before implementation.

Written by the indexing model from the issue text.

Description

opinion wanted

After merging #104, I remembered that xarray Datasets have .keys method which returns a list of variable names in Dataset.data_vars.

#104 added .cf.keys that replaced .cf.get_valid_keys (i.e. .cf.keys returns a List of valid "special keys"). This changes cf_xarray's usual position of not changing the "meaning" of any existing xarray method.

I am unsure of whether we actually want to do this.

  1. Something like .cf.get_valid_keys() is useful, I think; though it may be less useful now that we have .cf.axes and friends. Is there a better name for this function?
  2. Should .cf.keys() instead return a list of "special keys" in ds.data_vars? I don't know if this is that useful either...

Thoughts?

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.