Skip to content

Commit 370f457

Browse files
committed
Clarify Stage 2 target config docs node
1 parent 8c77432 commit 370f457

5 files changed

Lines changed: 41 additions & 41 deletions

File tree

docs/engineering/pipeline-map.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ Build sparse calibration matrix (targets x households x clones)
384384
| `util_takeup_s5` compute_block_takeup_for_entities() | `utility` | `unknown` | `unknown` | |
385385
| `util_scipy` scipy.sparse | `utility` | `unknown` | `unknown` | |
386386
| `stage2_target_config_identity` Stage 2 Target Config Identity | `library` | `current` | `moving` | `policyengine_us_data.calibration_package.specs.resolve_target_config_identity` |
387-
| `stage2_target_catalog_load` Load Stage 2 Target Config | `library` | `current` | `moving` | `policyengine_us_data.calibration.unified_calibration.load_target_config` |
387+
| `stage2_target_config_load` Load Stage 2 Target Config | `library` | `current` | `moving` | `policyengine_us_data.calibration.unified_calibration.load_target_config` |
388388
| `stage2_target_config_apply` Apply Stage 2 Target Config | `library` | `current` | `moving` | `policyengine_us_data.calibration.unified_calibration.apply_target_config_to_targets` |
389389
| `state_precomp` Per-State Simulation Precomputation | `library` | `current` | `moving` | `policyengine_us_data.calibration.unified_matrix_builder._compute_single_state` |
390390
| `clone_assembly` Clone Value Assembly | `library` | `current` | `moving` | `policyengine_us_data.calibration.unified_matrix_builder._assemble_clone_values_standalone` |
@@ -400,8 +400,8 @@ Build sparse calibration matrix (targets x households x clones)
400400
- `in_cps_s5` -> `target_resolve` `data_flow`
401401
- `in_db_s5` -> `target_resolve` `external_source` (SQL targets)
402402
- `in_config_s5` -> `stage2_target_config_identity` `data_flow` (config file)
403-
- `stage2_target_config_identity` -> `stage2_target_catalog_load` `data_flow` (resolved path and checksum)
404-
- `stage2_target_catalog_load` -> `stage2_target_config_apply` `data_flow` (include/exclude rules)
403+
- `stage2_target_config_identity` -> `stage2_target_config_load` `data_flow` (resolved path and checksum)
404+
- `stage2_target_config_load` -> `stage2_target_config_apply` `data_flow` (include/exclude rules)
405405
- `target_resolve` -> `stage2_target_config_apply` `data_flow` (candidate targets)
406406
- `stage2_target_config_apply` -> `target_uprate` `data_flow` (selected targets)
407407
- `target_uprate` -> `geo_build` `data_flow`

