gwcelery.tasks.gracedb module

Communication with GraceDB.

exception gwcelery.tasks.gracedb.RetryableHTTPError(*args: Any, **kwargs: Any)[source]

Bases: HTTPError

Exception class for server-side HTTP errors that we should retry.

exception gwcelery.tasks.gracedb.ZeroLengthResponse[source]

Bases: Exception

Exception for zero length responses.

GraceDB does not accept zero-length uploads, but sometimes appears to send zero-length content when downloading files.

FIXME: This may be a bug. Remove once diagnosed.

gwcelery.tasks.gracedb.catch_retryable_http_errors(f)[source]

Decorator to capture server-side errors that we should retry.

We retry HTTP status 502 (Bad Gateway), 503 (Service Unavailable), and 504 (Gateway Timeout). We also retry client side error codes 408 (Timeout), 409 (Conflicting URL), 429 (Too many requests).

gwcelery.tasks.gracedb.task(*args, **kwargs)[source]
(task)gwcelery.tasks.gracedb.add_pipeline_preferred_event(superevent_id, event_id)[source]

Proxy that evaluates object once.

Proxy will evaluate the object each time, while the promise will only evaluate it once.

(task)gwcelery.tasks.gracedb.create_event(filecontents, search, pipeline, group, labels=None)[source]

Create an event in GraceDB.

(task)gwcelery.tasks.gracedb.create_label(label, graceid)[source]

Create a label in GraceDB.

(task)gwcelery.tasks.gracedb.create_label_with_log(log_message, label, tags, superevent_id)[source]

Create a label with a log for a superevent in GraceDB.

(task)gwcelery.tasks.gracedb.remove_label(label, graceid)[source]

Remove a label in GraceDB.

(task)gwcelery.tasks.gracedb.create_signoff(status, comment, signoff_type, graceid)[source]

Create a signoff in GraceDB.

(task)gwcelery.tasks.gracedb.create_tag(filename, tag, graceid)[source]

Create a tag in GraceDB.

(task)gwcelery.tasks.gracedb.download(filename, graceid)[source]

Download a file from GraceDB.

(task)gwcelery.tasks.gracedb.expose(graceid)[source]

Expose an event to the public.

Notes

If expose_to_public is False, then this because a no-op.

(task)gwcelery.tasks.gracedb.get_events(query, **kwargs)[source]

Get events from GraceDB.

(task)gwcelery.tasks.gracedb.get_event(graceid)[source]

Retrieve an event from GraceDB.

(task)gwcelery.tasks.gracedb.get_group(graceid)[source]

Retrieve the search field of an event from GraceDB.

Retrieve the search field of an event from GraceDB.

(task)gwcelery.tasks.gracedb.get_labels(graceid)[source]

Get all labels for an event in GraceDB.

(task)gwcelery.tasks.gracedb.get_log(graceid)[source]

Get all log messages for an event in GraceDB.

(task)gwcelery.tasks.gracedb.get_superevent(graceid)[source]

Retrieve a superevent from GraceDB.

(task)gwcelery.tasks.gracedb.replace_event(graceid, payload)[source]

Replace an event in GraceDB.

(task)gwcelery.tasks.gracedb.upload(filecontents, filename, graceid, message, tags=())[source]

Upload a file to GraceDB.

(task)gwcelery.tasks.gracedb.get_superevents(query, **kwargs)[source]

List matching superevents in gracedb.

Parameters:
  • *args – arguments passed to GraceDb.superevents()

  • **kwargs – keyword arguments passed to GraceDb.superevents()

Returns:

superevents – The list of the superevents.

Return type:

list

(task)gwcelery.tasks.gracedb.remove_pipeline_preferred_event(superevent_id, event_id)[source]

Proxy that evaluates object once.

Proxy will evaluate the object each time, while the promise will only evaluate it once.

(task)gwcelery.tasks.gracedb.update_superevent(superevent_id, t_start=None, t_end=None, t_0=None, preferred_event=None, em_type=None, time_coinc_far=None, space_coinc_far=None)[source]

Update superevent information. Wrapper around updateSuperevent()

Parameters:
  • superevent_id (str) – superevent uid

  • t_start (float) – start of superevent time window, unchanged if None

  • t_end (float) – end of superevent time window, unchanged if None

  • t_0 (float) – superevent t_0, unchanged if None

  • preferred_event (str) – uid of the preferred event, unchanged if None

(task)gwcelery.tasks.gracedb.add_event_to_superevent(superevent_id, graceid)[source]

Add an event to a superevent in GraceDB.

(task)gwcelery.tasks.gracedb.get_superevent_file_list(superevent_id)[source]

Get superevent file list from GraceDB.

(task)gwcelery.tasks.gracedb.get_latest_file(superevent_id, filename)[source]

Get the lastest file provided a file name

Parameters:
  • superevent_id (str) – superevent uid

  • file_name (str) – The filebase of a file name e.g. ‘bayestar.multiorder.fits’ for ‘bayestar.multiorder.fits,0’

Return type:

The versioned filename for the inquired file