SynBioDex / pySBOL2

A pure Python implementation of the SBOL standard.
Apache License 2.0
20 stars 6 forks source link

Bug in ReferencedObject::__init__ #430

Open manulera opened 5 months ago

manulera commented 5 months ago

Hello, I think there is an error in ReferencedObject::__init__. I found it like this:

import sbol2

participation = sbol2.Participation('p', participant='p1')
print(sbol2.ReferencedObject(participation, 'aa','bb', '1', '1', [], 'aaa'))
print(participation.participant) #prints none

I think I found the error, posting a PR soon.

jakebeal commented 5 months ago

The patch committed was not working correctly. I am going undoing it and we can try again with a new patch that the GitHub actions actually run against

manulera commented 5 months ago

This is fixed now. This should be fixed with #436

I don't understand what is the use-case for the if statement. When is self._sbol_owner None, and why not assign the property in that case and add an empty list instead?

I noticed that there is other similar if statements in the file, maybe it would be good to review them.