docs/generated/pipeline_api.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,34 +3822,6 @@
38223822
"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",
38233823
"source_file": "policyengine_us_data/calibration/unified_calibration.py"
38243824
},
3825-
"stage2_target_catalog_load": {
3826-
"docstring": "Load target include/exclude config from YAML.\n\nArgs:\n path: Path to YAML config file.\n\nReturns:\n Parsed config dict with include and exclude lists.",
3827-
"id": "stage2_target_catalog_load",
3828-
"kind": "function",
3829-
"line": 525,
3830-
"metadata": {
3831-
"api_refs": [
3832-
"policyengine_us_data.calibration.unified_calibration.load_target_config"
3833-
],
3834-
"artifacts_in": "[DEFAULT_TARGET_CONFIG_RELATIVE_PATH]",
3835-
"description": "Load the include/exclude target-selection catalog used by Stage 2 package construction.",
3836-
"id": "stage2_target_catalog_load",
3837-
"label": "Load Stage 2 Target Config",
3838-
"node_type": "library",
3839-
"pathways": [
3840-
"calibration_package"
3841-
],
3842-
"source_file": "policyengine_us_data/calibration/unified_calibration.py",
3843-
"stability": "moving",
3844-
"status": "current",
3845-
"validation_commands": [
3846-
"uv run pytest tests/unit/calibration/test_target_config.py"
3847-
]
3848-
},
3849-
"object_path": "policyengine_us_data.calibration.unified_calibration.load_target_config",
3850-
"signature": "def load_target_config(path: str) -> dict",
3851-
"source_file": "policyengine_us_data/calibration/unified_calibration.py"
3852-
},
38533825
"stage2_target_config_apply": {
38543826
"docstring": "Filter target rows before matrix construction.",
38553827
"id": "stage2_target_config_apply",
@@ -3905,6 +3877,34 @@
39053877
"signature": "def resolve_target_config_identity(target_config_path: str | Path | None = None, *, all_active_targets: bool = False, repo_root: str | Path | None = None) -> TargetConfigIdentity",
39063878
"source_file": "policyengine_us_data/calibration_package/specs.py"
39073879
},
3880+
"stage2_target_config_load": {
3881+
"docstring": "Load target include/exclude config from YAML.\n\nArgs:\n path: Path to YAML config file.\n\nReturns:\n Parsed config dict with include and exclude lists.",
3882+
"id": "stage2_target_config_load",
3883+
"kind": "function",
3884+
"line": 525,
3885+
"metadata": {
3886+
"api_refs": [
3887+
"policyengine_us_data.calibration.unified_calibration.load_target_config"
3888+
],
3889+
"artifacts_in": "[DEFAULT_TARGET_CONFIG_RELATIVE_PATH]",
3890+
"description": "Load the YAML include/exclude target-selection config used by Stage 2 package construction.",
3891+
"id": "stage2_target_config_load",
3892+
"label": "Load Stage 2 Target Config",
3893+
"node_type": "library",
3894+
"pathways": [
3895+
"calibration_package"
3896+
],
3897+
"source_file": "policyengine_us_data/calibration/unified_calibration.py",
3898+
"stability": "moving",
3899+
"status": "current",
3900+
"validation_commands": [
3901+
"uv run pytest tests/unit/calibration/test_target_config.py"
3902+
]
3903+
},
3904+
"object_path": "policyengine_us_data.calibration.unified_calibration.load_target_config",
3905+
"signature": "def load_target_config(path: str) -> dict",
3906+
"source_file": "policyengine_us_data/calibration/unified_calibration.py"
3907+
},
39083908
"stage4_release_candidate_bundle_builder": {
39093909
"docstring": "Build a candidate bundle from a Stage 4 output contract shape.",
39103910
"id": "stage4_release_candidate_bundle_builder",

docs/generated/pipeline_map.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,12 +3831,12 @@
38313831
"edge_type": "data_flow",
38323832
"label": "resolved path and checksum",
38333833
"source": "stage2_target_config_identity",
3834-
"target": "stage2_target_catalog_load"
3834+
"target": "stage2_target_config_load"
38353835
},
38363836
{
38373837
"edge_type": "data_flow",
38383838
"label": "include/exclude rules",
3839-
"source": "stage2_target_catalog_load",
3839+
"source": "stage2_target_config_load",
38403840
"target": "stage2_target_config_apply"
38413841
},
38423842
{
@@ -3990,7 +3990,7 @@
39903990
"label": "run_calibration()",
39913991
"node_ids": [
39923992
"stage2_target_config_identity",
3993-
"stage2_target_catalog_load",
3993+
"stage2_target_config_load",
39943994
"target_resolve",
39953995
"stage2_target_config_apply",
39963996
"target_uprate",
@@ -4138,8 +4138,8 @@
41384138
"policyengine_us_data.calibration.unified_calibration.load_target_config"
41394139
],
41404140
"artifacts_in": "[DEFAULT_TARGET_CONFIG_RELATIVE_PATH]",
4141-
"description": "Load the include/exclude target-selection catalog used by Stage 2 package construction.",
4142-
"id": "stage2_target_catalog_load",
4141+
"description": "Load the YAML include/exclude target-selection config used by Stage 2 package construction.",
4142+
"id": "stage2_target_config_load",
41434143
"label": "Load Stage 2 Target Config",
41444144
"node_type": "library",
41454145
"pathways": [

docs/pipeline_map.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ stages:
806806
description: 'Build phase: resolve targets and constraints, assemble clone values, and package the sparse calibration matrix'
807807
node_ids:
808808
- stage2_target_config_identity
809-
- stage2_target_catalog_load
809+
- stage2_target_config_load
810810
- target_resolve
811811
- stage2_target_config_apply
812812
- target_uprate
@@ -902,10 +902,10 @@ stages:
902902
edge_type: data_flow
903903
label: config file
904904
- source: stage2_target_config_identity
905-
target: stage2_target_catalog_load
905+
target: stage2_target_config_load
906906
edge_type: data_flow
907907
label: resolved path and checksum
908-
- source: stage2_target_catalog_load
908+
- source: stage2_target_config_load
909909
target: stage2_target_config_apply
910910
edge_type: data_flow
911911
label: include/exclude rules

policyengine_us_data/calibration/unified_calibration.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,10 @@ def parse_args(argv=None):
508508

509509
@pipeline_node(
510510
PipelineNode(
511-
id="stage2_target_catalog_load",
511+
id="stage2_target_config_load",
512512
label="Load Stage 2 Target Config",
513513
node_type="library",
514-
description="Load the include/exclude target-selection catalog used by Stage 2 package construction.",
514+
description="Load the YAML include/exclude target-selection config used by Stage 2 package construction.",
515515
source_file="policyengine_us_data/calibration/unified_calibration.py",
516516
status="current",
517517
stability="moving",

0 commit comments

Comments
 (0)