Repository navigation
Conversation
…uction-hook # Conflicts: # tests/core/test_simulation_builder.py
A Reform inherited TaxBenefitSystem's no-op preprocess_situation, so reformed systems, including the YAML runner's inline-parameter and reforms: cases, skipped the country's hook. Reform now delegates to its baseline. Flat files that declare a group only through its ID column now record it as supplied, matching the loader. IndividualSim's placeholder and default groups are no longer recorded as supplied. A hook that returns something other than a dict raises a TypeError naming the hook. The docs describe dataset provenance, axes and default_period accurately. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hua7450
added a commit
to hua7450/policyengine-us
that referenced
this pull request
Oct 31, 2026
PolicyEngine/policyengine-core#600 now includes Core's main (3.34.0) and delegates the hook through reforms, so main's policyengine-us imports against it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Country models cannot currently supply missing entity groups consistently across the household API and YAML runner. Add an opt-in
TaxBenefitSystem.preprocess_situationhook before entity construction, and recordSimulation.input_group_entitiesso formulas can distinguish supplied memberships from generated defaults. The default hook leaves other countries' behavior unchanged; datasets bypass it and retain their supplied membership provenance. AReformdelegates the hook to its baseline, so reformed systems and the YAML runner's inline-parameter andreforms:cases run the country's hook too.Prerequisite for PolicyEngine/policyengine-us#9999; consumer implementation: PolicyEngine/policyengine-us#10000. Keep in draft while the US consumer and integration are reviewed.
Validation (head with master merged in): 163 focused tests pass across the simulation builder,
IndividualSim, dataset loading, reforms, the YAML runner and axes;ruff formatandruff checkpass. New tests cover reform delegation (directly and through the YAML runner's system builder), partially supplied groups in a multi-group system, flat files that declare a group only through its ID column, array datasets,IndividualSimplaceholder groups, and a hook that returns a non-dict. No country package or real microdata is required. The full core suite was not run.Documentation review: added the hook/provenance contract to the simulation API reference and source docstrings. Impact: medium (public extension point, opt-in default). Confidence: high for the focused paths; downstream US integration is being tested in the companion draft.