Skip to content

Commit 1d366a4

Browse files
authored
Merge pull request #517 from PSLmodels/cleanup-area-deadwood
Cleanup area deadwood
2 parents 5dbe40f + 1f19b50 commit 1d366a4

20 files changed

Lines changed: 23 additions & 4299 deletions

tmd/areas/AREA_WEIGHTING_GUIDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ tmd/areas/
624624
├── developer_tools.py # Difficulty / dual / relaxation cascade
625625
├── quality_report.py # Multi- and single-area quality reports
626626
├── sweep_params.py # Solver parameter grid search
627-
├── make_all.py # End-to-end driver used in CI
628627
├── targets/ # Per-area target CSVs (output)
629628
│ ├── states/
630629
│ ├── cds_118/

tmd/areas/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ tmd/areas/
184184
├── batch_weights.py parallel-runner support
185185
├── solver_overrides.py read per-area override YAML
186186
├── sweep_params.py parameter grid-search utility
187-
├── make_all.py end-to-end driver used in CI
188187
├── prepare/ shares + targets building blocks
189188
│ ├── data/ SOI inputs and CD crosswalks
190189
│ ├── recipes/ target specs

tmd/areas/batch_weights.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,25 @@ def _list_target_areas(target_dir=None):
310310
return areas
311311

312312

313+
def _time_of_newest_other_dependency():
314+
"""
315+
Return mtime of the newest non-target dependency that should
316+
invalidate cached area-weight files.
317+
"""
318+
from tmd.areas import AREAS_FOLDER
319+
from tmd.storage import STORAGE_FOLDER
320+
from tmd.imputation_assumptions import POPULATION_FILE
321+
322+
deps = [
323+
AREAS_FOLDER / "create_area_weights.py",
324+
STORAGE_FOLDER / "output" / "tmd.csv.gz",
325+
STORAGE_FOLDER / "output" / "tmd_weights.csv.gz",
326+
STORAGE_FOLDER / "output" / "tmd_growfactors.csv",
327+
STORAGE_FOLDER / "input" / POPULATION_FILE,
328+
]
329+
return max(dpath.stat().st_mtime for dpath in deps)
330+
331+
313332
def _filter_areas(areas, area_filter):
314333
"""Filter areas by type: 'states', 'cds', or 'all'."""
315334
if area_filter == "all":
@@ -366,9 +385,7 @@ def run_batch(
366385

367386
# Filter to out-of-date areas unless force=True
368387
if not force:
369-
from tmd.areas.make_all import time_of_newest_other_dependency
370-
371-
newest_dep = time_of_newest_other_dependency()
388+
newest_dep = _time_of_newest_other_dependency()
372389
todo = []
373390
for area in areas:
374391
wpath = weight_dir / f"{area}_tmd_weights.csv.gz"

tmd/areas/create_area_weights.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
2727
This module is a library, not a CLI. It is called by
2828
``tmd.areas.solve_weights`` (parallel batch solver, the production
29-
entry point), ``tmd.areas.developer_tools`` (relaxation cascade),
30-
and ``tmd.areas.make_all`` (CI driver). Key public entry points:
29+
entry point) and ``tmd.areas.developer_tools`` (relaxation cascade).
30+
Key public entry points:
3131
3232
create_area_weights_file(area, ...) — solve one area, write
3333
``<area>_tmd_weights.csv.gz``

tmd/areas/make_all.py

Lines changed: 0 additions & 128 deletions
This file was deleted.

tmd/areas/prepare/constants.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,21 +106,13 @@ def build_agi_labels(area_type: AreaType) -> pd.DataFrame:
106106

107107
# --- SOI file naming patterns ---
108108

109-
# State SOI CSV files by year (2-digit year substituted into pattern)
109+
# State SOI CSV files by year
110110
SOI_STATE_CSV_PATTERNS: Dict[int, str] = {
111-
2015: "15in54cmcsv.csv",
112-
2016: "16in54cmcsv.csv",
113-
2017: "17in54cmcsv.csv",
114-
2018: "18in55cmagi.csv",
115-
2019: "19in55cmcsv.csv",
116-
2020: "20in55cmcsv.csv",
117-
2021: "21in55cmcsv.csv",
118111
2022: "22in55cmcsv.csv",
119112
}
120113

121114
# CD SOI CSV files by year
122115
SOI_CD_CSV_PATTERNS: Dict[int, str] = {
123-
2021: "21incd.csv",
124116
2022: "22incd.csv",
125117
}
126118

tmd/areas/targets/prepare/prepare_cds/data/data_raw/21incddocguide.docx renamed to tmd/areas/prepare/data/soi_cds/21incddocguide.docx

File renamed without changes.

tmd/areas/targets/prepare/prepare_cds/data/data_raw/22incddocguide.docx renamed to tmd/areas/prepare/data/soi_cds/22incddocguide.docx

File renamed without changes.

tmd/areas/targets/prepare/README.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)