Skip to content

Restore test collection and lint cleanliness after the Task B merge - #87

Merged
duckyquang merged 1 commit into
mainfrom
fix/valvular-test-collection
Sep 10, 2026
Merged

Restore test collection and lint cleanliness after the Task B merge#87
duckyquang merged 1 commit into
mainfrom
fix/valvular-test-collection

Conversation

@duckyquang

Copy link
Copy Markdown
Member

Summary

Main stopped collecting tests for anyone without medspacy — tests/test_valvular_probes.py imports scripts/extract_valvular_labels.py at module scope, which imports medspacy and builds the full NER pipeline on import, and neither medspacy nor the extraction stack is a declared dependency. The import is now guarded, so only the one NER test (test_clinical_ner_extraction_negation_and_severity) skips when medspacy is missing; the other valvular tests keep running everywhere.

While in there I cleared the lint debt the Task B merge left on main: 55 ruff errors and 10 unformatted files, which means make lint / pre-commit was red for everyone. Mechanics: ruff check --fix + ruff format across the valvular files, # noqa: E402 on the deliberately-late imports (they sit after load_dotenv()/logging setup on purpose), and two unused local assignments removed (y_dict_va, confidence_dist — pure computations, no side effects).

Result

132 passed, 1 skipped (the NER test, on my machine without medspacy); ruff check and ruff format --check both fully clean. Real run on my Mac with the repo venv.

Notes

  • @turkalpmd the reformat touches your Task B files — it's the repo's own ruff config doing the work, and the only behavioral edits are the two dead assignments. Can you confirm the NER test still runs green on your medspacy setup? I can't exercise that path locally.
  • medspacy / the BigQuery client stack stay undeclared — maybe worth a task-b optional-dependencies group in pyproject.toml as a follow-up, so the skip behavior is documented rather than accidental.

tests/test_valvular_probes.py imported scripts/extract_valvular_labels.py at
module scope, which imports medspacy and builds the full NER pipeline —
neither medspacy nor the extraction stack is a declared dependency, so
pytest could not collect the suite on a machine without them. The import
is now guarded and only the one NER test skips when medspacy is absent.

Also clears the 55 ruff errors and 10 unformatted files the Task B PRs
left on main: ruff --fix + format across the valvular files, noqa on the
deliberately late imports, and removal of two unused local assignments.
132 passed, 1 skipped; ruff check and format --check both clean.

@sebasmos sebasmos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the diff and verified both behavioral claims against the code: the import guard and skip are scoped to exactly one test, the two removed assignments are confirmed dead code. Real run: 132 passed, 1 skipped, ruff clean. APPROVE.

@duckyquang
duckyquang merged commit adb2ee3 into main Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants