ligo.raven.mock_gracedb¶
- class ligo.raven.mock_gracedb.MockGraceDb(input)[source]¶
Bases:
objectMock GraceDB class meant to be similar and callable like ligo.gracedb.rest.GraceDb but being populated by a given file, such as .csv.
- Parameters:
input (str) – Path to file, such as .csv, to create mock GraceDB class from or data in JSON format
- events(args)[source]¶
Query mock database for external events.
- Parameters:
args (str) – String to perform query, in the format of ‘group start_time .. end_time search pipeline far_cutoff’
- Returns:
results – List of event dictonaries
- Return type:
list
- class ligo.raven.mock_gracedb.File(file)[source]¶
Bases:
objectLoad files by pointing to local path.
- class ligo.raven.mock_gracedb.mock_event(graceid, data=None)[source]¶
Bases:
objectReturn event from mock database, as well as mock up other calls that could be performed for an individual event.
- Parameters:
graceid (str) – GraceDB ID
data (Table) – Mock GraceDB database to populate result from
- class ligo.raven.mock_gracedb.mock_superevent(graceid, data=None)[source]¶
Bases:
objectReturn superevent from mock database, as well as mock up other calls that could be performed for an individual superevent.
- Parameters:
graceid (str) – GraceDB ID
data (Table) – Mock GraceDB database to populate result from
- ligo.raven.mock_gracedb.is_string_a_url(url_string)[source]¶
Takes URL string and returns True or False whether a string is a URL.
- ligo.raven.mock_gracedb.choose_gracedb(path)[source]¶
- Determine whether the input given is from an official GraceDB online
server or from a local file.
- Parameters:
path (str) – Either GraceDB API URL or path to local local
- Returns:
GraceDB – GraceDB class instance, either official online or mock offline
- Return type:
class