Skip to content

Modeling foreign direct aid#1126

Open
jdebacker wants to merge 17 commits into
PSLmodels:masterfrom
jdebacker:foreign_aid
Open

Modeling foreign direct aid#1126
jdebacker wants to merge 17 commits into
PSLmodels:masterfrom
jdebacker:foreign_aid

Conversation

@jdebacker
Copy link
Copy Markdown
Member

This PR addresses Issue #1123 by adding a parameter for direct foreign assistance (as a fraction of GDP) that contributes resources to the government.

@jdebacker jdebacker marked this pull request as ready for review June 1, 2026 19:45
@jdebacker jdebacker requested review from Copilot and rickecon June 1, 2026 19:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 implements Issue #1123 by introducing a new time-varying parameter (alpha_FA) representing direct foreign assistance to the domestic government as a share of GDP, and wiring that flow into the government budget constraint and the economy-wide resource constraint.

Changes:

  • Add alpha_FA to default parameters and document it in the book.
  • Incorporate foreign aid flows into fiscal policy accounting (debt/spending/transfers) and into the SS/TPI resource constraint calculations.
  • Adjust tests/docs around the updated equations and function signatures.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
ogcore/default_parameters.json Adds the new alpha_FA parameter definition and validation.
ogcore/fiscal.py Applies foreign aid flows to government budget arithmetic (SS and time path).
ogcore/aggregates.py Extends resource_constraint() to include foreign aid.
ogcore/SS.py Passes SS foreign-aid vector into the resource constraint.
ogcore/TPI.py Passes TPI foreign-aid path into the resource constraint.
tests/test_fiscal.py Updates fiscal tests to set alpha_FA and includes a debug print.
tests/test_aggregates.py Removes old commented-out code in the resource constraint test (but currently misses new arg).
docs/book/content/theory/stationarization.md Updates stationarized government budget constraint equations to include foreign aid.
docs/book/content/theory/government.md Updates government budget constraint equations/closure rules to include foreign aid.
docs/book/content/intro/parameters.md Documents alpha_FA (and includes a couple parameter doc range tweaks).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_aggregates.py
Comment thread tests/test_fiscal.py
Comment thread ogcore/fiscal.py Outdated
Comment thread ogcore/fiscal.py Outdated
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 2, 2026

Codecov Report

❌ Patch coverage is 72.72727% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.24%. Comparing base (4a8ef99) to head (107301a).

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1126      +/-   ##
==========================================
- Coverage   73.25%   73.24%   -0.02%     
==========================================
  Files          21       21              
  Lines        5242     5251       +9     
==========================================
+ Hits         3840     3846       +6     
- Misses       1402     1405       +3     
Flag Coverage Δ
unittests 73.24% <72.72%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
ogcore/SS.py 79.02% <100.00%> (+0.09%) ⬆️
ogcore/aggregates.py 100.00% <100.00%> (ø)
ogcore/fiscal.py 97.14% <80.00%> (-0.86%) ⬇️
ogcore/TPI.py 33.85% <0.00%> (-0.16%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

3 participants