Functions for Validating Composite Part Assemblies Plus Tests#117
Open
nroehner wants to merge 6 commits intoSynBioDex:developfrom
Open
Functions for Validating Composite Part Assemblies Plus Tests#117nroehner wants to merge 6 commits intoSynBioDex:developfrom
nroehner wants to merge 6 commits intoSynBioDex:developfrom
Conversation
…wo helper functions to component.by for retrieving subcomponents.
jakebeal
requested changes
Feb 23, 2022
sbol_utilities/build_planning.py
Outdated
|
|
||
| i = i + 1 | ||
|
|
||
| return has_insert and has_backbone |
Contributor
There was a problem hiding this comment.
Should also check location/constraints.
|
|
||
| invalid_assemblies = [a for a in activities if is_assembly(a) and not validate_assembly(a, c)] | ||
|
|
||
| return len(invalid_assemblies) == 0 |
Contributor
There was a problem hiding this comment.
This can be done more efficiently by applying any to a generator.
| from sbol_utilities.workarounds import get_parent | ||
|
|
||
|
|
||
| def get_subcomponents(c: sbol3.Component) -> List[sbol3.SubComponent]: |
| class TestBuildPlanning(unittest.TestCase): | ||
|
|
||
| def test_validate_composite_part_assemblies(self): | ||
| test_doc = sbol3.Document() |
|
|
||
| sbol3.set_namespace('http://testBuildPlanning.org') | ||
|
|
||
| assert validate_composite_part_assemblies(assemble_BBa_K093005(test_doc)) |
Contributor
There was a problem hiding this comment.
explain why these should or shouldn't work in comments
| assert not validate_composite_part_assemblies(assemble_BBa_K093005(test_doc, 'EXTRA_ASSEMBLY_COMPONENT')) | ||
|
|
||
| def assemble_BBa_K093005(doc: sbol3.Document, failure_mode: Optional[str] = ''): | ||
| doc = sbol3.Document() |
Contributor
There was a problem hiding this comment.
same as above; need comments to explain your testing
…plan. Also modified part in backbone validation to use is_plasmid helper function and check if component contains a single insert and a single backbone.
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.
Primary function validate_composite_part_assemblies returns true if the input composite part was generated only by assemblies that are valid according to SEP 055. This is a partial implementation of the best practices in SEP 055 and partially resolves #73