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

Abstract common tasks between plot_forest and plot_ridge #69

Open
OriolAbril opened this issue Jul 12, 2024 · 1 comment
Open

Abstract common tasks between plot_forest and plot_ridge #69

OriolAbril opened this issue Jul 12, 2024 · 1 comment

Comments

@OriolAbril
Copy link
Member

Both functions have significant portions of code that are common, they should be abstracted into a single source to reduce duplication.

Extra comment/bit of a side note: One part where they do differ is that plot_forest generates colmun=[labes, forest] and plot_ridge generates column=[labels, ridge]. This means that the following is not possible:

pc = plot_forest(data)
pc = plot_ridge(data, plot_collection=pc)

to generate a ridge plot with the point estimates and the credible intervals. As of now, it would be necessary to rename the coordinate values in pc.viz. Is that what we want?

@imperorrp
Copy link
Collaborator

If we rename the coordinates to a common pair we could maybe do column = [label, data] in lieu of "forest" and "ridge".

Otherwise as another solution (for the case you mention as an example) we could maybe check for the existence of either the "forest" or "ridge" coord if an existing pc is passed as a parameter to the function. Then based on the plotting function called, change it appropriately in the pc.viz. So we could just have to add a check to account for this case.

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

2 participants