Skip to content

API for reorganizing levels of a datatree #9344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TomNicholas opened this issue Aug 13, 2024 · 0 comments
Open

API for reorganizing levels of a datatree #9344

TomNicholas opened this issue Aug 13, 2024 · 0 comments
Labels
API design enhancement topic-DataTree Related to the implementation of a DataTree class

Comments

@TomNicholas
Copy link
Member

What is your issue?

(Copied from xarray-contrib/datatree#186 - there are a few more comments there)


@jbusecke and I were discussing API for reorganizing levels of a tree.

For example, say I have 2 models, each which ran 2 scenarios. Thats 4 data-containing leaves in my tree, but there are 2 equally-valid ways to organise this, either model-first or scenario-first.

The model-first tree has node paths:
/mod1/scen1
/mod2/scen1
/mod1/scen2
/mod2/scen2
whilst the scenario-first tree has node paths:
/scen1/mod1
/scen2/mod1
/scen1/mod2
/scen2/mod2

Either of these is equally valid, and one might be preferred sometimes over the other, so we should have a method than can rearrange one structure into the other.

The question is what the API to do this should look like so that it's general, intuitive, and powerful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API design enhancement topic-DataTree Related to the implementation of a DataTree class
Projects
None yet
Development

No branches or pull requests

1 participant