Skip to content

Stage 5 Increment 3 shadow residual-capacity fallback#94

Merged
agurgone merged 3 commits into
mainfrom
feature/stage5-increment3-shadow-fallback
Jun 22, 2026
Merged

Stage 5 Increment 3 shadow residual-capacity fallback#94
agurgone merged 3 commits into
mainfrom
feature/stage5-increment3-shadow-fallback

Conversation

@agurgone

Copy link
Copy Markdown
Collaborator

Implements Stage 5 Increment 3 as a shadow-only residual-capacity fallback after Increment 2.

What changed:

  • Added a pure residual-capacity helper for the provisional DSTI proxy and illiquid-asset fallback.
  • Wired the Stage 5 shadow plan into Country._set_household_target_demand().
  • Recorded new shadow diagnostics on households: dsti_headroom, dsti_maximum_loan_size, dsti_cap_binding, borrow_planned, liquidation_planned, shadow_credit_requested, forced_liquidation_amount, residual_shortfall_after_caps.
  • Added a consumer-credit config hook for the calibrated proxy parameters.
  • Added unit tests for the helper and the country/household wiring.

Verification:

  • uv run pytest tests/test_macromodel/unit/test_agents/test_households/func/test_residual_capacity_fallback.py tests/test_macromodel/unit/test_agents/test_households/test_households.py tests/test_macromodel/unit/test_country/test_country.py -q
  • uv run ruff check macromodel/agents/households/func/residual_capacity_fallback.py macromodel/agents/households/households.py macromodel/country/country.py macromodel/configurations/country_configuration.py tests/test_macromodel/unit/test_agents/test_households/func/test_residual_capacity_fallback.py tests/test_macromodel/unit/test_agents/test_households/test_households.py tests/test_macromodel/unit/test_country/test_country.py

Note: run_model/run_model.ipynb has an unrelated pre-existing local modification and was not included in the commit.

@agurgone agurgone merged commit 27b7fd2 into main Jun 22, 2026
4 checks passed
@agurgone agurgone deleted the feature/stage5-increment3-shadow-fallback branch June 22, 2026 11:27
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.

1 participant