_normalise_period_key drops the stop date of start.stop reform keys
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 68/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
_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.
- Langage dominant
- Python
- Étoiles
- 1
- Forks
- 1
- Merge moyen
- 1 j 10 h
- PR mergées (30 j)
- 53
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PolicyEngine/policyengine-sim-api
-
Integration tests fail due to missing UV virtual environment setupPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
PolicyEngine/policyengine-sim-api#314 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 4/5 3-5 jours Accessibilité débutants 22/100
PolicyEngine/policyengine-sim-api#814 ·
Les mainteneurs répondent en général sous 1 jour
-
Register weighted-microdata rules: weights aren't valuesPeut-être pris @anth-volk l’a pris il y a 3 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
PolicyEngine/policyengine-sim-api#806 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 25/100
PolicyEngine/policyengine-sim-api#805 ·
Les mainteneurs répondent en général sous 1 jour
-
Refactor within ruff's complexity limits, then select every ruff rule (ALL)Peut-être pris @anth-volk l’a pris il y a 3 jours. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 15/100
PolicyEngine/policyengine-sim-api#803 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de PolicyEngine/policyengine-sim-api
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
TomerAberbach/profiler-md#733 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
its-me-prash/vwgroup-connect-ha#1858 ·
Les mainteneurs répondent en général sous 1 jour
-
area: client bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Les mainteneurs répondent en général sous 1 jour
-
Deleting all alarms or timers shows deleted ones until the next update when there are none leftOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
leikoilja/ha-google-home#1107 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Graphify-Labs/graphify#4524 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour