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

closes #430 #436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sbol2/property.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ def __init__(self, property_owner, type_uri, reference_type_uri,
super().__init__(property_owner, type_uri, lower_bound, upper_bound,
validation_rules, initial_value)
self.reference_type_uri = reference_type_uri
if self._sbol_owner is not None:
if self._sbol_owner is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this adjusted branch is ever taken, it will break on line 940, because it will attempt to assign to None.properties.

@tcmitchell : do you remember why we have this setting property_store to the empty list? It appears to be preventing initialization with init value from being done as expected in at least some cases.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not.

I think _sbol_owner is the pointer to the SBOL object that "owns" this object. It's possible this path was trying to mimic something in the C++ code.

I think if this change passes the new unit test, and this change does not fail any other unit tests, then it should be ok.

property_store = []
self._sbol_owner.properties[type_uri] = property_store

Expand Down
4 changes: 4 additions & 0 deletions test/test_participation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ def test_add_remove_role(self):
p.removeRole(1)
self.assertEqual([sbol2.SO_PROMOTER, sbol2.SO_CDS], p.roles)

def test_init_with_participant(self):
p = sbol2.Participation('p', participant='p1')
self.assertEqual('p1', p.participant)


if __name__ == '__main__':
unittest.main()
Loading