Skip to content
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

custom annotation dropped after calling copy() on toplevel objects #191

Open
tramyn opened this issue Apr 22, 2021 · 1 comment
Open

custom annotation dropped after calling copy() on toplevel objects #191

tramyn opened this issue Apr 22, 2021 · 1 comment

Comments

@tramyn
Copy link

tramyn commented Apr 22, 2021

When I perform copy() on a Strateos ProtocolInterface, the custom annotations needed for specifying dotnames are dropped. Here is reproducible code:

sg = opil.StrateosOpilGenerator()
opil_doc = sg.parse_strateos_json(ip_constants.STRATEOS_NAMESPACE,
                                  protocol_name,
                                  protocol['id'],
                                  protocol['inputs'])

# dotname is present before copy
protocol_interfaces = [top_level for top_level in opil_doc.objects if isinstance(top_level, opil.ProtocolInterface)]
for parameter in protocol_interfaces[0].has_parameter:
   if parameter.dotname:
       print(parameter.dotname)

# dotname is dropped after copy
protocol_interface_copy = protocol_interfaces[0].copy()
for parameter in protocol_interface_copy.has_parameter:
   if parameter.dotname:
       print(parameter.dotname)
@bbartley
Copy link
Collaborator

I don't think the copy method is the culprit here. The following returns dotnames:

# dotname is present before copy
protocol_interfaces = [top_level for top_level in opil_doc.objects if isinstance(top_level, opil.ProtocolInterface)]
for parameter in protocol_interfaces[0].has_parameter:
   if parameter.dotname:
       print(parameter.dotname)

# dotname is dropped after copy
protocol_interface_copy = protocol_interfaces[0].copy()
for parameter in protocol_interface_copy.has_parameter:
   parameter.dotname = sbol3.TextProperty(parameter, 'http://strateos.com/dotname', 0, 1)
   if parameter.dotname:
       print(parameter.dotname)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants