Implement transformation stage in BuildCompiler orchestrator#45
Implement transformation stage in BuildCompiler orchestrator#45Gonza10V wants to merge 1 commit intotransformationfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33e11a282c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| """ | ||
| plasmids = self._resolve_transformation_inputs(assembly_products, plasmid_inputs) | ||
|
|
||
| transformation_md = sbol2.ModuleDefinition(f"{chassis_name}_transformation") |
There was a problem hiding this comment.
Generate a unique transformation module ID per invocation
This module ID is derived only from chassis_name, so any second call to BuildCompiler.transformation(...) with the same chassis on the same sbol_doc will attempt to add the same ModuleDefinition identity again and fail due to duplicate SBOL identities. That blocks the documented multi-stage workflow where transformation is run more than once (e.g., after different assembly stages) unless callers manually change chassis_name each time.
Useful? React with 👍 / 👎.
| generated_impl = sbol2.Implementation(f"{plasmid_definition.displayId}_impl") | ||
| generated_impl.built = plasmid_definition.identity | ||
| self.sbol_doc.add(generated_impl) |
There was a problem hiding this comment.
Reuse existing plasmid implementations for direct inputs
For plasmid_inputs, this always creates and adds an Implementation named <displayId>_impl when the plasmid is not in indexed_plasmids, but it never checks whether that implementation already exists in self.sbol_doc. If the same direct input is processed again (or already has an implementation with that ID), the unconditional add causes a duplicate-identity failure and aborts transformation.
Useful? React with 👍 / 👎.
Summary
BuildCompiler.transformation(...)with a clear structured input contractPlasmidobjects or plasmidComponentDefinitioninputs_resolve_transformation_inputsand_build_transformation_protocol_bundleBuildCompilerinbuildcompiler.__init__Testing
ruff check src/buildcompiler/buildcompiler.py src/buildcompiler/__init__.py tests/test_buildcompiler_transformation.py✅python -m unittest tests/test_buildcompiler_transformation.pysbol2uv run python -m unittest tests/test_buildcompiler_transformation.pypydna/PyPI)Notes
transformation) only.plating) and Phase 3 (full_build) remain to be implemented in follow-up PRs.Codex Task