Add plot.max_subplots check before calling create_plotting_grid #425
Add plot.max_subplots check before calling create_plotting_grid #425OriolAbril merged 4 commits intoarviz-devs:mainfrom
Conversation
|
I ran into CI failures in |
|
You can use https://python.arviz.org/projects/base/en/latest/api/generated/arviz_base.rc_context.html in the problematic tests. With PlotMatrix |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #425 +/- ##
==========================================
- Coverage 85.38% 85.23% -0.16%
==========================================
Files 59 59
Lines 6883 6934 +51
==========================================
+ Hits 5877 5910 +33
- Misses 1006 1024 +18 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OriolAbril
left a comment
There was a problem hiding this comment.
minor formatting comment, it is basically ready to merge
| assert not missing_coord_names, list(pc.viz["plot"].coords) | ||
| assert pc.viz["plot"].sizes == {"row_index": 9, "col_index": 9} | ||
| with rc_context({"plot.max_subplots": None}): | ||
| pc = PlotMatrix(dataset, ["__variable__", "hierarchy", "group"], backend="none") |
There was a problem hiding this comment.
only the initialization of the PlotMatrix class needs to be inside the context, I would keep everything else outside the context
|
I have limited the |
Description
Addresses issue #354
This PR enforces the
plot.max_subplotsrcParam in arviz-plots by raising an error when the requested number of subplots exceeds the limit.The check is applied before creating the plot grid, following discussion in #354.
Key Implementation Details
Checks
rcParams["plot.max_subplots"]before callingcreate_plotting_grid.Raises a clear
ValueErrorwhen the limit is exceeded.Applies consistently in:
PlotCollection.wrapPlotCollection.gridplot_matrix._generate_viz_dt