Implement __sizeof__ on objects?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem? Please describe.
Currently ds.nbytes returns the size of the data.
But sys.getsizeof(ds) returns a very small number.
Describe the solution you'd like
If we implement __sizeof__ on DataArrays & Datasets, this would work.
I think that would be something like ds.nbytes + the size of the ds container, + maybe attrs if those aren't handled by .nbytes?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DataArray and Dataset objects, their existing nbytes behavior, and Python's sys.getsizeof/sizeof entry points. Define whether the result includes the data, container, and attrs, then confirm the agreed sizing semantics for both object types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100