-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Functions for Validating Composite Part Assemblies Plus Tests #117
base: develop
Are you sure you want to change the base?
Conversation
…wo helper functions to component.by for retrieving subcomponents.
sbol_utilities/build_planning.py
Outdated
|
||
i = i + 1 | ||
|
||
return has_insert and has_backbone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be done more efficiently by applying any
to a generator.
@@ -8,6 +8,14 @@ | |||
from sbol_utilities.workarounds import get_parent | |||
|
|||
|
|||
def get_subcomponents(c: sbol3.Component) -> List[sbol3.SubComponent]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing docstrings
class TestBuildPlanning(unittest.TestCase): | ||
|
||
def test_validate_composite_part_assemblies(self): | ||
test_doc = sbol3.Document() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing docstrings
|
||
sbol3.set_namespace('http://testBuildPlanning.org') | ||
|
||
assert validate_composite_part_assemblies(assemble_BBa_K093005(test_doc)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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