The Git module

The git module is designed to allow interaction between the bot and git repositories which are used to store run configurations and results.

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.

create(location)

Create a new git repository to store configurations etc.

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.

classmethod create(location)[source]

Create a new git repository to store configurations etc.

Parameters:
locationstr

The location of the directory to be used.

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 “general/calibration_directory” from the config file.

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.

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