Config layer: Pydantic settings, default YAML, reference assets#1
Open
cropsgg wants to merge 2 commits into
Open
Config layer: Pydantic settings, default YAML, reference assets#1cropsgg wants to merge 2 commits into
cropsgg wants to merge 2 commits into
Conversation
This was referenced Apr 15, 2026
Owner
Author
Stacked PRs (merge order)\n\nThis PR is the base of a four-part stack. After it lands on
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a typed configuration layer (
Pydantic+ YAML) and bundled reference assets so the project can move from hard-coded HBB strings toward a gene-agnostic, reproducible setup.What changed
config/default.yaml— Single source of truth: gene/refseq, reference FASTA path, ClinVar query and parsing-related flags, synthetic variant templates, Bloom/DNABERT/BGPCA/training hyperparameters, cache paths, Gradio defaults.bloom_dnabert/settings.py—AppSettingsmodels,load_settings(), path resolution from the repo root, optionalBLOOM_CONFIGenv override, settings fingerprint helper for cache invalidation.bloom_dnabert/reference.py— FASTA loading and optional SHA-256 verification.bloom_dnabert/codon.py— Loads codon table from JSON or override path in settings.bloom_dnabert/data/— Reference transcript FASTA, pathogenic k-mer seeds, codon table JSON.Why this PR exists
Downstream work (data loader, training, UI) needs stable contracts for gene symbol, transcript accession, reference sequence, and training knobs. Centralizing them avoids scattering magic numbers and makes swapping targets a config change instead of a refactor.
Reviewer notes
requirements.txtonly addspydanticandPyYAMLhere sosettingsis installable when this branch is checked out alone.How to verify
python -c "from bloom_dnabert.settings import load_settings; from pathlib import Path; s=load_settings(Path('config/default.yaml')); print(s.gene.symbol, s.reference.fasta_path)"