_normalise_period_key drops the stop date of start.stop reform keys
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 68/100
Rechercherichtung
Start at _normalise_period_key and _normalise_policy in projects/policyengine-simulation-executor/src/policyengine_simulation_executor/simulation_runtime.py, then trace how the normalised key flows into policyengine.core.Simulation(policy=...). Read compile_reform_to_policy in tax_benefit_models/common/reform.py and reform_dict_from_parameter_values in utils/parametric_reforms.py to see where end_date is dropped. Done when a bounded key like 2026-01-01.2026-12-31 stops applying after its stop date in a multi-year budget run; note the author has not executed this, so first reproduce with a small two-year simulation.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
_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(".")
if len(parts) > 1 and len(parts[0]) == 10:
return parts[0]
return text
_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_policyturns each{path: {date: value}}entry into aParameterValuewithend_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.
- Vorherrschende Sprache
- Python
- Sterne
- 1
- Forks
- 1
- Ø Merge
- 1 T. 7 Std.
- Gemergte PRs (30 T.)
- 24
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PolicyEngine/policyengine-sim-api
-
Integration tests fail due to missing UV virtual environment setupEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
PolicyEngine/policyengine-sim-api#314 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Update policyengine to 6.2.3Evtl. vergeben @policyengine hat das heute übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 15/100
PolicyEngine/policyengine-sim-api#734 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Upgrade simulation workers to the forthcoming UK region-filter fixEvtl. vergeben @anth-volk hat das heute übernommen. Offen
Schwierigkeit 3/5 1-3 Stunden Anfängerfreundlichkeit 15/100
PolicyEngine/policyengine-sim-api#732 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Update policyengine to 6.2.2Evtl. vergeben @policyengine hat das vor 1 Tag übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 20/100
PolicyEngine/policyengine-sim-api#730 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
PolicyEngine/policyengine-sim-api#729 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in PolicyEngine/policyengine-sim-api
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
UKGovernmentBEIS/inspect_ai#5802 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
no-human-ai/no_human#660 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
documentation need help question
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 66/100
phonology024/babelscribe#26 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100