Skip to content
This repository was archived by the owner on Aug 30, 2026. It is now read-only.
This repository was archived by the owner on Aug 30, 2026. It is now read-only.

Consolidate computation_modules.py with CountryConfig from policyengine library #138

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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