|
3086 | 3086 | "docstring": "Promote a completed pipeline run to production.\n\n1. Verify run status is \"completed\"\n2. Promote every staged artifact in one Hugging Face commit\n3. Upload/copy every artifact to GCS\n4. Finalize release_manifest.json, tag the release, and update\n version_manifest.json\n5. Update run status to \"promoted\"\n\nArgs:\n run_id: The run ID to promote.\n candidate_version: Candidate staging scope used for staged source files.\n release_version: Stable version used for final release metadata.\n\nReturns:\n Summary message.", |
3087 | 3087 | "id": "promote_pipeline_run", |
3088 | 3088 | "kind": "function", |
3089 | | - "line": 1910, |
| 3089 | + "line": 1922, |
3090 | 3090 | "metadata": { |
3091 | 3091 | "api_refs": [ |
3092 | 3092 | "modal_app.pipeline.promote_run" |
|
3507 | 3507 | "docstring": "Run the full pipeline end-to-end.\n\nArgs:\n branch: Git branch to build from.\n gpu: GPU type for regional calibration.\n epochs: Training epochs for regional calibration.\n national_gpu: GPU type for national calibration.\n national_epochs: Training epochs for national.\n num_workers: Number of parallel H5 workers.\n n_clones: Number of clones for H5 building.\n skip_national: Skip national calibration/H5.\n resume_run_id: Resume a previously failed run.\n clear_checkpoints: Wipe ALL checkpoints before building\n (default False). Normally not needed \u2014 checkpoints are\n scoped by commit SHA, so stale ones from other commits\n are cleaned automatically. Use True only to force a\n full rebuild of the current commit.\n candidate_version: Candidate staging scope used for HF staging.\n release_version: Final stable release version. Usually empty until\n promotion.\n base_release_version: Stable release current when this candidate was\n built.\n release_bump: Intended SemVer bump for this candidate.\n sha_override: Exact source SHA deployed by GitHub Actions. When\n provided, this is recorded instead of reading the current\n branch tip.\n run_id: Cross-system run ID created by GitHub.\n run_context: Serialized run context from the launcher workflow.\n modal_app_name: Deployed Modal app name for this run.\n modal_environment: Modal environment used for this run.\n chunked_matrix: Build the calibration matrix in clone-household\n chunks instead of the non-chunked path. Opt-in; default off.\n chunk_size: Clone-household columns per chunk when\n ``chunked_matrix`` is True.\n parallel_matrix: Fan chunked matrix building across Modal\n workers via ``build_matrix_chunk_worker``. Only meaningful\n when ``chunked_matrix`` is True; ignored otherwise.\n num_matrix_workers: Number of Modal workers when\n ``parallel_matrix`` is True.\n\nReturns:\n The run ID for use with promote.", |
3508 | 3508 | "id": "run_modal_pipeline", |
3509 | 3509 | "kind": "function", |
3510 | | - "line": 943, |
| 3510 | + "line": 944, |
3511 | 3511 | "metadata": { |
3512 | 3512 | "api_refs": [ |
3513 | 3513 | "modal_app.pipeline.run_pipeline" |
|
3709 | 3709 | "docstring": "Return canonical Stage 2 paths rooted in an artifacts directory.", |
3710 | 3710 | "id": "stage2_artifact_specs", |
3711 | 3711 | "kind": "function", |
3712 | | - "line": 96, |
| 3712 | + "line": 378, |
3713 | 3713 | "metadata": { |
3714 | 3714 | "api_refs": [ |
3715 | 3715 | "policyengine_us_data.calibration_package.specs.calibration_package_artifact_paths" |
3716 | 3716 | ], |
3717 | | - "artifacts_out": "[CALIBRATION_PACKAGE_FILENAME, CALIBRATION_PACKAGE_CONTRACT_FILENAME]", |
3718 | | - "description": "Centralize calibration package, contract, metadata, and matrix-build artifact paths.", |
| 3717 | + "artifacts_in": "[SOURCE_DATASET_FILENAME, TARGET_DATABASE_FILENAME]", |
| 3718 | + "artifacts_out": "[CALIBRATION_PACKAGE_FILENAME, CALIBRATION_PACKAGE_METADATA_FILENAME, CALIBRATION_PACKAGE_CONTRACT_FILENAME]", |
| 3719 | + "description": "Centralize Stage 2 input, package, contract, metadata, report, and matrix-build artifact names.", |
3719 | 3720 | "id": "stage2_artifact_specs", |
3720 | 3721 | "label": "Stage 2 Artifact Specs", |
3721 | 3722 | "node_type": "library", |
|
3730 | 3731 | ] |
3731 | 3732 | }, |
3732 | 3733 | "object_path": "policyengine_us_data.calibration_package.specs.calibration_package_artifact_paths", |
3733 | | - "signature": "def calibration_package_artifact_paths(artifacts_dir: str | Path) -> CalibrationPackageArtifactPaths", |
| 3734 | + "signature": "def calibration_package_artifact_paths(artifacts_dir: str | Path) -> CalibrationPackageOutputBundle", |
| 3735 | + "source_file": "policyengine_us_data/calibration_package/specs.py" |
| 3736 | + }, |
| 3737 | + "stage2_build_context": { |
| 3738 | + "docstring": "Return Stage 2 run context, preferring the Stage 1 handoff contract.", |
| 3739 | + "id": "stage2_build_context", |
| 3740 | + "kind": "function", |
| 3741 | + "line": 323, |
| 3742 | + "metadata": { |
| 3743 | + "api_refs": [ |
| 3744 | + "policyengine_us_data.calibration_package.specs.stage2_build_context_for_run" |
| 3745 | + ], |
| 3746 | + "artifacts_in": "[DATASET_BUILD_OUTPUT_CONTRACT_FILENAME, SOURCE_DATASET_FILENAME, TARGET_DATABASE_FILENAME]", |
| 3747 | + "artifacts_out": "[CALIBRATION_PACKAGE_FILENAME, CALIBRATION_PACKAGE_CONTRACT_FILENAME]", |
| 3748 | + "description": "Bind one run_id to canonical Stage 2 input and output bundles before remote package construction starts.", |
| 3749 | + "id": "stage2_build_context", |
| 3750 | + "label": "Stage 2 Build Context", |
| 3751 | + "node_type": "library", |
| 3752 | + "pathways": [ |
| 3753 | + "calibration_package" |
| 3754 | + ], |
| 3755 | + "source_file": "policyengine_us_data/calibration_package/specs.py", |
| 3756 | + "stability": "moving", |
| 3757 | + "status": "current", |
| 3758 | + "validation_commands": [ |
| 3759 | + "uv run pytest tests/unit/calibration_package/test_specs.py" |
| 3760 | + ] |
| 3761 | + }, |
| 3762 | + "object_path": "policyengine_us_data.calibration_package.specs.stage2_build_context_for_run", |
| 3763 | + "signature": "def stage2_build_context_for_run(pipeline_mount: str | Path, run_id: str | None = '', *, stage1_contract_path: str | Path | None = None) -> Stage2BuildContext", |
3734 | 3764 | "source_file": "policyengine_us_data/calibration_package/specs.py" |
3735 | 3765 | }, |
3736 | 3766 | "stage2_calibration_package_contract_validator": { |
|
3822 | 3852 | "signature": "def save_calibration_package(path: str, X_sparse, targets_df: 'pd.DataFrame', target_names: list, metadata: dict, initial_weights: np.ndarray = None, cd_geoid: np.ndarray = None, block_geoid: np.ndarray = None) -> None", |
3823 | 3853 | "source_file": "policyengine_us_data/calibration/unified_calibration.py" |
3824 | 3854 | }, |
| 3855 | + "stage2_input_bundle": { |
| 3856 | + "docstring": "Return a compatibility Stage 2 input bundle from canonical filenames.", |
| 3857 | + "id": "stage2_input_bundle", |
| 3858 | + "kind": "function", |
| 3859 | + "line": 237, |
| 3860 | + "metadata": { |
| 3861 | + "api_refs": [ |
| 3862 | + "policyengine_us_data.calibration_package.specs.stage2_input_bundle_from_artifacts_dir" |
| 3863 | + ], |
| 3864 | + "artifacts_in": "[DATASET_BUILD_OUTPUT_CONTRACT_FILENAME, SOURCE_DATASET_FILENAME, TARGET_DATABASE_FILENAME]", |
| 3865 | + "description": "Resolve the source-imputed dataset and policy target database from a Stage 1 contract or compatibility filename fallback.", |
| 3866 | + "id": "stage2_input_bundle", |
| 3867 | + "label": "Stage 2 Input Bundle", |
| 3868 | + "node_type": "library", |
| 3869 | + "pathways": [ |
| 3870 | + "calibration_package" |
| 3871 | + ], |
| 3872 | + "source_file": "policyengine_us_data/calibration_package/specs.py", |
| 3873 | + "stability": "moving", |
| 3874 | + "status": "current", |
| 3875 | + "validation_commands": [ |
| 3876 | + "uv run pytest tests/unit/calibration_package/test_specs.py" |
| 3877 | + ] |
| 3878 | + }, |
| 3879 | + "object_path": "policyengine_us_data.calibration_package.specs.stage2_input_bundle_from_artifacts_dir", |
| 3880 | + "signature": "def stage2_input_bundle_from_artifacts_dir(artifacts_dir: str | Path) -> Stage2InputBundle", |
| 3881 | + "source_file": "policyengine_us_data/calibration_package/specs.py" |
| 3882 | + }, |
3825 | 3883 | "stage2_target_config_apply": { |
3826 | 3884 | "docstring": "Filter target rows before matrix construction.", |
3827 | 3885 | "id": "stage2_target_config_apply", |
|
3853 | 3911 | "docstring": "Resolve the target config identity used by Stage 2 package construction.", |
3854 | 3912 | "id": "stage2_target_config_identity", |
3855 | 3913 | "kind": "function", |
3856 | | - "line": 127, |
| 3914 | + "line": 410, |
3857 | 3915 | "metadata": { |
3858 | 3916 | "api_refs": [ |
3859 | 3917 | "policyengine_us_data.calibration_package.specs.resolve_target_config_identity" |
|
4387 | 4445 | "docstring": "Verify deployed-image imports and subprocess seams.", |
4388 | 4446 | "id": "verify_runtime_seams", |
4389 | 4447 | "kind": "function", |
4390 | | - "line": 569, |
| 4448 | + "line": 570, |
4391 | 4449 | "metadata": { |
4392 | 4450 | "api_refs": [ |
4393 | 4451 | "modal_app.pipeline.verify_runtime_seams" |
|
0 commit comments