Skip to content

Remove stale scratchpads, deduplicate internal helpers, and fix allele helper layering - #620

Merged
iskandr merged 1 commit into
masterfrom
cleanup/deps-scratchpads-and-internal-dedup
Nov 21, 2026
Merged

iskandr merged 1 commit into
masterfrom
cleanup/deps-scratchpads-and-internal-dedup

Conversation

@iskandr

@iskandr iskandr commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Delete 5 stale unreferenced planning scratchpads (notes/binding-aware-self-evidence.md, plans/mhctools-631-identity.md, tasks/{lessons,preserve-model-inputs,todo}.md).
  • Deduplicate _version_from_rows (result.py -> io.py), _allele (candidates.py & self_evidence.py -> alleles._canonical_allele_or_missing), and read_fasta / read_peptide_fasta (inputs.py).
  • Move derive_mhc_class out of io_pvacseq.py into alleles.py (re-exporting in io_pvacseq.py for backwards compatibility) and update imports in candidates.py, policy_evaluation.py, and __init__.py.
  • Route cli/cached_predictor.py allele normalization through topiary.alleles._normalize_allele_name_or_raw with exact parity for raw/unrecognized alleles.
  • Replace json.dumps(json.loads(json.dumps(value)), sort_keys=True) in io_protein_fragment.py with explicit key stringification (_stringify_json_keys) and add regression tests.

Verification

  • ./lint.sh (ruff check + mypy): All checks passed (Success: no issues found in 6 source files).
  • 1,131 passed across touched/public suites; 6,008 passed across non-external unit suite.

- Remove completed/unreferenced agent scratchpads under notes/, plans/, and tasks/.
- Deduplicate _version_from_rows between topiary/io.py and topiary/result.py.
- Consolidate optional allele canonicalization (_allele in candidates.py and self_evidence.py) via topiary.alleles._canonical_allele_or_missing.
- Deduplicate read_fasta and read_peptide_fasta in topiary/inputs.py via _read_fasta_mapping.
- Move derive_mhc_class (and _class_of_allele) from topiary/io_pvacseq.py to topiary/alleles.py, re-exporting in io_pvacseq.py for backwards compatibility and updating imports in candidates.py, policy_evaluation.py, and __init__.py.
- Route topiary/cli/cached_predictor.py allele normalization through topiary.alleles._normalize_allele_name_or_raw while preserving exact raw/unrecognized allele behavior.
- Replace the json.dumps/json.loads/json.dumps round-trip in topiary/io_protein_fragment.py with recursive key stringification preserving exact JSON key-encoding semantics.
- Keep weirdo in requirements.txt because TopiaryPredictor(models='weirdo') loads it at runtime via mhctools and commit 381dee4 + tests/check_distributions.py + CI intentionally require it as a runtime dependency.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.886% (+0.01%) from 93.875% — cleanup/deps-scratchpads-and-internal-dedup into master

@iskandr
iskandr merged commit f1eb7dc into master Nov 21, 2026
20 checks passed
@iskandr
iskandr deleted the cleanup/deps-scratchpads-and-internal-dedup branch November 21, 2026 13:51
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