PSLmodels / OG-Core

An overlapping generations model framework for evaluating fiscal policies.
https://pslmodels.github.io/OG-Core/
Creative Commons Zero v1.0 Universal
65 stars 111 forks source link

Generalizations in `output_plots.py` #923

Closed jdebacker closed 4 months ago

jdebacker commented 4 months ago

This PR does to things to make output_plots.py work better with different parameterizations:

  1. It ensures that the num_years_to_plot is less than T (or raises an assertion if not).
  2. Labels for ability types are generalized to work with any lambdas values.

Addresses Issue #757

codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 79.31034% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 73.47%. Comparing base (95987b7) to head (0206cd0).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923/graphs/tree.svg?width=650&height=150&src=pr&token=98mQCVhspd&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #923 +/- ## ========================================== + Coverage 73.44% 73.47% +0.02% ========================================== Files 19 19 Lines 4610 4637 +27 ========================================== + Hits 3386 3407 +21 - Misses 1224 1230 +6 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `73.47% <79.31%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/output\_plots.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/923?src=pr&el=tree&filepath=ogcore%2Foutput_plots.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL291dHB1dF9wbG90cy5weQ==) | `95.33% <79.31%> (-1.18%)` | :arrow_down: |
rickecon commented 4 months ago

This looks good to me. Thanks @jdebacker. Merging.