Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Should data nodes and tree nodes be unrelated classes? #4

Closed
TomNicholas opened this issue Aug 18, 2021 · 2 comments
Closed

Should data nodes and tree nodes be unrelated classes? #4

TomNicholas opened this issue Aug 18, 2021 · 2 comments

Comments

@TomNicholas
Copy link
Member

TomNicholas commented Aug 18, 2021

Currently a DatasetNode is both a node of the tree (so can have children) and can wrap a single xarray.Dataset. If we followed #3 , we could instead choose to make TreeNodes unable to wrap Datasets directly, in favour of instead storing Dataset objects as children.

This would mean that multiple Datasets could be stored as the children of a single node, but I'm not sure if that's desirable or not. It would also ensure that the class representing a node of the tree is totally distinct from an xarray.Dataset (neither inheriting from xarray.Dataset nor wrapping it, only pointing to it as a child).

In conjunction with #3 this would mean that the syntax for selecting the variable 'pressure' from the dataset stored under the node 'weather' would be simply dt['weather']['pressure']. (Although then selecting via dt['weather/pressure'] would become trickier.)

@TomNicholas TomNicholas changed the title Should data nodes and treenodes be always different? Should data nodes and tree nodes be unrelated classes? Aug 18, 2021
@TomNicholas
Copy link
Member Author

Closing this as not the right approach.

1 similar comment
@TomNicholas
Copy link
Member Author

Closing this as not the right approach.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant