Add capital gains basis indexation reform#8427
Draft
MaxGhenis wants to merge 3 commits into
Draft
Conversation
d51b237 to
827c7e1
Compare
7043379 to
2a09ae8
Compare
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
Adds the PolicyEngine-US side of capital gains basis indexation, stacked on #8423's new basis and holding-period inputs.
This PR adds:
long_term_capital_gainsconsumers continue to workNotes
This intentionally computes the adjustment at the tax-unit level first. The data imputation PR stores basis and holding period at person level for compatibility, but the collapsed imputation is conceptually one representative transaction per tax unit.
The default reform helpers use a no-loss cap. A separate
capital_gains_indexation_retrospective_losses_allowedhelper is included for benchmarking against the public Yale runscript, which appears to leaveindex_kg_no_loss = 0.Stacked on #8423. Related data issue: PolicyEngine/policyengine-us-data#1126.
Tests
uv run ruff check policyengine_us/variables/gov/irs/tax/federal_income/capital_gains/tax_unit_long_term_capital_gains_indexation_adjustment.py policyengine_us/variables/household/income/person/capital_gains/long_term_capital_gains_indexation_adjustment.py policyengine_us/reforms/capital_gains_indexation.py policyengine_us/variables/household/income/person/capital_gains/long_term_capital_gains.pyuv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/contrib/capital_gains_indexation.yaml -c policyengine_usuv run python -m policyengine_core.scripts.policyengine_command test policyengine_us/tests/policy/baseline/gov/irs/tax/federal_income/capital_gains policyengine_us/tests/policy/baseline/gov/irs/integration/capital_gains_losses.yaml policyengine_us/tests/variables/household/income/person/capital_gains -c policyengine_usuv run pytest policyengine_us/tests/test_parameter_files.py policyengine_us/tests/test_system_import.py -q