Skip to content

Conversation

thorek1
Copy link
Owner

@thorek1 thorek1 commented Jun 25, 2025

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Jun 25, 2025

Codecov Report

❌ Patch coverage is 64.05797% with 124 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.29%. Comparing base (895d027) to head (5139519).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/MacroModelling.jl 64.33% 107 Missing ⚠️
src/get_functions.jl 58.62% 12 Missing ⚠️
src/filter/inversion.jl 0.00% 3 Missing ⚠️
src/macros.jl 0.00% 2 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (895d027) and HEAD (5139519). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (895d027) HEAD (5139519)
17 15
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #127      +/-   ##
==========================================
- Coverage   82.43%   74.29%   -8.15%     
==========================================
  Files          18       19       +1     
  Lines       10625    11923    +1298     
==========================================
+ Hits         8759     8858      +99     
- Misses       1866     3065    +1199     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

github-actions bot commented Jun 25, 2025

Benchmark Results

main 5139519... main / 5139519...
FS2000/NSSS 14.5 ± 0.73 μs 14 ± 0.74 μs 1.04 ± 0.075
FS2000/covariance 0.122 ± 0.0041 ms 0.122 ± 0.028 ms 0.998 ± 0.23
FS2000/irf 1.01 ± 0.057 ms 1 ± 0.033 ms 1 ± 0.066
FS2000/jacobian 0.767 ± 0.0051 μs 0.765 ± 0.0029 μs 1 ± 0.0077
FS2000/lyapunov/bartels_stewart 0.102 ± 0.0013 ms 0.101 ± 0.0012 ms 1.01 ± 0.017
FS2000/lyapunov/bicgstab 0.044 ± 0.0014 ms 30.2 ± 1.2 μs 1.46 ± 0.074
FS2000/lyapunov/doubling 0.0395 ± 0.014 ms 0.0517 ± 0.0014 ms 0.764 ± 0.28
FS2000/lyapunov/gmres 27.3 ± 2.8 μs 26.7 ± 1.8 μs 1.02 ± 0.13
FS2000/qme/doubling 0.123 ± 0.0022 ms 0.123 ± 0.0017 ms 1 ± 0.022
FS2000/qme/schur 0.0846 ± 0.018 ms 0.0705 ± 0.018 ms 1.2 ± 0.39
NAWM_EAUS_2008/NSSS 7.38 ± 0.11 ms 3.08 ± 0.51 ms 2.4 ± 0.4
NAWM_EAUS_2008/covariance 31.2 ± 0.37 ms 27 ± 0.53 ms 1.15 ± 0.027
NAWM_EAUS_2008/irf 0.0318 ± 0.00057 s 28.4 ± 1.6 ms 1.12 ± 0.067
NAWM_EAUS_2008/jacobian 0.0577 ± 0.0043 ms 0.0603 ± 0.0056 ms 0.956 ± 0.11
NAWM_EAUS_2008/lyapunov/bartels_stewart 29.2 ± 0.46 ms 29.4 ± 0.84 ms 0.992 ± 0.032
NAWM_EAUS_2008/lyapunov/bicgstab 0.182 ± 0.00047 s 0.204 ± 0.00023 s 0.894 ± 0.0025
NAWM_EAUS_2008/lyapunov/doubling 17.5 ± 0.67 ms 17.8 ± 0.49 ms 0.983 ± 0.046
NAWM_EAUS_2008/lyapunov/gmres 0.144 ± 0.0022 s 0.146 ± 0.0044 s 0.992 ± 0.034
NAWM_EAUS_2008/qme/doubling 25.5 ± 0.79 ms 25.5 ± 0.68 ms 0.997 ± 0.041
NAWM_EAUS_2008/qme/schur 16.8 ± 0.32 ms 17 ± 0.44 ms 0.985 ± 0.032
Smets_Wouters_2007/NSSS 0.148 ± 0.013 ms 0.144 ± 0.014 ms 1.03 ± 0.13
Smets_Wouters_2007/covariance 1.63 ± 0.034 ms 1.63 ± 0.038 ms 1 ± 0.032
Smets_Wouters_2007/irf 5.49 ± 0.32 ms 5.5 ± 0.29 ms 0.997 ± 0.079
Smets_Wouters_2007/jacobian 10.2 ± 22 μs 11.5 ± 22 μs 0.885 ± 2.6
Smets_Wouters_2007/lyapunov/bartels_stewart 1.49 ± 0.017 ms 1.5 ± 0.013 ms 0.991 ± 0.014
Smets_Wouters_2007/lyapunov/bicgstab 5.89 ± 0.057 ms 5.9 ± 0.048 ms 0.999 ± 0.013
Smets_Wouters_2007/lyapunov/doubling 0.963 ± 0.014 ms 0.964 ± 0.013 ms 0.999 ± 0.02
Smets_Wouters_2007/lyapunov/gmres 7.12 ± 0.38 ms 7.17 ± 0.42 ms 0.992 ± 0.079
Smets_Wouters_2007/qme/doubling 1.74 ± 0.025 ms 1.73 ± 0.03 ms 1 ± 0.023
Smets_Wouters_2007/qme/schur 1.29 ± 0.031 ms 1.29 ± 0.034 ms 1 ± 0.036
time_to_load 11.3 ± 0.081 s 11.5 ± 0.38 s 0.978 ± 0.033
main 5139519... main / 5139519...
FS2000/NSSS 0.292 k allocs: 16.9 kB 0.292 k allocs: 16.9 kB 1
FS2000/covariance 0.928 k allocs: 0.126 MB 0.929 k allocs: 0.127 MB 0.999
FS2000/irf 7.05 k allocs: 0.333 MB 7.05 k allocs: 0.333 MB 1
FS2000/jacobian 1 allocs: 16 B 1 allocs: 16 B 1
FS2000/lyapunov/bartels_stewart 0.075 k allocs: 0.0657 MB 0.075 k allocs: 0.0657 MB 1
FS2000/lyapunov/bicgstab 0.089 k allocs: 0.0378 MB 0.089 k allocs: 0.0378 MB 1
FS2000/lyapunov/doubling 0.063 k allocs: 0.0393 MB 0.063 k allocs: 0.0393 MB 1
FS2000/lyapunov/gmres 0.147 k allocs: 0.0816 MB 0.147 k allocs: 0.0816 MB 1
FS2000/qme/doubling 0.199 k allocs: 0.0434 MB 0.199 k allocs: 0.0434 MB 1
FS2000/qme/schur 0.263 k allocs: 0.0848 MB 0.263 k allocs: 0.0848 MB 1
NAWM_EAUS_2008/NSSS 2.67 k allocs: 5.32 MB 1.65 k allocs: 1.72 MB 3.09
NAWM_EAUS_2008/covariance 5.17 k allocs: 19.3 MB 4.15 k allocs: 15.7 MB 1.23
NAWM_EAUS_2008/irf 0.105 M allocs: 20.2 MB 0.104 M allocs: 16.6 MB 1.22
NAWM_EAUS_2008/jacobian 7 allocs: 0.709 MB 7 allocs: 0.709 MB 1
NAWM_EAUS_2008/lyapunov/bartels_stewart 0.078 k allocs: 4.92 MB 0.078 k allocs: 4.92 MB 1
NAWM_EAUS_2008/lyapunov/bicgstab 0.092 k allocs: 5.66 MB 0.092 k allocs: 5.66 MB 1
NAWM_EAUS_2008/lyapunov/doubling 0.07 k allocs: 6.87 MB 0.07 k allocs: 6.87 MB 1
NAWM_EAUS_2008/lyapunov/gmres 0.392 k allocs: 0.0412 GB 0.395 k allocs: 0.0416 GB 0.991
NAWM_EAUS_2008/qme/doubling 0.305 k allocs: 6.29 MB 0.305 k allocs: 6.29 MB 1
NAWM_EAUS_2008/qme/schur 0.41 k allocs: 7.4 MB 0.41 k allocs: 7.4 MB 1
Smets_Wouters_2007/NSSS 1.02 k allocs: 0.0524 MB 1.02 k allocs: 0.0524 MB 1
Smets_Wouters_2007/covariance 2.64 k allocs: 1.33 MB 2.64 k allocs: 1.33 MB 1
Smets_Wouters_2007/irf 0.0338 M allocs: 2.2 MB 0.0338 M allocs: 2.2 MB 1
Smets_Wouters_2007/jacobian 7 allocs: 0.0612 MB 7 allocs: 0.0612 MB 1
Smets_Wouters_2007/lyapunov/bartels_stewart 0.077 k allocs: 0.44 MB 0.077 k allocs: 0.44 MB 1
Smets_Wouters_2007/lyapunov/bicgstab 0.091 k allocs: 0.469 MB 0.091 k allocs: 0.469 MB 1
Smets_Wouters_2007/lyapunov/doubling 0.069 k allocs: 0.568 MB 0.069 k allocs: 0.568 MB 1
Smets_Wouters_2007/lyapunov/gmres 0.303 k allocs: 2.66 MB 0.303 k allocs: 2.66 MB 1
Smets_Wouters_2007/qme/doubling 0.298 k allocs: 0.624 MB 0.298 k allocs: 0.624 MB 1
Smets_Wouters_2007/qme/schur 0.398 k allocs: 0.757 MB 0.398 k allocs: 0.757 MB 1
time_to_load 0.153 k allocs: 10.7 kB 0.153 k allocs: 10.7 kB 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 12:46
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds combined plotting functionality to MacroModelling.jl that allows users to layer multiple economic model results on the same plots. The main addition is a suite of "bang" functions (ending with !) that can be called sequentially to add additional series to existing plots, enabling side-by-side comparison of different parameter configurations, models, or shock scenarios.

Key changes include:

  • Implementation of combined plotting functions (plot_irf!, plot_model_estimates!, etc.)
  • Centralization of default options and common plotting logic
  • Addition of get_model_estimates function that combines estimated variables and shocks
  • Enhanced error handling and user feedback throughout the codebase

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/test_estimation.jl Adds test for combined model estimates plotting
test/runtests.jl Extensive test suite additions for combined plotting across multiple test sets
test/functionality_tests.jl Updates functionality test to accept two models and adds comprehensive combined plotting tests
test/fix_combined_plots.jl New comprehensive test file demonstrating combined plotting functionality
src/macros.jl Improves warning messages for invalid macro options
src/get_functions.jl Adds get_model_estimates function and updates default options usage
src/filter/inversion.jl Minor error handling improvement
src/default_options.jl New file centralizing all default option constants
src/common_docstrings.jl Updates documentation strings to use centralized default values
src/MacroModelling.jl Major updates including new plotting functions, helper utilities, and enhanced shock processing
ext/TuringExt.jl Updates to use centralized default option constants
docs/src/unfinished_docs/todo.md Adds new TODO items for future improvements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

const DEFAULT_SYLVESTER_ALGORITHM = :doubling
const DEFAULT_SYLVESTER_THRESHOLD = 1000
const DEFAULT_LARGE_SYLVESTER_ALGORITHM = :bicgstab
const DEFAULT_SYLVESTER_SELECTOR = 𝓂 -> sum(1:𝓂.timings.nPast_not_future_and_mixed + 1 + 𝓂.timings.nExo) > DEFAULT_SYLVESTER_THRESHOLD ? DEFAULT_LARGE_SYLVESTER_ALGORITHM : DEFAULT_SYLVESTER_ALGORITHM
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

