Skip to content

fix: prevent input mutation and figure leaks in plotters - #264

Merged
0ctagon merged 3 commits into
mainfrom
fix/plotters-mutation-and-figure-bugs
Jul 27, 2026
Merged

fix: prevent input mutation and figure leaks in plotters#264
0ctagon merged 3 commits into
mainfrom
fix/plotters-mutation-and-figure-bugs

Conversation

@0ctagon

@0ctagon 0ctagon commented Jun 12, 2026

Copy link
Copy Markdown
Member

🤖 Claude Opus

  • plot_hist: fix np.nan_to_num(values, 0) passing 0 as copy arg (in-place mutation)
  • plot_model / plot_data_model_comparison: deep-copy unstacked_kwargs_list dicts
  • plot_model: use list comprehension instead of [{}]*n
  • plot_model: compute sum(components) once
  • plot_data_model_comparison: close dummy figure in plot_only path
  • create_comparison_figure: squeeze=False+ravel(), default height_ratios from nrows
  • plot_function: rename shadowed loop variable func -> f

🤖 Claude Opus

- plot_hist: fix np.nan_to_num(values, 0) passing 0 as copy arg (in-place mutation)
- plot_model / plot_data_model_comparison: deep-copy unstacked_kwargs_list dicts
- plot_model: use list comprehension instead of [{}]*n
- plot_model: compute sum(components) once
- plot_data_model_comparison: close dummy figure in plot_only path
- create_comparison_figure: squeeze=False+ravel(), default height_ratios from nrows
- plot_function: rename shadowed loop variable func -> f

@cyrraz cyrraz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, please check a minor comment

Comment thread tests/test_plotters.py Outdated
@0ctagon
0ctagon merged commit 86ddd8b into main Jul 27, 2026
7 checks passed
@0ctagon
0ctagon deleted the fix/plotters-mutation-and-figure-bugs branch July 27, 2026 06:40
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

Successfully merging this pull request may close these issues.

2 participants