Add extend_single_year_dataset for fast dataset year projection#7700
Draft
Add extend_single_year_dataset for fast dataset year projection#7700
Conversation
Adds USSingleYearDataset and USMultiYearDataset schema classes, extend_single_year_dataset() with multiplicative uprating from the parameter tree, and dual-path loading in Microsimulation that auto-detects entity-level HDFStore files and extends them without routing through the simulation engine. Legacy h5py files continue to work via the existing code path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fixes #7699
Summary
USSingleYearDatasetandUSMultiYearDatasetschema classes (modeled after UK equivalents) for entity-level dataset handlingextend_single_year_dataset()with multiplicative uprating derived fromsystem.variables[var].upratingat runtime — no separate uprating list to maintainMicrosimulation.__init__: auto-detects entity-level HDFStore files, loads them asUSSingleYearDataset, extends via uprating, and passes the multi-year result to policyengine-coreDepends on
-us-data)Test plan
Microsimulation(dataset="path/to/STATE.hdfstore.h5")— verify it loads and extends correctlyMicrosimulation(dataset="path/to/STATE.h5")— verify existing path still worksemployment_income) grow year-over-yearage) are carried forward unchanged_is_hdfstore_format()correctly distinguishes the two file formats🤖 Generated with Claude Code