bankofcanada / StateSpaceEcon.jl

BSD 3-Clause "New" or "Revised" License
49 stars 9 forks source link

Compare plans #51

Closed jasonjensen closed 1 year ago

jasonjensen commented 1 year ago

This PR changes Base.copyto! for plans to work with plans with different sets of variables.

This PR also makes significant changes to compare_plans. By default, compare_plans no longer prints anything but instead returns an MVTSeries covering the overlap between the two plans with the following legend:

* 0 -> endogenous in both plans.
* 1 -> exogenous in the left plan only.
* 2 -> exogenous in the right plan only.
* 3 -> exogenous in both plans.

Example: image

It can also print out a summary: image

Printing the plan to a file is now done with the outfile argument, or by supplying a string or iobuffer as the first argument. image

You can also print the comparison to the console by passing stdout as the first argument. image

The new diff argument can be passed to only print to the detailed comparison parts of the plan with differences: image

Finally, the new legend option can be used to print the legend for the resulting mvtseries: image

codecov-commenter commented 1 year ago

Codecov Report

Merging #51 (2939daa) into dev (dcffc9a) will increase coverage by 0.27%. The diff coverage is 86.02%.

@@            Coverage Diff             @@
##              dev      #51      +/-   ##
==========================================
+ Coverage   87.74%   88.02%   +0.27%     
==========================================
  Files          26       26              
  Lines        2081     2162      +81     
==========================================
+ Hits         1826     1903      +77     
- Misses        255      259       +4     
Files Changed Coverage Δ
src/Plans.jl 80.19% <86.02%> (+4.03%) :arrow_up:

... and 1 file with indirect coverage changes