-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
If you try to share the same object across multiple Documents, you can get into trouble. I stumbled upon this problem because I was trying to re-use an Agent object (representing a lab robot) in multiple Documents. How should pysbol3 handle this scenario?
a = sbol3.Agent('lab_robot')
doc1 = sbol3.Document()
doc2 = sbol3.Document()
doc1.add(a)
doc2.add(a)
The object now appears to be registered in both Documents:
>>> a in doc1.objects
True
>>> a in doc2.objects
True
That seems OK. However, the back-pointer to the parent doc is a problem:
>>> a.document == doc1
False
>>> a.document == doc2
True
How should pysbol3 behave? Should it throw an error/warning? Should it attempt to add a duplicate copy of the object instead?
Metadata
Metadata
Assignees
Labels
No labels