Skip to content
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

Add base arviz or azbase accessor #18

Open
OriolAbril opened this issue Sep 28, 2024 · 0 comments
Open

Add base arviz or azbase accessor #18

OriolAbril opened this issue Sep 28, 2024 · 0 comments

Comments

@OriolAbril
Copy link
Member

We should keep an eye on DataTree and see what can be upstreamed, but I think we should have an azbase accessor defined here where we reimplement some of the methods of InferenceData so they behave in the most similar way possible. For example, I use .map a lot. I basically use it for any operation that needs to be done on multiple groups at once. The closest thing to InferenceData.map would be DataTree.map_over_subtree which clearly does not fit the bill because 1) it has no way of indicating in the function call to which subset of groups the function should be applied to 2) the signature of the function has to be func(node.dataset, *args, **kwargs) -> Dataset and datasets don't have a name attribute so the function can't decide to return the node as is or transform it based on the name.

There are also other methods that differ from general xarray behaviour such as extend or add_groups but that are quite common in use, so having them mimicked via DataTree.azbase.extend or things like this would be nice and would help make the transition easier.

Why azbase or arviz? So far, the idea is to have the splitted pacakges be mostly independent. Thus it should be possible to use them on their own (that is, installing arviz-base but no arviz-stats nor arviz-plotting). However, while we want this to be possible, I don't expect that to be the most common case, so we should also expose a full-fledged arviz. If we use azbase and azstats for the accessors in the splitted packages, the arviz package can then be a mostly metapackage that installs all 3 at the same time, exposes their functions via a common namespace arviz. and could also combine the azbase and azstats accessors into a single arviz accessor.

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

No branches or pull requests

1 participant