[SPRINT-02-02] Split collection pulling from SBOL document indexing#101
[SPRINT-02-02] Split collection pulling from SBOL document indexing#101Gonza10V wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cabb91feb
ℹ️ 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".
| for strain in source_doc.moduleDefinitions: | ||
| self._index_strain_module(strain, implementation=None) | ||
|
|
||
| for definition in self.sbol_doc.componentDefinitions: |
There was a problem hiding this comment.
Index component definitions from the input document
index_sbol_document accepts an arbitrary SBOL document, but _index_document_objects iterates self.sbol_doc.componentDefinitions instead of source_doc.componentDefinitions. In the new local-indexing flow (where the passed doc is not already merged into self.sbol_doc), plasmid/backbone definitions in that document are skipped, and related implementations can later fail object resolution. This makes local document indexing silently incomplete unless callers do an extra manual merge step.
Useful? React with 👍 / 👎.
Motivation
sbol2.Documentobjects and easier to test and debug.Description
pull_collection_uris(self, uris: list[str]) -> sbol2.Documentto perform SynBioHubpulloperations and raise aRuntimeErrorwith URI context on fetch failure. (changed file:src/buildcompiler/buildcompiler.py).index_sbol_document(self, doc: sbol2.Document, source: str = "local")to perform SBOL scanning/classification without invokingsbh.pull, and changed_index_collectionsinto a compatibility wrapper that callspull_collection_uristhenindex_sbol_document. (changed file:src/buildcompiler/buildcompiler.py)._index_implementation,_index_strain_module,_index_plasmid_or_backbone_definition, and_index_reagent_implementationand updated_index_document_objectssignature to accept asourceparameter; preserved existing list-based runtime state (indexed_plasmids,indexed_backbones,restriction_enzyme_implementations,ligase_implementations). (changed file:src/buildcompiler/buildcompiler.py)._get_abstract_designby iteratingself.sbol_doc.componentDefinitions.tests/test_buildcompiler.py).Testing
pytest -k "index or collection or synbiohub"and observed all selected tests passed:16 passed, 107 deselected.ruff check src/buildcompiler/buildcompiler.py tests/test_buildcompiler.pyand the checks passed for the modified files.uv run python -m unittest discover -s tests, which failed in this environment due to an external git dependency fetch error forSBOLInventory(HTTP 403), so full test discovery could not complete here.sbh.pulland that pull failures surface with URI context while indexing failures remain distinct via the new unit tests (tests/test_buildcompiler.py).Codex Task