diff --git a/CHANGES.md b/CHANGES.md index 661aba44b65cb3f8f0030c408cacd8ecf695725c..35914acdc6549ef40f002e1aab68e0fcb405b360 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,9 @@ ## 1.2.1 (unrelased) +- Fix bug where pipelines didn't appear yet in pipeline preferred events, + causing the circulars to miss pipelines or fail. + - Fix example of medium-latency PyGRB exclusion. - Update PyCBC citation. diff --git a/ligo/followup_advocate/__init__.py b/ligo/followup_advocate/__init__.py index aeb3590c30b9d8f6ce7dbceae24944dc5bb111dc..e59c1e6790b2d0ed6f052a91ecca6b74eae6e956 100644 --- a/ligo/followup_advocate/__init__.py +++ b/ligo/followup_advocate/__init__.py @@ -43,8 +43,13 @@ def main_dict(gracedb_id, client): event = client.superevent(gracedb_id).json() preferred_event = event['preferred_event_data'] preferred_pipeline = preferred_event['pipeline'] - other_pipelines = list(event["pipeline_preferred_events"].keys()) - other_pipelines.remove(preferred_pipeline) + other_pipelines = [] + gw_events = event['gw_events'] + + for gw_event in gw_events: + pipeline = client.event(gw_event).json()['pipeline'] + if pipeline not in other_pipelines and pipeline != preferred_pipeline: + other_pipelines.append(pipeline) voevents = client.voevents(gracedb_id).json()['voevents'] if not voevents: