Skip to content

US economic_impact_analysis uses fragile hard-coded program variable names #325

@anth-volk

Description

@anth-volk

Follow-up from the instrumented US budgetary-impact run and PR discussion: #264 (comment)

economic_impact_analysis currently builds US program statistics from a hard-coded list of program variable names. The run completed the expensive baseline and reform simulations and produced quick aggregate outputs, but then failed in ProgramStatistics -> Aggregate.run() with StopIteration while looking up a configured variable in simulation.tax_benefit_model_version.variables.

Likely immediate mismatch: the US program list includes payroll_tax, but the US model/output path appears to expose/materialize employee_payroll_tax instead. Other entries may also be fragile, for example medicare may not correspond to a plain aggregate variable in the US package.

This pattern is especially fragile for the US package because variable names and output variables can change quickly. The analysis layer should probably either:

  • validate the configured program list up front and raise a clear error listing missing variables,
  • derive supported program statistics from model metadata/output metadata, or
  • maintain an explicit country-versioned mapping that is tested against current US outputs.

The important distinction from the run: the final exception is an analysis-layer lookup bug, while the earlier VSCode crash was more consistent with resource pressure during the simulation phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions