Support nested dicts in DataTree.from_dict() and to_dict()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
What is your issue?
It would be nice to natively support nested data in from_dict() and to_dict(), rather only than the current "flat" format, e.g., DataTree.from_dict({'a': {'b': {'c': None}}}) instead of DataTree.from_dict({'/a/b/c': None}).
For from_dict(), we could support this by automatically expanding dictionary arguments.
For to_dict(), we could add a new argument nested=True for indicating that a nested dict of names should be returned instead of the current flat structure.
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 by locating the DataTree.from_dict() and to_dict() entry points and reading how they currently handle the flat format. Define the behavior for nested dictionaries and the proposed nested=True option, then verify that nested input and output work while the existing flat behavior remains available.
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
- 45/100