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

Append existing subcomponent to Component.features #297

Open
djross22 opened this issue Aug 29, 2021 · 1 comment
Open

Append existing subcomponent to Component.features #297

djross22 opened this issue Aug 29, 2021 · 1 comment
Milestone

Comments

@djross22
Copy link
Collaborator

If you try to append the same subcomponent to a component's features attribute, it throws an error (which I think it should) - but it also adds the subcomponent to the features list anyway.

Example code:

>>> ptet = sbol3.Component('pTetR', sbol3.SBO_DNA)
>>> circuit = sbol3.Component('circuit', sbol3.SBO_DNA)
>>> ptet_sc = sbol3.SubComponent(ptet)

>>> circuit.features += [ptet_sc]
>>> circuit.features += [ptet_sc]
throws an error, but circuit.features still has two copies of ptet_sc:
>>> circuit.features
[<sbol3.subcomponent.SubComponent object at 0x0000027E36E6F220>, <sbol3.subcomponent.SubComponent object at 0x0000027E36E6F220>]
@tcmitchell tcmitchell added this to the beta milestone Aug 31, 2021
@tcmitchell
Copy link
Collaborator

It sounds like whatever condition is causing the error needs to be checked prior to adding the child object. Thanks for reporting this bug.

@jakebeal jakebeal modified the milestones: beta, 1.1 Feb 8, 2022
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

3 participants