PSLmodels / OG-Core

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

Debt to GDP plot labels #962

Closed jdebacker closed 3 months ago

jdebacker commented 3 months ago

This PR updates constants.py to allow for more variables to be plotted as a fraction of GDP.

Assertions and error messages are added to let the user know if they enter a variable that is not in the list of variables to plot.

jdebacker commented 3 months ago

Related to Issue #960

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.31%. Comparing base (e799452) to head (79dcd46). Report is 2 commits behind head on master.

Files Patch % Lines
ogcore/utils.py 50.00% 1 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962/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/962?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #962 +/- ## ======================================= Coverage 71.31% 71.31% ======================================= Files 20 20 Lines 4953 4958 +5 ======================================= + Hits 3532 3536 +4 - Misses 1421 1422 +1 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962/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/962/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `71.31% <94.11%> (+<0.01%)` | :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/962?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/constants.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962?src=pr&el=tree&filepath=ogcore%2Fconstants.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL2NvbnN0YW50cy5weQ==) | `100.00% <100.00%> (ø)` | | | [ogcore/output\_plots.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962?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.38% <100.00%> (+0.03%)` | :arrow_up: | | [ogcore/parameter\_tables.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962?src=pr&el=tree&filepath=ogcore%2Fparameter_tables.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3BhcmFtZXRlcl90YWJsZXMucHk=) | `86.07% <100.00%> (ø)` | | | [ogcore/pensions.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962?src=pr&el=tree&filepath=ogcore%2Fpensions.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3BlbnNpb25zLnB5) | `67.03% <100.00%> (ø)` | | | [ogcore/utils.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/962?src=pr&el=tree&filepath=ogcore%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL3V0aWxzLnB5) | `87.01% <50.00%> (-0.17%)` | :arrow_down: |
rickecon commented 3 months ago

@jdebacker. Looks good. Merging.