-
Notifications
You must be signed in to change notification settings - Fork 17
Refactor StatsPlots extension: Extract helper functions for container handling #198
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
base: main
Are you sure you want to change the base?
Conversation
…ots extension Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
…used push_if_no_duplicate! function Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Benchmark Results
Benchmark PlotsA plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #198 +/- ##
===========================================
- Coverage 87.46% 76.64% -10.83%
===========================================
Files 20 20
Lines 12865 12652 -213
===========================================
- Hits 11253 9697 -1556
- Misses 1612 2955 +1343 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The StatsPlots extension had significant code repetition across plot functions for container management, attribute setup, and palette creation. This refactors common patterns into reusable helpers.
Helper Functions Added
clear_container!- Clears plot container usingempty!()setup_plot_attributes- Returns(gr_back, attributes, attributes_redux)based on backendcreate_extended_palette- Creates extended palette with alpha reductiongroup_container_by_model_and_merge_diffs- Groups by model name and merges diff dictscreate_reduced_vector_and_diffdict- Creates reduced vector and computes diff dictFunctions Updated
plot_model_estimates/plot_model_estimates!plot_irf/plot_irf!plot_solution/plot_solution!plot_conditional_forecast/plot_conditional_forecast!plot_conditional_variance_decompositionExample
Before:
After:
Net reduction of ~150 lines.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.