Skip to content

refactor(snomed): re-export from biodb.snomed instead of in-tree impl - #6

Merged
bschilder merged 1 commit into
mainfrom
refactor/snomed-via-biodb
May 18, 2026
Merged

refactor(snomed): re-export from biodb.snomed instead of in-tree impl#6
bschilder merged 1 commit into
mainfrom
refactor/snomed-via-biodb

Conversation

@bschilder

Copy link
Copy Markdown
Owner

Summary

The SNOMED downloader + its GitHub Release asset moved into bioDB on 2026-05-18 (bioDB PR #15). This PR makes synthlab consume it from there.

Changes

  • synthlab/download_snomed.py: 379 lines of in-tree download / auth / decompress / gzip logic → 76-line back-compat shim that re-exports the public names from biodb.snomed. Every existing from synthlab.download_snomed import ... keeps working.
  • pyproject.toml: add biodb @ git+https://github.com/bschilder/bioDB as a dep.

Net effect

  • -304 lines of duplicated logic.
  • Behaviour preserved: the 3-strategy auth flow (gh CLI → token → public), gzip decompression, cache short-circuit, force-redownload all live in bioDB now.
  • Bonus: bioDB's tqdm progress bar shows up during the ~29 MB download (synthlab's version was silent).
  • The url= kwarg on download_snomed_vocabulary is preserved but now ignored (with a DeprecationWarning pointing callers at GITHUB_TOKEN for private mirrors against the bioDB release URL).

Asset relocation note

The GitHub Release asset itself was physically moved: same vocab-v1 tag, same CONCEPT.csv.gz filename, identical SHA-256 (ce9029c84f1f5a5e300353f2833a4735f40bdf57e64262d46f4d4bfe274a04b7). New canonical URL:

https://github.com/bschilder/bioDB/releases/download/vocab-v1/CONCEPT.csv.gz

The bschilder/synthlab vocab-v1 release will be deleted as a follow-up step (per the original move plan) once this PR merges and the new flow is confirmed working.

Test plan

  • Import shim works: from synthlab.download_snomed import download_snomed_vocabulary, get_concept_csv_path, is_snomed_available round-trips.
  • download_snomed_vocabulary(url=...) with a non-default URL emits DeprecationWarning.
  • CI green (synthlab's existing test suite — no SNOMED-specific tests on this side; bioDB's tests/test_snomed.py provides full coverage).

🤖 Generated with Claude Code

The SNOMED downloader (and the GitHub Release asset it pulls) moved
into bioDB on 2026-05-18. This commit:

* Replaces synthlab/download_snomed.py with a thin re-export shim. All
  existing imports ``from synthlab.download_snomed import ...`` keep
  working; the actual implementation lives in biodb.snomed.
* Adds ``biodb`` as a dep in pyproject.toml.

The release URL hard-coded in the old code (synthlab/vocab-v1) is
replaced by biodb's. If callers were passing ``url=`` to override for
a private mirror, the wrapper raises a DeprecationWarning and tells
them to set GITHUB_TOKEN instead — bioDB's token-auth path against the
same release tag is the supported escape hatch now.

Net diff: -304 lines of duplicated download/auth/decompress logic,
+76 lines of compat shim. Downstream behaviour unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bschilder
bschilder merged commit 2dde865 into main May 18, 2026
1 check passed
@bschilder
bschilder deleted the refactor/snomed-via-biodb branch May 18, 2026 18:50
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.

1 participant