Align str/repr of core types

Open
#146 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by locating the implementations of the core types named in the issue: AttrvalsDict, NcVariable, NcData, and NameMap, then inspect how their str and repr behavior is defined. Compare the current interactive outputs and align the representations consistently, verifying that groups and variables display as intended.

Written by the indexing model from the issue text.

Description

Since providing a 'useful' AttrvalsDict.str(), find that this is not the repr(), which instead looks like <ncdata._core.AttrvalsDict object at 0x...>
This is consistent for most core objects, e.g. <ncdata._core.NcVariable object at 0x...>
But a NameMap object doesn't do that, e.g.

>>> ds
<ncdata._core.NcData object at 0x0000024F7ADFC2F0>
>>> ds.variables['v']
<ncdata._core.NcVariable object at 0x0000024F7B8824E0>

but ..

>>> ds.groups
{}
>>> ds.variables
{'v': <ncdata._core.NcVariable object at 0x0000024F7B8824E0>}
>>>``` 
Dominant language
Python
Stars
16
Forks
5
PR merge metrics
No merged PRs in 30d

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 SciTools/ncdata

All issues in SciTools/ncdata

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.