fix a bug preventing EM_READY being applied
The lines in _update_superevent
if 'preferred_event' in kwargs and is_complete(new_event_dict):
gracedb.create_label('EM_READY', superevent_id)
is not the correct logic since a preferred event may exists, but it maybe incomplete. A label applied later might make it complete.
The correct logic is
if is_complete(new_event_dict):
gracedb.create_label('EM_READY', superevent_id)
This is because new_event_dictionary completeness is necessary and sufficient to conclude that the preferred event is complete.
- Either the new event has become the preferred event
- Or the existing preferred event is already a more significant complete event. In this case
EM_READY
would already have been applied.
The unittests now capture the different possible scenarios.
Edited by Leo P. Singer