Skip to content

Commit 57e78fd

Browse files
anth-volkclaude
andcommitted
Fix parameter path syntax: use dot notation for non-scale parameters
PolicyEngine parameter nodes (income bracket rates, CTC phase-out thresholds, VA standard deduction) use dot notation (rates.1, threshold.SINGLE), not bracket notation (rates[1], threshold[SINGLE]). Bracket syntax is only for ParameterScale objects. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b807454 commit 57e78fd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

backend/simulation.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class StatewideImpactRequest(BaseModel):
7979

8080
# Federal income tax bracket rate parameter paths (7 brackets, 1-indexed keys in YAML)
8181
FEDERAL_BRACKET_RATE_PATHS = [
82-
f"gov.irs.income.bracket.rates[{i}]" for i in range(1, 8)
82+
f"gov.irs.income.bracket.rates.{i}" for i in range(1, 8)
8383
]
8484

8585
# Federal CTC parameter paths
@@ -228,19 +228,19 @@ def build_reform_object(reform_params: ReformParams) -> Reform:
228228
# Federal CTC phase-out thresholds (filing-status-indexed)
229229
# SINGLE and HEAD_OF_HOUSEHOLD use the single threshold;
230230
# JOINT and SURVIVING_SPOUSE use the joint threshold
231-
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}[SINGLE]"] = {
231+
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}.SINGLE"] = {
232232
period_key: reform_params.federal_ctc_phase_out_threshold_single
233233
}
234-
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}[HEAD_OF_HOUSEHOLD]"] = {
234+
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}.HEAD_OF_HOUSEHOLD"] = {
235235
period_key: reform_params.federal_ctc_phase_out_threshold_single
236236
}
237-
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}[JOINT]"] = {
237+
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}.JOINT"] = {
238238
period_key: reform_params.federal_ctc_phase_out_threshold_joint
239239
}
240-
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}[SURVIVING_SPOUSE]"] = {
240+
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}.SURVIVING_SPOUSE"] = {
241241
period_key: reform_params.federal_ctc_phase_out_threshold_joint
242242
}
243-
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}[SEPARATE]"] = {
243+
reform_dict[f"{FEDERAL_CTC_PHASE_OUT_THRESHOLD_PATH}.SEPARATE"] = {
244244
period_key: reform_params.federal_ctc_phase_out_threshold_single
245245
}
246246

@@ -277,7 +277,7 @@ def build_reform_object(reform_params: ReformParams) -> Reform:
277277
# Virginia standard deduction (filing-status-indexed)
278278
if reform_params.va_standard_deduction is not None:
279279
for fs in ["SINGLE", "JOINT", "SEPARATE", "HEAD_OF_HOUSEHOLD", "SURVIVING_SPOUSE"]:
280-
reform_dict[f"{VA_STANDARD_DEDUCTION_PATH}[{fs}]"] = {
280+
reform_dict[f"{VA_STANDARD_DEDUCTION_PATH}.{fs}"] = {
281281
period_key: reform_params.va_standard_deduction
282282
}
283283

0 commit comments

Comments
 (0)