Parent sprint: #87
Depends on: #88, #89, #90, #91
Recommended order: 5
Codex-ready: yes
Goal
Make buildcompiler.plasmid.Plasmid the single runtime wrapper for indexed plasmids/backbones and remove or deprecate the duplicate Plasmid class in abstract_translator.py.
Background
The current codebase has at least two Plasmid concepts:
src/buildcompiler/plasmid.py defines Plasmid with plasmid_definition, strain/plasmid implementations, fusion sites, name, and antibiotic resistance.
src/buildcompiler/abstract_translator.py also defines a Plasmid wrapper with a different constructor and fields.
This increases the risk that indexing, compatibility matching, assembly, and transformation disagree on object shape, fusion-site ordering, antibiotic detection, or equality semantics.
Scope
- Choose
buildcompiler.plasmid.Plasmid as the canonical runtime wrapper.
- Update
abstract_translator.py helpers to import and use the canonical Plasmid, or rename the old helper class to avoid runtime confusion if it cannot yet be removed.
- Add tests for canonical Plasmid construction from fixture SBOL objects.
- Add tests for fusion-site extraction, antibiotic resistance extraction, equality, hashing, and repr/debug output.
- Ensure assembly code still accepts the canonical
Plasmid object.
Non-goals
- Do not redesign the entire inventory system.
- Do not change SBOL biological semantics unless current tests prove the old behavior was wrong.
- Do not rewrite Assembly internals in this issue.
Acceptance criteria
Verification
Run:
pytest -k "plasmid or fusion or antibiotic or assembly"
ruff check .
Codex implementation notes
- Keep this as a mechanical consolidation PR where possible.
- If old code paths are unused, remove them with tests proving the active path still works.
- If old code paths are still used, update them incrementally rather than making a giant rewrite.
- Prefer identities/display IDs in assertions rather than raw object equality where SBOL object identity is unstable.
Parent sprint: #87
Depends on: #88, #89, #90, #91
Recommended order: 5
Codex-ready: yes
Goal
Make
buildcompiler.plasmid.Plasmidthe single runtime wrapper for indexed plasmids/backbones and remove or deprecate the duplicatePlasmidclass inabstract_translator.py.Background
The current codebase has at least two Plasmid concepts:
src/buildcompiler/plasmid.pydefinesPlasmidwithplasmid_definition, strain/plasmid implementations, fusion sites, name, and antibiotic resistance.src/buildcompiler/abstract_translator.pyalso defines aPlasmidwrapper with a different constructor and fields.This increases the risk that indexing, compatibility matching, assembly, and transformation disagree on object shape, fusion-site ordering, antibiotic detection, or equality semantics.
Scope
buildcompiler.plasmid.Plasmidas the canonical runtime wrapper.abstract_translator.pyhelpers to import and use the canonicalPlasmid, or rename the old helper class to avoid runtime confusion if it cannot yet be removed.Plasmidobject.Non-goals
Acceptance criteria
abstract_translator.pyno longer defines a conflicting runtimePlasmidclass, or it is clearly renamed/private and not used by active runtime paths.Verification
Run:
Codex implementation notes