Skip to content

replacement_rate_adjustment in steady-state#1053

Merged
rickecon merged 13 commits into
PSLmodels:masterfrom
jdebacker:ss_replace
Sep 10, 2025
Merged

replacement_rate_adjustment in steady-state#1053
rickecon merged 13 commits into
PSLmodels:masterfrom
jdebacker:ss_replace

Conversation

@jdebacker

Copy link
Copy Markdown
Member

This PR updates the pension.SS_amount function to apply the replacement_rate_adjustment parameter to steady-state pension amounts.

@jdebacker jdebacker marked this pull request as ready for review September 8, 2025 15:40
@codecov-commenter

codecov-commenter commented Sep 8, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.69%. Comparing base (7c9a238) to head (95bb2af).
⚠️ Report is 232 commits behind head on master.

Files with missing lines Patch % Lines
ogcore/TPI.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1053      +/-   ##
==========================================
+ Coverage   72.50%   72.69%   +0.19%     
==========================================
  Files          21       21              
  Lines        5085     5084       -1     
==========================================
+ Hits         3687     3696       +9     
+ Misses       1398     1388      -10     
Flag Coverage Δ
unittests 72.69% <94.11%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/SS.py 72.52% <100.00%> (+0.22%) ⬆️
ogcore/config.py 100.00% <100.00%> (+66.66%) ⬆️
ogcore/household.py 87.98% <100.00%> (-0.11%) ⬇️
ogcore/pensions.py 67.88% <100.00%> (+0.85%) ⬆️
ogcore/TPI.py 36.27% <50.00%> (+0.08%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jdebacker jdebacker requested a review from Copilot September 8, 2025 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 applies the replacement_rate_adjustment parameter to steady-state pension calculations, ensuring consistent scaling of replacement rates across different calculation methods. The change addresses a gap where the adjustment was not being applied to steady-state pension amounts.

  • Updates pension.SS_amount function to apply replacement_rate_adjustment to steady-state calculations
  • Refactors logging configuration by centralizing it in a new config.py module
  • Removes scattered verbose parameters and debug print statements

Reviewed Changes

Copilot reviewed 7 out of 11 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ogcore/pensions.py Applies replacement rate adjustment to steady-state pension calculations and removes debug prints
ogcore/config.py Centralizes logging configuration with new module
ogcore/household.py Replaces local logging setup with centralized config import
ogcore/TPI.py Removes verbose parameter from run_TPI function
ogcore/SS.py Removes verbose parameter from run_SS function and fixes logging syntax
tests/test_household.py Adds parameter adjustment for replacement rate in test setup
examples/run_ogcore_example.py Removes manual verbosity settings

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

Comment thread ogcore/SS.py
)
logging.info(f"GE loop errors = ", [f"{error:.3e}" for error in errors])
error_string = [f"{error:.3e}" for error in errors]
logging.info(f"GE loop errors = {error_string}")

Copilot AI Sep 8, 2025

Copy link

Choose a reason for hiding this comment

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

The logging statement will print the list representation instead of a clean format. Consider using ', '.join(error_string) to format the errors properly.

Suggested change
logging.info(f"GE loop errors = {error_string}")
logging.info(f"GE loop errors = {', '.join(error_string)}")

Copilot uses AI. Check for mistakes.
@jdebacker jdebacker requested a review from rickecon September 8, 2025 16:05
@jdebacker

Copy link
Copy Markdown
Member Author

@rickecon This PR is ready for your review. I would recommend running the example script from this branch so we get another verification of it running as expected.

@rickecon rickecon merged commit 9ae48b7 into PSLmodels:master Sep 10, 2025
7 checks passed
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.

4 participants