hepi.run
Module Contents
Classes
Abstract class that is similar to a dictionary but with fixed keys. |
|
- class hepi.run.RunParam(skip: bool = False, in_file: str = None, out_file: str = None, execute: str = None, name: str = None)[source]
Bases:
hepi.util.DictDataAbstract class that is similar to a dictionary but with fixed keys.
- class hepi.run.Runner(path: str, in_dir: str = None, out_dir: str = None, pre=None)[source]
- orders(self) List[hepi.input.Order][source]
List of supported Orders in this runner.
- _prepare(self, p: hepi.input.Input, **kwargs) RunParam[source]
- _check_input(self, param: hepi.input.Input, **kwargs) bool[source]
- _prepare_all(self, params: List[hepi.input.Input], skip=True, **kwargs) List[RunParam][source]
- run(self, params: List[hepi.input.Input], skip=True, parse=True, parallel=True, sleep=0, run=True, **kwargs)[source]
Run the passed list of parameters.
- Args:
params (
listofhepi.Input): All parameters that should be executed/queued. skip (bool): True means stored runs will be skipped. Else the are overwritten. parse (bool): Parse the results.This is not the prefered cluster/parallel mode, as there the function only queues the job.
parallel (bool): Run jobs in parallel. sleep (int): Sleep seconds after starting job.
run (bool): Actually start/queue runner.
- Returns:
dictcombined dictionary of results and parameters. Each member therein is a list.The dictionary is empty if parse is set to False.
- _run(self, rps: List[RunParam], wait=True, parallel=True, sleep=0, **kwargs)[source]
Runs Runner per
RunParams.- Parameters
rps (
listofRunParams) – Extended run parameters.bar (bool) – Enable info bar.
wait (bool) – Wait for parallel runs to finish.
sleep (int) – Sleep seconds after starting subprocess.
parallel (bool) – Run jobs in parallel.
- Returns
return codes from jobs if no_parse is False.
- Return type
listof int
- _is_valid(self, file: str, p: hepi.input.Input, d) bool[source]
Verifies that a file is a complete output.
- Parameters
file (str) – File path to be parsed.
p (
hepi.Input) – Onput parameters.d (
dict) – Param dictionary.
- Returns
True if file could be parsed.
- Return type
bool
- parse(self, outputs: List[str]) List[hepi.results.Result][source]
Parses Resummino output files and returns List of Results.
- Parameters
outputs (
listof str) – List of the filenames to be parsed.- Returns
- _parse_file(self, file: str) hepi.results.Result[source]
Extracts results from an output file.
- Parameters
file (str) – File path to be parsed.
- Returns
If a value is not found in the file None is used.
- Return type
Result
- set_path(self, p: str)[source]
Set the path to the Runner folder containing the binary in ‘./bin’ or ‘./build/bin’.
- Parameters
p (str) – new path.
- set_input_dir(self, indir: str)[source]
Sets the input directory.
- Parameters
indir (str) – new input directory.