Migrate synthesis-method registry to shared synthesis-methods package#8
Closed
micah-olivas wants to merge 1 commit into
Closed
Migrate synthesis-method registry to shared synthesis-methods package#8micah-olivas wants to merge 1 commit into
micah-olivas wants to merge 1 commit into
Conversation
The SynthesisMethod model, TOML loader, and the 8 method .toml definitions have moved to the standalone synthesis-methods package (shared with library_designer). usortm.costs.method_loader now re-exports the registry (METHODS_DIR, SynthesisMethod, load_method, load_all_methods, find_methods) from that package and keeps only cost computation (compute_cost and the four _compute_* helpers), which is uSort-M specific. No cost math or pricing numbers change. - pyproject: add synthesis-methods dependency; drop the now-unused tomli backport (TOML parsing now lives in the package) - delete vendored src/usortm/costs/methods/ (8 TOMLs + sources/) Back-compat: all existing usortm.costs.method_loader imports still resolve. Full test suite (140) passes; the cost fingerprint across every method and the `estimate --json` output are byte-identical pre/post migration.
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.
What
Migrates uSort-M off its own copy of the synthesis-method registry and onto the standalone
synthesis-methodspackage (private repomicah-olivas/synthesis-methods, also consumed bylibrary_designer), so method definitions live in one place. Cost computation stays in uSort-M. No cost math or pricing numbers change.Changes
src/usortm/costs/method_loader.py— now a thin shell that re-exports the registry (METHODS_DIR,SynthesisMethod,load_method,load_all_methods,find_methods) fromsynthesis_methods, and keepscompute_cost+ the four_compute_*helpers unchanged (uSort-M–specific).pyproject.toml— adds thesynthesis-methodsdependency; drops the now-unusedtomlibackport (TOML parsing lives in the package now).src/usortm/costs/methods/— the 8 method TOMLs +sources/(the package owns them; 559 deletions).Back-compat
Every existing
from usortm.costs.method_loader import …keeps working via the re-export — consumers (cost_functions.py,cli/plan.py,cli/estimate.py,docs/generate_cost_data.py,tests/test_method_loader.py) are untouched.Verification
load_all_methods()returns 8 methods.compute_costacross every method × a (count × length) grid — output byte-identical pre/post (sha256 match).pytest tests/test_method_loader.py→ 11 passed; full suite → 140 passed.estimate --json(library 500 × 300 bp, seeded sim) → byte-identical JSON pre/post.Dev setup
The package is private/unpublished, so install it editable alongside uSort-M:
Switch the
pyprojectentry to a git/index source oncesynthesis-methodsis public. Going forward, edit method TOMLs only in thesynthesis-methodsrepo.