NCAS-CMS / NCAS-CMS/cf-python

Should standard attributes such as 'standard_name' always be present, even if their value is None?

Open
#478 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
150
Forks
23
Avg merge
1d 11h
Merged PRs (30d)
2

Description

If I have a field, f, which has no standard_name, then

f.standard_name

currently returns

AttributeError: 'Field' has no 'standard_name' property

Shouldn't the correct answer be None, and if not, why not?

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the reported f.standard_name access on a field without a standard name. Review how standard attributes are represented and decide whether missing attributes should return None; done means the behavior and its rationale are documented by tests or issue resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.