Skip to content

Commit

Permalink
WIP, on hold for what to do with Interaction.functionalComponents in …
Browse files Browse the repository at this point in the history
…sbol2
  • Loading branch information
manulera committed Apr 11, 2024
1 parent 939ae02 commit 3a84717
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sbol_utilities/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import tyto
from sbol3_sbol2_conversion import SBOL2To3ConversionVisitor, SBOL3To2ConversionVisitor
from pprint import pprint

sbol2.property
sbol3.set_namespace('http://examples.org')

dummy_doc2 = sbol2.Document()
Expand Down
12 changes: 9 additions & 3 deletions sbol_utilities/sbol3_sbol2_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,15 @@ def visit_implementation(self, imp3: sbol3.Implementation):
# Map over all other TopLevel properties and extensions not covered by the constructor
self._convert_toplevel(imp3, imp2)

def visit_interaction(self, a: sbol3.Interaction):
# Priority: 2
raise NotImplementedError('Conversion of Interaction from SBOL3 to SBOL2 not yet implemented')
def visit_interaction(self, interaction3: sbol3.Interaction) -> sbol2.Interaction:
interaction2 = sbol2.Interaction(version=self._sbol2_version(interaction3), interaction_type=interaction3.types)
for p in interaction3.participations:
interaction2.participations.append(self.visit_participation(p))
for m in interaction3.measures:
interaction2.measurements.append(self.visit_measure(m))
self._convert_identified(interaction3, interaction2)

return interaction2

def visit_interface(self, a: sbol3.Interface):
# Priority: 3
Expand Down

0 comments on commit 3a84717

Please sign in to comment.