From 336c372050c30c8e1872de7f014221b71f176192 Mon Sep 17 00:00:00 2001 From: Tanner Prestegard <tanner.prestegard@ligo.org> Date: Tue, 18 Sep 2018 08:40:35 -0500 Subject: [PATCH] Renaming LIB and gstlal-spiir pipelines Renaming LIB -> oLIB and gstlal-spiir -> spiir, at the request of the pipelines. --- config/settings/base.py | 4 +- docs/admin_docs/source/new_event_subclass.rst | 8 ++-- docs/admin_docs/source/new_pipeline.rst | 4 +- docs/user_docs/source/models.rst | 2 +- .../migrations/0017_rename_pipelines.py | 46 +++++++++++++++++++ gracedb/events/translator.py | 4 +- gracedb/events/view_logic.py | 4 +- gracedb/events/views.py | 4 +- gracedb/templates/feeds/index.html | 4 +- ...detail_LIB.html => event_detail_oLIB.html} | 0 gracedb/templates/gracedb/index.html | 4 +- 11 files changed, 65 insertions(+), 19 deletions(-) create mode 100644 gracedb/events/migrations/0017_rename_pipelines.py rename gracedb/templates/gracedb/{event_detail_LIB.html => event_detail_oLIB.html} (100%) diff --git a/config/settings/base.py b/config/settings/base.py index 897c2852d..d2af7d8a7 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -139,7 +139,7 @@ BLESSED_TAGS = [ # Lists of pipelines used for selecting templates to serve COINC_PIPELINES = [ 'gstlal', - 'gstlal-spiir', + 'spiir', 'MBTAOnline', 'pycbc', ] @@ -177,7 +177,7 @@ REPORT_INFO_URL_PREFIX = "/report_info/" REPORT_IFAR_IMAGE_DIR = GRACEDB_PATHS["latency"] # Stuff for the new rates plot -BINNED_COUNT_PIPELINES = ['gstlal', 'MBTAOnline', 'CWB', 'LIB', 'gstlal-spiir'] +BINNED_COUNT_PIPELINES = ['gstlal', 'MBTAOnline', 'CWB', 'oLIB', 'spiir'] BINNED_COUNT_FILE = join(GRACEDB_PATHS["data"], "binned_counts.json") # Defaults for RSS feed diff --git a/docs/admin_docs/source/new_event_subclass.rst b/docs/admin_docs/source/new_event_subclass.rst index 4cc59beb8..b4d7e6900 100644 --- a/docs/admin_docs/source/new_event_subclass.rst +++ b/docs/admin_docs/source/new_event_subclass.rst @@ -91,7 +91,7 @@ statement here that creates a new event object instance according to the pipeline. We'll need to add our new one:: # Create Event - if pipeline.name in ['gstlal', 'gstlal-spiir', 'MBTAOnline', 'pycbc',]: + if pipeline.name in ['gstlal', 'spiir', 'MBTAOnline', 'pycbc',]: event = CoincInspiralEvent() elif pipeline.name in ['Fermi', 'Swift', 'SNEWS']: event = GrbEvent() @@ -99,7 +99,7 @@ pipeline. We'll need to add our new one:: event = MultiBurstEvent() elif pipeline.name in ['HardwareInjection',]: event = SimInspiralEvent() - elif pipeline.name in ['LIB',]: + elif pipeline.name in ['oLIB',]: event = LalInferenceBurstEvent() ### BEHOLD, a new case: elif pipeline.name in ['newpipeline',]: @@ -171,8 +171,8 @@ we'll need to add something to the control structure that chooses the template:: templates.insert(0, 'gracedb/event_detail_CWB.html') elif event.pipeline.name in ['HardwareInjection',]: templates.insert(0, 'gracedb/event_detail_injection.html') - elif event.pipeline.name in ['LIB',]: - templates.insert(0, 'gracedb/event_detail_LIB.html') + elif event.pipeline.name in ['oLIB',]: + templates.insert(0, 'gracedb/event_detail_oLIB.html') elif event.pipeline.name in ['newpipeline',]: templates.insert(0, 'gracedb/event_detail_newpipeline.html') diff --git a/docs/admin_docs/source/new_pipeline.rst b/docs/admin_docs/source/new_pipeline.rst index 2d39b7683..d74caeebd 100644 --- a/docs/admin_docs/source/new_pipeline.rst +++ b/docs/admin_docs/source/new_pipeline.rst @@ -11,9 +11,9 @@ the pipeline object itself is the easy part. The hard part is figuring out what kind of data file the group will be uploading, and how to ingest the values. The directions below will focus on the easiest possible case--in which the new pipeline's data files have the same format and information as those -of an existing pipeline. (For example, the ``gstlal-spiir`` group uploads +of an existing pipeline. (For example, the `spiir`` group uploads the same type of data file as the ``gstlal`` group, and this made adding the -``gstlal-spiir`` pipeline relatively easy.) +``spiir`` pipeline relatively easy.) Adding a new ``Search`` is simpler, but the steps relating to LVAlert are similar. .. NOTE:: diff --git a/docs/user_docs/source/models.rst b/docs/user_docs/source/models.rst index 61ed2e30e..0c2c48bdf 100644 --- a/docs/user_docs/source/models.rst +++ b/docs/user_docs/source/models.rst @@ -10,7 +10,7 @@ The different types of events in GraceDB are distinguished by the following para - ``Group``: the working group responsible for finding the candidate - values: ``CBC``, ``Burst``, ``External``, ``Test`` - ``Pipeline``: the data analysis software tool used make the detection - - values: ``MBTAOnline``, ``CWB``, ``gstlal``, ``gstlal-spiir``, ``HardwareInjection``, ``Fermi``, ``Swift``, ``SNEWS``, ``LIB`` + - values: ``MBTAOnline``, ``CWB``, ``gstlal``, ``spiir``, ``HardwareInjection``, ``Fermi``, ``Swift``, ``SNEWS``, ``oLIB`` - ``Search``: the search activity which led to the detection - values: ``AllSky``, ``AllSkyLong``, ``LowMass``, ``HighMass``, ``GRB``, ``Supernova``, ``MDC`` diff --git a/gracedb/events/migrations/0017_rename_pipelines.py b/gracedb/events/migrations/0017_rename_pipelines.py new file mode 100644 index 000000000..0592f30a9 --- /dev/null +++ b/gracedb/events/migrations/0017_rename_pipelines.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.14 on 2018-09-17 19:46 +from __future__ import unicode_literals + +from django.db import migrations + +PIPELINES = [ + { + 'old_name': 'LIB', + 'new_name': 'oLIB', + }, + { + 'old_name': 'gstlal-spiir', + 'new_name': 'spiir', + }, +] + +def rename_pipelines(apps, schema_editor): + Pipeline = apps.get_model('events', 'Pipeline') + + # Rename pipelines + for p in PIPELINES: + pipeline = Pipeline.objects.get(name=p['old_name']) + pipeline.name = p['new_name'] + pipeline.save(update_fields=['name']) + + +def unrename_pipelines(apps, schema_editor): + Pipeline = apps.get_model('events', 'Pipeline') + + # Rename pipelines + for p in PIPELINES: + pipeline = Pipeline.objects.get(name=p['new_name']) + pipeline.name = p['old_name'] + pipeline.save(update_fields=['name']) + + +class Migration(migrations.Migration): + + dependencies = [ + ('events', '0016_delete_old_tag_event_logs_table'), + ] + + operations = [ + migrations.RunPython(rename_pipelines, unrename_pipelines), + ] diff --git a/gracedb/events/translator.py b/gracedb/events/translator.py index 4d210ce2f..095d68b5e 100644 --- a/gracedb/events/translator.py +++ b/gracedb/events/translator.py @@ -70,7 +70,7 @@ def handle_uploaded_data(event, datafilename, pipeline = event.pipeline.name - if pipeline in [ 'gstlal', 'gstlal-spiir', 'pycbc', ] or (pipeline=='MBTAOnline' and '.xml' in datafilename): + if pipeline in [ 'gstlal', 'spiir', 'pycbc', ] or (pipeline=='MBTAOnline' and '.xml' in datafilename): log_comment = "Log File Created" # Wildly speculative wrt HM @@ -399,7 +399,7 @@ def handle_uploaded_data(event, datafilename, issuer=event.submitter, comment=error) log.save() - elif pipeline == 'LIB': + elif pipeline == 'oLIB': # lambda function for converting to a type if not None typecast = lambda t, v: t(v) if v is not None else v n_int = lambda v: typecast(int, v) diff --git a/gracedb/events/view_logic.py b/gracedb/events/view_logic.py index 2634c3fd0..cb6e165e0 100644 --- a/gracedb/events/view_logic.py +++ b/gracedb/events/view_logic.py @@ -52,7 +52,7 @@ def _createEventFromForm(request, form): else: search = None # Create Event - if pipeline.name in ['gstlal', 'gstlal-spiir', 'MBTAOnline', 'pycbc',]: + if pipeline.name in ['gstlal', 'spiir', 'MBTAOnline', 'pycbc',]: event = CoincInspiralEvent() elif pipeline.name in ['Fermi', 'Swift', 'SNEWS']: event = GrbEvent() @@ -60,7 +60,7 @@ def _createEventFromForm(request, form): event = MultiBurstEvent() elif pipeline.name in ['HardwareInjection',]: event = SimInspiralEvent() - elif pipeline.name in ['LIB',]: + elif pipeline.name in ['oLIB',]: event = LalInferenceBurstEvent() else: event = Event() diff --git a/gracedb/events/views.py b/gracedb/events/views.py index dc1f0d2f9..4d7bfda5d 100644 --- a/gracedb/events/views.py +++ b/gracedb/events/views.py @@ -462,8 +462,8 @@ def view(request, event): templates.insert(0, 'gracedb/event_detail_CWB.html') elif event.pipeline.name in ['HardwareInjection',]: templates.insert(0, 'gracedb/event_detail_injection.html') - elif event.pipeline.name in ['LIB',]: - templates.insert(0, 'gracedb/event_detail_LIB.html') + elif event.pipeline.name in ['oLIB',]: + templates.insert(0, 'gracedb/event_detail_oLIB.html') return render(request, templates, context=context) diff --git a/gracedb/templates/feeds/index.html b/gracedb/templates/feeds/index.html index 3da1939d5..734297d29 100644 --- a/gracedb/templates/feeds/index.html +++ b/gracedb/templates/feeds/index.html @@ -12,7 +12,7 @@ <li><a href="latest/burst/">Burst</a></li> <ul> <li><a href="latest/burst/cwb">CWB</a></li> - <li><a href="latest/burst/lib">LIB</a></li> + <li><a href="latest/burst/olib">oLIB</a></li> </ul> </ul> @@ -20,7 +20,7 @@ <li><a href="latest/cbc/">CBC</a></li> <ul> <li><a href="latest/cbc/gstlal">gstlal</a></li> - <li><a href="latest/cbc/gstlal-spiir">gstlal-spiir</a></li> + <li><a href="latest/cbc/spiir">spiir</a></li> <!-- <li><a href="latest/cbc/grb">GRB</a></li> --> <li><a href="latest/cbc/mbtaonline">MBTAOnline</a></li> </ul> diff --git a/gracedb/templates/gracedb/event_detail_LIB.html b/gracedb/templates/gracedb/event_detail_oLIB.html similarity index 100% rename from gracedb/templates/gracedb/event_detail_LIB.html rename to gracedb/templates/gracedb/event_detail_oLIB.html diff --git a/gracedb/templates/gracedb/index.html b/gracedb/templates/gracedb/index.html index cdd04a114..30caadcf6 100644 --- a/gracedb/templates/gracedb/index.html +++ b/gracedb/templates/gracedb/index.html @@ -157,14 +157,14 @@ x.domain(d3.extent(data, function(d) { return d.created; })); // I suspect there is a better and less annoying way of doing all this. // But I don't really know what it is. We specify the ordering of the // pipelines and the color for each pipeline that may be present. -var PIPELINE_ORDER = [ 'gstlal', 'MBTAOnline', 'CWB', 'LIB', 'Fermi', 'Swift', 'SNEWS', 'HardwareInjection']; +var PIPELINE_ORDER = [ 'gstlal', 'MBTAOnline', 'CWB', 'oLIB', 'Fermi', 'Swift', 'SNEWS', 'HardwareInjection']; // These are the first 8 colors of category 10 var COLOR_HASH = {}; COLOR_HASH['gstlal'] = '#1f77b4'; COLOR_HASH['MBTAOnline'] = '#ff7f0e'; COLOR_HASH['CWB'] = '#2ca02c'; -COLOR_HASH['LIB'] = '#d62728'; +COLOR_HASH['oLIB'] = '#d62728'; COLOR_HASH['Fermi'] = '#9467bd'; COLOR_HASH['Swift'] = '#8c564b'; COLOR_HASH['SNEWS'] = '#e377c2'; -- GitLab