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

Fix bug in the `baseline_spending=True` parameterization #957

Closed jdebacker closed 3 months ago

jdebacker commented 3 months ago

In PR #880, all TPI output arrays were cast as have a length of T in the time dimension.

This posed an error for the case of baseline_spending=True, which was looking for aggregate transfers (TR) to be of length T+S. This PR fixes that error.

codecov-commenter commented 3 months ago

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.31%. Comparing base (19c90fc) to head (64d690c).

Files Patch % Lines
ogcore/TPI.py 0.00% 2 Missing :warning:
Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/957/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/957?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #957 +/- ## ========================================== + Coverage 71.29% 71.31% +0.01% ========================================== Files 20 20 Lines 4954 4953 -1 ========================================== Hits 3532 3532 + Misses 1422 1421 -1 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/957/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/957/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `71.31% <0.00%> (+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/957?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/TPI.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/957?src=pr&el=tree&filepath=ogcore%2FTPI.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL1RQSS5weQ==) | `35.82% <0.00%> (+0.09%)` | :arrow_up: |
rickecon commented 3 months ago

@jdebacker. This looks great. Now passed all tests. Merging now.