Add StitchedRunner for year-based PE/TAXSIM routing#729
Merged
Conversation
Routes tax years >= 2021 to PolicyEngineRunner and earlier years to TaxsimRunner, merging results in original taxsimid order. This is now the default in both the CLI stdin/stdout mode and the policyengine subcommand, enabling historical tax simulation back to the 1960s. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mock the underlying runners instead of the cli module attribute, which resolves differently depending on the import path used. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
TAXSIM35 stops at 2023 and freezes state law at 2021. PolicyEngine models enacted legislation (TCJA, ARPA, OBBBA) as scheduled. Updated the landing page and README to call this out. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
@PavelMakarchuk — would appreciate your review on this, especially the website/README messaging. One question in particular: how should we reflect TAXSIM's time coverage on the site? Some context:
The landing page currently says "1960s through future law" with a note that TAXSIM stops at 2023. Want to make sure this framing is accurate and fair — especially since TAXSIM does have some coverage for 2022–2023 (just with frozen state law and projected inflation). Should we be more nuanced, or is the current framing right? |
- Validate output taxsimids match input to catch runner bugs early - Warn when PE-only kwargs (logs, disable_salt, assume_w2_wages) are set but some rows route to TAXSIM where they have no effect - Handle empty frames edge case in pd.concat - Refine TAXSIM description on landing page: specify that state law is inflation-adjusted 2021 law (not simply "frozen") - Fix README wording for consistency Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_generate_yaml_files used iloc[idx] to match input rows to result rows, which breaks when StitchedRunner reorders results from two engines. Now indexes results_df by taxsimid for reliable matching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All three runners (PolicyEngine, TAXSIM, Stitched) previously failed with unhelpful errors when year was missing: KeyError, or TAXSIM Fortran "STOP 1". Now raises a clear ValueError early in validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "type": "module" to package.json so Vite and Vitest configs load correctly (both use ESM import syntax) - Pin jsdom to ^26 to avoid html-encoding-sniffer@6 ESM incompatibility with Vitest's worker pools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the year-stitching card inline with open source and drop-in compatible cards instead of wrapping to a second row. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
StitchedRunnerthat routes rows by tax year: >= 2021 to PolicyEngineRunner, earlier years to TaxsimRunnertaxsimidorderpe_min_yearparameter (default 2021)policyenginesubcommand now useStitchedRunneras default, enabling historical tax simulation back to the 1960sTest plan
🤖 Generated with Claude Code