Skip to content

Fix coordinate_publish import path that pulls in policyengine_core on the local-area image #692

@MaxGhenis

Description

@MaxGhenis

Problem

On April 3, 2026, the post-merge pipeline discussed on PR #684 failed in coordinate_publish with:

ModuleNotFoundError: No module named 'policyengine_core'

The immediate import site is in modal_app/local_area.py:

from policyengine_us_data.calibration.calibration_utils import STATE_CODES

That import is too heavy for the local-area Modal image. policyengine_us_data/__init__.py eagerly imports .datasets, which pulls in modules that depend on policyengine_core and policyengine_us. The coordinate_publish image does not include those packages, so the run fails before H5 generation can proceed.

Root cause

coordinate_publish only needs STATE_CODES, but it imports that constant from calibration_utils, which transitively imports the full package dependency chain.

Smallest safe fix

Move STATE_CODES to a lightweight module with no heavy package imports, or inline/use an already-lightweight source for that mapping, and update modal_app/local_area.py to import from there instead.

The goal is to keep the coordinate_publish path importable on the local-area image without requiring policyengine_core or policyengine_us.

Acceptance criteria

  • coordinate_publish no longer imports policyengine_core transitively when building work items
  • The local-area Modal image can execute the work-item discovery path without ModuleNotFoundError
  • The fix does not broaden the local-area image dependency set

Context

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