This complex selector function embedded as a constant makes the code harder to understand. Consider extracting this into a named function with a descriptive name like select_sylvester_algorithm(𝓂) for better readability and maintainability.

Suggested change
const DEFAULT_SYLVESTER_SELECTOR = 𝓂 -> sum(1:𝓂.timings.nPast_not_future_and_mixed + 1 + 𝓂.timings.nExo) > DEFAULT_SYLVESTER_THRESHOLD ? DEFAULT_LARGE_SYLVESTER_ALGORITHM : DEFAULT_SYLVESTER_ALGORITHM
function select_sylvester_algorithm(𝓂)
total = sum(1:𝓂.timings.nPast_not_future_and_mixed + 1 + 𝓂.timings.nExo)
if total > DEFAULT_SYLVESTER_THRESHOLD
return DEFAULT_LARGE_SYLVESTER_ALGORITHM
else
return DEFAULT_SYLVESTER_ALGORITHM
end
end
const DEFAULT_SYLVESTER_SELECTOR = select_sylvester_algorithm

Copilot uses AI. Check for mistakes.


import LoopVectorization: @turbo
import Polyester
# import Polyester
Copy link

Copilot AI Oct 6, 2025

Choose a reason for hiding this comment

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

Commented-out import suggests incomplete refactoring. If Polyester is no longer needed, the line should be removed entirely. If it's temporarily disabled, add a comment explaining why.

Suggested change
# import Polyester

Copilot uses AI. Check for mistakes.

Copilot AI and others added 23 commits October 6, 2025 14:50
…quation_algorithm, sylvester_algorithm, and lyapunov_algorithm (#151)

* Initial plan

* Complete plotting_script.jl documentation for tol, quadratic_matrix_equation_algorithm, sylvester_algorithm, and lyapunov_algorithm

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Update plotting_script.jl

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Co-authored-by: Thore Kockerols <thorek1@users.noreply.github.com>
…152)

* Initial plan

* Add plotting.md documentation and generate_plots.jl script

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Add plotting documentation references to docstrings

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Add README for plot generation and note to plotting_script.jl

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Remove plotting documentation references

Removed references to comprehensive plotting documentation in multiple sections.

* Remove SAVE_PLOTS_NAME constant

Removed the SAVE_PLOTS_NAME constant from common docstrings.

* Delete docs/README_plots.md

* Fix plot filename references to match automatic naming convention

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Co-authored-by: Thore Kockerols <thorek1@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
…ing impulse response function plots and saving them to the documentation assets directory. This script was previously used to facilitate the regeneration of documentation plots.
…on! for combining multiple solutions (#153)

* Initial plan

* Refactor plot_solution to accept single algorithm and add plot_solution!

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Update tests for new plot_solution API

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Remove duplicate include of default_options.jl in MacroModelling.jl

* Add relevant input differences table to plot_solution! for comparing multiple solutions

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Fix plot_solution to handle single container case on first call

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Implement legend with 2 columns and show relevant input difference for single difference case

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* Add support for multiple states with separate plot sets per state

Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>

* order of legend items

* Adjust layout heights in _plot_solution_from_container to accommodate varying input differences

* fix plot solution

* Enhance functionality tests by adding comprehensive plot_solution! tests for multiple algorithms and states

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thorek1 <13523097+thorek1@users.noreply.github.com>
Co-authored-by: thorek1 <thorek1@users.noreply.github.com>
Co-authored-by: Thore Kockerols <Thore.Kockerols@ecb.europa.eu>
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.

3 participants