gstlal 1.13.0
Loading...
Searching...
No Matches
util.py File Reference

Go to the source code of this file.

Classes

class  python.dags.util.DAG
 A thin subclass of pipeline.CondorDAG. More...
class  python.dags.util.DAGJob
 A job class that subclasses pipeline.CondorDAGJob and adds some extra boiler plate items for gstlal jobs which tends to do the "right" thing when given just an executable name. More...
class  python.dags.util.DAGNode
 A node class that subclasses pipeline.CondorDAGNode that automates adding the node to the dag, makes sensible names and allows a list of parent nodes to be provided. More...

Functions

 python.dags.util.which (prog)
 python.dags.util.condor_scratch_space ()
 A way to standardize the condor scratch space even if it changes.
 python.dags.util.log_path ()
 The stupid pet tricks to find log space on the LDG.
 python.dags.util.condor_command_dict_from_opts (opts, defaultdict=None)
 A function to turn a list of options into a dictionary of condor commands, e.g.,.
 python.dags.util.pipeline_dot_py_append_opts_hack (opt, vals)
 A way to work around the dictionary nature of pipeline.py which can only record options once.
 python.dags.util.format_ifo_args (ifos, args)
 python.dags.util.breakupseg (seg, maxextent, overlap)
 python.dags.util.breakupsegs (seglist, maxextent, overlap)
 python.dags.util.breakupseglists (seglists, maxextent, overlap)
 python.dags.util.partition_by_time (span, segdict, ifos, min_ifos=1, max_livetime=14440, start_pad=512)
 Splits a time span roughly equally based on livetime.
 python.dags.util.cache_to_instruments (cache)
 Given a cache, returns back a string containing all the IFOs that are contained in each of its cache entries, sorted by IFO name.
 python.dags.util.group_T050017_filename_from_T050017_files (cache_entries, extension, path=None)
 A function to return the name of a file created from multiple files following the T050017 convention.
 python.dags.util.groups (l, n)
 Given a list, returns back sublists with a maximum size n.
 python.dags.util.flatten (lst)
 Flatten a list by one level of nesting.

Function Documentation

◆ breakupseg()

breakupseg ( seg,
maxextent,
overlap )

Definition at line 320 of file util.py.

◆ breakupseglists()

breakupseglists ( seglists,
maxextent,
overlap )

Definition at line 354 of file util.py.

◆ breakupsegs()

breakupsegs ( seglist,
maxextent,
overlap )

Definition at line 347 of file util.py.

◆ cache_to_instruments()

cache_to_instruments ( cache)

Given a cache, returns back a string containing all the IFOs that are contained in each of its cache entries, sorted by IFO name.

Definition at line 426 of file util.py.

◆ condor_command_dict_from_opts()

condor_command_dict_from_opts ( opts,
defaultdict = None )

A function to turn a list of options into a dictionary of condor commands, e.g.,.

condor_command_dict_from_opts(["+Online_CBC_SVD=True", "TARGET.Online_CBC_SVD =?= True"]) {'+Online_CBC_SVD': 'True', 'TARGET.Online_CBC_SVD ': '?= True'} condor_command_dict_from_opts(["+Online_CBC_SVD=True", "TARGET.Online_CBC_SVD =?= True"], {"somecommand":"somevalue"}) {'somecommand': 'somevalue', '+Online_CBC_SVD': 'True', 'TARGET.Online_CBC_SVD ': '?= True'} condor_command_dict_from_opts(["+Online_CBC_SVD=True", "TARGET.Online_CBC_SVD =?= True"], {"+Online_CBC_SVD":"False"}) {'+Online_CBC_SVD': 'True', 'TARGET.Online_CBC_SVD ': '?= True'}

Definition at line 263 of file util.py.

◆ condor_scratch_space()

condor_scratch_space ( )

A way to standardize the condor scratch space even if it changes.

condor_scratch_space() '_CONDOR_SCRATCH_DIR'

Definition at line 77 of file util.py.

◆ flatten()

flatten ( lst)

Flatten a list by one level of nesting.

Definition at line 497 of file util.py.

◆ format_ifo_args()

format_ifo_args ( ifos,
args )
Given a set of instruments and arguments keyed by instruments, this
creates a list of strings in the form {ifo}={arg}. This is suitable
for command line options like --channel-name which expects this
particular format.

Definition at line 299 of file util.py.

◆ group_T050017_filename_from_T050017_files()

group_T050017_filename_from_T050017_files ( cache_entries,
extension,
path = None )

A function to return the name of a file created from multiple files following the T050017 convention.

In addition to the T050017 requirements, this assumes that numbers relevant to organization schemes will be the first entry in the description, e.g. 0_DIST_STATS, and that all files in a given cache file are from the same group of ifos and either contain data from the same segment or from the same background bin. Note, that each file doesn't have to be from the same IFO, for example the template bank cache could contain template bank files from H1 and template bank files from L1.

Definition at line 437 of file util.py.

◆ groups()

groups ( l,
n )

Given a list, returns back sublists with a maximum size n.

Definition at line 489 of file util.py.

◆ log_path()

log_path ( )

The stupid pet tricks to find log space on the LDG.

Defaults to checking TMPDIR first.

Definition at line 86 of file util.py.

◆ partition_by_time()

partition_by_time ( span,
segdict,
ifos,
min_ifos = 1,
max_livetime = 14440,
start_pad = 512 )

Splits a time span roughly equally based on livetime.

Definition at line 362 of file util.py.

◆ pipeline_dot_py_append_opts_hack()

pipeline_dot_py_append_opts_hack ( opt,
vals )

A way to work around the dictionary nature of pipeline.py which can only record options once.

pipeline_dot_py_append_opts_hack("my-favorite-option", [1,2,3]) '1 –my-favorite-option 2 –my-favorite-option 3'

Definition at line 285 of file util.py.

◆ which()

which ( prog)

Definition at line 69 of file util.py.