Skip to content

Commit 89ba786

Browse files
donboyd5claude
andcommitted
Add CD fingerprint, fix quality report usage, consistent test naming
- Add cds_fingerprint.json (436 CDs, 107 targets, 55 areas with violations, 69 violated targets, max 0.50%) - Fix quality_report.py usage docstring to show --scope states - Rename test classes to TestStatesFingerprint/TestCdsFingerprint so pytest -k states and pytest -k cds work consistently Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 54f6d6e commit 89ba786

4 files changed

Lines changed: 452 additions & 10 deletions

File tree

tests/test_fingerprint.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def _run_detail_test(scope, areas, weight_dir, update):
216216
not _has_weight_files(STATE_WEIGHT_DIR, ALL_STATES),
217217
reason="No state weight files — run solve_weights first",
218218
)
219-
class TestStateFingerprint:
219+
class TestStatesFingerprint:
220220
"""Fingerprint tests for state weights."""
221221

222222
# pylint: disable=redefined-outer-name
@@ -240,14 +240,14 @@ def test_state_per_area_sums_match(self, update_mode):
240240
not _has_weight_files(CD_WEIGHT_DIR, _CD_AREAS),
241241
reason="No CD weight files — run solve_weights --scope cds first",
242242
)
243-
class TestCDFingerprint:
243+
class TestCdsFingerprint:
244244
"""Fingerprint tests for congressional district weights."""
245245

246246
# pylint: disable=redefined-outer-name
247-
def test_cd_weights_match_reference(self, update_mode):
247+
def test_cds_weights_match_reference(self, update_mode):
248248
"""Compare weight integer sums against saved reference."""
249249
_run_fingerprint_test("cds", _CD_AREAS, CD_WEIGHT_DIR, update_mode)
250250

251-
def test_cd_per_area_sums_match(self, update_mode):
251+
def test_cds_per_area_sums_match(self, update_mode):
252252
"""Identify which CDs changed."""
253253
_run_detail_test("cds", _CD_AREAS, CD_WEIGHT_DIR, update_mode)

tmd/areas/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# Override worker count: make -C tmd/areas cds WORKERS=16
1212

1313
WORKERS ?= 8
14+
ROOT := $(realpath $(CURDIR)/../..)
1415

1516
# --- State pipeline ---
1617

@@ -26,8 +27,8 @@ state-weights: state-targets
2627
python -m tmd.areas.solve_weights --scope states --workers $(WORKERS)
2728

2829
states: state-weights
29-
python -m pytest tests/test_prepare_targets.py -v -k "not CD"
30-
python -m pytest tests/test_state_weight_results.py -v
30+
python -m pytest $(ROOT)/tests/test_prepare_targets.py -v -k "not CD"
31+
python -m pytest $(ROOT)/tests/test_state_weight_results.py -v
3132
python -m tmd.areas.quality_report --scope states
3233

3334
# --- Congressional district pipeline ---
@@ -44,5 +45,5 @@ cd-weights: cd-targets
4445
python -m tmd.areas.solve_weights --scope cds --workers $(WORKERS)
4546

4647
cds: cd-weights
47-
python -m pytest tests/test_prepare_targets.py -v -k CD
48+
python -m pytest $(ROOT)/tests/test_prepare_targets.py -v -k CD
4849
python -m tmd.areas.quality_report --scope cds

0 commit comments

Comments
 (0)