Repository navigation
Make the model horizon a constructor argument; shorten CI - #25
Draft
hmgaudecker wants to merge 7 commits into
Draft
hmgaudecker wants to merge 7 commits into
hmgaudecker wants to merge 7 commits into
Conversation
`create_model` (baseline and ACA) and `create_benchmark_model` take `final_age`, the first age at which everybody is dead, defaulting to the full horizon. The age stages, entry initial nodes, next-age lookup, transition ages and edges toward `dead` are functions of the ages instead of import-time constants. The medical-cost timing test builds ages 51-53, the NB-EGM wiring tests are long-running, and CI runs pytest on four workers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
A horizon that ends before every regime is reached prunes those regimes from the params template, so their fixed params and the model-level params only they read are dropped before the model is built. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
The benchmark model, the baseline model on unfolded and folded grids, and the ACA model per policy are built once per pytest worker and shared by every test that builds them with the same arguments. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
The AIME points per PIA segment become a GridConfig field with the current counts as default. The timing test keeps the two health-cost shock grids and shrinks AIME, wage residual and consumption. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
The model takes fixed params as given. `select_horizon_params` keeps the regime-level entries of the regimes the age stages reach, and the claiming-only params when a claiming regime is reachable. The benchmark params follow it, so a short horizon builds once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
`--dist loadscope` sends a module's tests to one worker, so a module-scoped fixture is built once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
create_model(baseline and ACA) andcreate_benchmark_modeltakefinal_age, the first age at which everybody is dead. It defaults toMODEL_CONFIG.end_age(96), so existing callers build the same model as before.config.model_ages(final_age=...)returns the ages from 51 throughfinal_age. It rejects a final age that leaves no living period or goes past 96, because the age-indexed data stop at 96.deadare all computed from the ages passed in.INITIAL_NODESis replaced bybuild_entry_initial_nodes(ages=...).initial_nodes=None(the new default) admits the entry regimes at ages 51–60 that come before the final age.ByAgethat holds only thedeadcell as a default, and no period reads it.tests/test_medical_cost_timing.pybuilds ages 51–53 instead of the full horizon. Its assertions are unchanged.final_age=53hasn_periods == 3;model_ages(final_age=53) == (51, 52, 53), and out-of-range final ages are rejected;deadwhen the model ends at 53;(51, 52).tests/test_nbegm_model_creation.pyis markedlong_running.pytest-xdistand runspytest -n 4 --durations=20 tests. The-m "not long_running"addopts setting is unchanged.https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW