asimov package

Submodules

asimov.condor module

Code for interacting with the condor scheduler.

class asimov.condor.CondorJob(cluster_id)[source]

Bases: object

An object to represent a running condor job.

Parameters:
cluster_idint

The cluster ID for this job.

Attributes:
run_directory

Find the run directory.

status

Methods

get_asset(path)

Find an asset related to this job.

get_config()

Open the configuration file for this job.

get_data

get_asset(path)[source]

Find an asset related to this job.

get_config()[source]

Open the configuration file for this job.

get_data()[source]
property run_directory

Find the run directory.

property status

asimov.git module

exception asimov.git.AsimovFileNotFound[source]

Bases: FileNotFoundError

class asimov.git.EventRepo(directory, url=None, update=False)[source]

Bases: object

Read a git repository containing event PE information.

Parameters:
directorystr

The path to the git repository on the filesystem.

urlstr

The URL of the git repository

updatebool

Flag to determine if the repository is updated when loaded. Defaults to False.

Methods

add_file(source, destination[, commit_message])

Add a new file to the repository.

find_coincfile([category])

Find the coinc file for this calibration category in this repository.

find_prods([name, category])

Find all of the productions for a relevant category of runs in the event repository.

find_timefile([category])

Find the time file in this repository.

from_url(url, name[, directory, update])

Clone a git repository into a working directory, then create an EventRepo object for it.

update([stash, branch])

Pull the latest updates to the repository.

upload_preferred(event, prods)

Prepare the preferred PESummary file by combining all of the productions for an event which are marked as Preferred or Finalised.

upload_prod(production, rundir[, preferred, ...])

Upload the results of a PE job to the event repostory.

add_file(source, destination, commit_message=None)[source]

Add a new file to the repository.

Parameters:
sourcestr, file path

The path to the file to be added.

destinationstr

The location to which the file should be copied in the repository, relative to the root of the repository. Any directories which do not exist already will be created.

commit_messagestr, optional

The commit message for the git commit. Defaults to a description of the file addition.

find_coincfile(category='C01_offline')[source]

Find the coinc file for this calibration category in this repository.

find_prods(name=None, category='C01_offline')[source]

Find all of the productions for a relevant category of runs in the event repository.

Parameters:
namestr, optional

The name of the production. If omitted then all production ini files are returned.

categorystr, optional

The category of run. Defaults to “C01_offline”.

find_timefile(category='C01_offline')[source]

Find the time file in this repository.

classmethod from_url(url, name, directory=None, update=False)[source]

Clone a git repository into a working directory, then create an EventRepo object for it.

Parameters:
urlstr

The URL of the git repository

namestr

The name for the git repository (probably the event name)

directorystr, optional

The location to store the cloned repository. If this value isn’t provided the repository is cloned into the /tmp directory.

updatebool

Flag to determine if the repository is updated when loaded. Defaults to False.

update(stash=False, branch='master')[source]

Pull the latest updates to the repository.

Parameters:
stashbool, optional

If true any changes which are in the local version of the repository are first stashed. Default is False.

branchstr, optional

The branch which should be checked-out. Default is master.

upload_preferred(event, prods)[source]

Prepare the preferred PESummary file by combining all of the productions for an event which are marked as Preferred or Finalised.

Parameters:
eventasimov.gitlab.EventIssue

The event which the preferred upload is being prepared for.

prodslist

A list of all of the productions which should be included in the preferred file.

upload_prod(production, rundir, preferred=False, category='C01_offline', rootdir='public_html/LVC/projects/O3/C01/', rename=False)[source]

Upload the results of a PE job to the event repostory.

Parameters:
categorystr, optional

The category of the job. Defaults to “C01_offline”.

productionstr

The production name.

rundirstr

The run directory of the PE job.

class asimov.git.MetaRepository(directory)[source]

Bases: object

Methods

get_repo

get_repo(event)[source]

asimov.gitlab module

Code for interacting with a gitlab instance.

class asimov.gitlab.EventIssue(issue, repository, update=False, repo=True)[source]

Bases: object

Use an issue on the gitlab issue tracker to hold variable data for the program.

Parameters:
issuegitlab.issue

The issue which represents the event.

updatebool

Flag to determine if the git repository is updated when it is loaded. Defaults to False to prevent excessive load on the git server.

Attributes:
productions

List the productions on this event.

state

Get the state of the event’s runs.

Methods

add_label(label[, state])

Add a new label to an event issue.

add_note(text)

Add a comment to the event issue.

create_issue(repository, event_object[, ...])

Create an issue for an event.

parse_notes()

Read issue information from the comments on the issue.

update_data()

Store event data in the comments on the event repository.

add_label(label, state=True)[source]

Add a new label to an event issue.

Parameters:
labelstr

The name of the label.

add_note(text)[source]

Add a comment to the event issue. A footer will be added to identify this as being created by the supervisor and not the user.

classmethod create_issue(repository, event_object, issue_template=None)[source]

Create an issue for an event.

parse_notes()[source]

Read issue information from the comments on the issue.

Only notes which start ` # Run information ` will be parsed.

property productions

List the productions on this event.

property state

Get the state of the event’s runs.

update_data()[source]

Store event data in the comments on the event repository.

asimov.gitlab.find_events(repository, milestone=None, subset=None, update=False, repo=True, label=None)[source]

Search through a repository’s issues and find all of the ones for events.

asimov.ini module

Handle run configuration files.

This module is inteded to read and manipulate the run configuration files which are used by LALInferencePipe to design a parameter estimation run.

class asimov.ini.RunConfiguration(path)[source]

Bases: object

A class to represent a run configuration.

Methods

check_fakecache()

Check to see if this file contains a fake-cache.

get_calibration()

Retrieve the calibration envelope locations.

get_engine()

Fetch all of the Lalinference engine data.

get_psds()

Check if PSDs have been set in the ini file, and return them if they have.

run_bayeswave([status])

Ensure that Bayeswave is run for this job.

set_lalinference(**kwargs)

Set the values of LALInference configuration variables.

update_accounting([user])

Update the accounting tag for this job.

update_psds(psds[, clobber])

Update the locations of the PSDs in the ini file.

update_webdir(event, prod[, rootdir])

Update the web directory in the ini file.

get_channels

get_ifos

save

set_approximant

set_queue

check_fakecache()[source]

Check to see if this file contains a fake-cache.

This can be used to determine whether the ini file sets up a configuration which uses e.g. deglitched frames.

Returns:
bool

Returns true if a fake cache has been used for this file.

get_calibration()[source]

Retrieve the calibration envelope locations.

get_channels()[source]
get_engine()[source]

Fetch all of the Lalinference engine data.

get_ifos()[source]
get_psds()[source]

Check if PSDs have been set in the ini file, and return them if they have.

run_bayeswave(status=True)[source]

Ensure that Bayeswave is run for this job.

This should be run in order to add Bayeswave to produce PSDs for an event.

Parameters:
statusbool, optional

If set to true (the default) then a line will be added to ensure that Bayeswave is run to generate PSDs. If False then this line will be removed from the ini file if it exists.

save()[source]
set_approximant(approximant, amporder, fref)[source]
set_lalinference(**kwargs)[source]

Set the values of LALInference configuration variables.

Parameters:
kwargs

Set a variety of parameters.

set_queue(queue='Priority_PE')[source]
update_accounting(user=None)[source]

Update the accounting tag for this job. Defaults to the user account running the supervisor.

Parameters:
userstr

The accounting user to be added to the ini file.

update_psds(psds, clobber=False)[source]

Update the locations of the PSDs in the ini file.

Parameters:
psdsdict

A dictionary of the various PSDs.

update_webdir(event, prod, rootdir='public_html/LVC/projects/O3/C01/')[source]

Update the web directory in the ini file.

asimov.mattermost module

class asimov.mattermost.Mattermost(url=None)[source]

Bases: object

Methods

send_message(message[, channel])

Send a message to a chat channel.

submit_payload(message[, channel])

Send a payload (normally a message) to a chat channel.

send_message(message, channel=None)[source]

Send a message to a chat channel.

Parameters:
messagestr

The text of the message.

channelstr, optional

The name of the channel. To send a direct message to a person prefix their username with an @ sign. Defaults to the default channel set in mattermost for the webhook.

submit_payload(message, channel=None)[source]

Send a payload (normally a message) to a chat channel.

Parameters:
messagestr

The text of the message.

channelstr, optional

The name of the channel. To send a direct message to a person prefix their username with an @ sign. Defaults to the default channel set in mattermost for the webhook.

asimov.olivaw module

Module contents

Supervisor: A package for interacting with long-running data analysis jobs.

© Copyright 2020-2024, Daniel Williams.
Created using Sphinx 7.2.6.