Skip to content

Consolidate computation_modules.py with CountryConfig from policyengine library #138

@anth-volk

Description

@anth-volk

Problem

computation_modules.py has 818 lines with 13 module functions — many duplicated as _uk/_us variants that differ only in program names, variable lists, and calculator functions. Each module function also:

  • Hard-codes country-specific program/variable lists (duplicating what the library should own)
  • Calls model_rebuild() workarounds that are now fixed in the library
  • Has two separate dispatch tables (UK_MODULE_DISPATCH, US_MODULE_DISPATCH)

Solution

Use CountryConfig from policyengine.outputs.country_config (added in PolicyEngine/policyengine.py#260) to:

  • Replace 6 duplicate module functions with single config-driven functions
  • Replace two dispatch tables with one MODULE_DISPATCH
  • Remove inline program/variable lists (now in US_CONFIG/UK_CONFIG)
  • Remove model_rebuild() calls (fixed in library's __init__.py)

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions