rest: remove EMBB event log (EEL) functionality

Hasn't been used on the production server since 2015, actual
usage was only very minimal. The model and related endpoints will
be removed from the server in the near future.
parent 1ec96153
......@@ -8,8 +8,7 @@ This section provides detailed information about the :py:class:`ligo.gracedb.res
:members:
:inherited-members:
:no-undoc-members:
:exclude-members: eels, writeEel
A separate :class:`GraceDbBasic` class had been provided in the past for password-based authentication, but that functionality is now included in the :class:`GraceDb` class.
:py:class:`ligo.gracedb.rest.GraceDbBasic` is still provided for legacy compatibility, but it is now an exact duplicate of the :py:class:`ligo.gracedb.rest.GraceDb` class.
......@@ -813,18 +813,6 @@ class GraceDb(GsiRest):
"""List of available EM groups on the server."""
return self.service_info.get('em-groups')
@property
def wavebands(self):
return self.service_info.get('wavebands')
@property
def eel_statuses(self):
return self.service_info.get('eel-statuses')
@property
def obs_statuses(self):
return self.service_info.get('obs-statuses')
@property
def voevent_types(self):
"""List of available VOEvent types on the server."""
......@@ -1712,81 +1700,6 @@ class GraceDb(GsiRest):
return self.post(uri, body, files=files)
def eels(self, graceid):
"""Get a list of EMBB log entries associated with an event.
Args:
graceid (str): event graceid.
Returns:
:class:`httplib.HTTPResponse`
Raises:
ligo.gracedb.exceptions.HTTPError: if the response has a status
code >= 400.
Example:
>>> g = GraceDb()
>>> r = g.eels('T101383')
>>> full_dictionary = r.json()
>>> eel_list = full_dictionary['embblog']
"""
template = self.templates['embb-event-log-template']
uri = template.format(graceid=graceid)
return self.get(uri)
def writeEel(self, graceid, group, waveband, eel_status,
obs_status, **kwargs):
"""Create an EMBB event log entry for an event.
Args:
graceid (str): event graceid.
group (str): name of EM MOU group making the observation.
waveband (str): observation waveband.
eel_status (str): EEL status.
obs_status (str): observation status.
**kwargs: additional keyword arguments may be passed in. The
following will be recognized: ra, dec, raWidth, decWidth,
gpstime, duration, comment, and extra_info_dict.
Returns:
:class:`httplib.HTTPResponse`
Raises:
ligo.gracedb.exceptions.HTTPError: if the response has a status
code >= 400.
"""
# validate facility, waveband, eel_status, and obs_status
if group not in self.em_groups:
raise ValueError("group must be one of {0}".format(self.em_groups))
if waveband not in list(self.wavebands):
raise ValueError("waveband must be one of {0}".format(
list(self.wavebands)))
eel_status = self._getCode(eel_status, self.eel_statuses)
if not eel_status:
raise ValueError("EEL status must be one of {0}".format(
list(six.itervalues(self.eel_statuses))))
obs_status = self._getCode(obs_status, self.obs_statuses)
if not obs_status:
raise ValueError("Observation status must be one of {0}".format(
list(six.itervalues(self.obs_statuses))))
template = self.templates['embb-event-log-template']
uri = template.format(graceid=graceid)
body = {
'group': group,
'waveband': waveband,
'eel_status': eel_status,
'obs_status': obs_status,
}
body.update(**kwargs)
return self.post(uri, body=body)
@event_or_superevent
def emobservations(self, object_id, emobservation_num=None, *args,
**kwargs):
......@@ -1886,7 +1799,7 @@ class GraceDb(GsiRest):
>>> r.status
201
"""
# validate facility, waveband, eel_status, and obs_status
# Validate EM group
if group not in self.em_groups:
raise ValueError("group must be one of %s" % self.em_groups)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment