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
Problem
On April 3, 2026, the post-merge pipeline discussed on PR #684 failed in
coordinate_publishwith:The immediate import site is in
modal_app/local_area.py:That import is too heavy for the local-area Modal image.
policyengine_us_data/__init__.pyeagerly imports.datasets, which pulls in modules that depend onpolicyengine_coreandpolicyengine_us. Thecoordinate_publishimage does not include those packages, so the run fails before H5 generation can proceed.Root cause
coordinate_publishonly needsSTATE_CODES, but it imports that constant fromcalibration_utils, which transitively imports the full package dependency chain.Smallest safe fix
Move
STATE_CODESto a lightweight module with no heavy package imports, or inline/use an already-lightweight source for that mapping, and updatemodal_app/local_area.pyto import from there instead.The goal is to keep the
coordinate_publishpath importable on the local-area image without requiringpolicyengine_coreorpolicyengine_us.Acceptance criteria
coordinate_publishno longer importspolicyengine_coretransitively when building work itemsModuleNotFoundErrorContext