You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_normalise_period_key drops the stop date of start.stop reform keys #724
_normalise_period_key (projects/policyengine-simulation-executor/src/policyengine_simulation_executor/simulation_runtime.py) reduces a start.stop period key to its start date:
def_normalise_period_key(period_key: Any) ->str:
"""Convert legacy ``start.stop`` period keys to v4 effective dates."""text=str(period_key)
parts=text.split(".")
iflen(parts) >1andlen(parts[0]) ==10:
returnparts[0]
returntext
_normalise_policy applies it to both the baseline and the reform policy before they reach policyengine.core.Simulation(policy=...). In policyengine.py main:
compile_reform_to_policy turns each {path: {date: value}} entry into a ParameterValue with end_date=None (tax_benefit_models/common/reform.py);
reform_dict_from_parameter_values (utils/parametric_reforms.py) runs such an open-ended value until the day before the next value of the same parameter starts, or to 2100-12-31.
So the stop date of a bounded app value never reaches the simulation. For example, {"2026-01-01.2026-12-31": 0.05} stays in force after 2026, until the next start date the policy gives that parameter, or to 2100. In a budget window, later years then use the reform value instead of the baseline.
This comes from reading sim-api main and policyengine.py main on 2026-10-06; I have not run it. The release bundle sim-api pins may resolve an older policyengine.py. Found while reviewing PolicyEngine/policyengine-us#9628.
Activity