HErmes.utils package¶
Submodules¶
HErmes.utils.files module¶
Locate files on the filesystem and group them together
-
HErmes.utils.files.
DS_ID
(filename)¶
-
HErmes.utils.files.
ENDING
(filename)¶
-
HErmes.utils.files.
EXP_RUN_ID
(filename)¶
-
HErmes.utils.files.
GCD
(filename)¶
-
HErmes.utils.files.
SIM_RUN_ID
(filename)¶
-
HErmes.utils.files.
check_hdf_integrity
(infiles, checkfor=None)[source]¶ Checks if hdfiles can be openend and returns a tuple integer_files,corrupt_files
Parameters: infiles (list) – Keyword Arguments: checkfor (str) –
-
HErmes.utils.files.
group_names_by_regex
(names, regex=<function <lambda>>, firstpattern=<function <lambda>>, estimate_first=<function <lambda>>)[source]¶ Generate lists with files which all have the same name patterns, group by regex
Parameters: names (list) – a list of file names
Keyword Arguments: - regex (func) – a regex to group by
- firstpattern (func) – the leading element of each list
- estimate_first (func) – if there are servaral elements which match firstpattern, estimate which is the first
Returns: names grouped by reges with first pattern as leading element
Return type:
-
HErmes.utils.files.
harvest_files
(path, ending='.bz2', sanitizer=<function <lambda>>, use_ls=False, prefix='dcap://')[source]¶ Get all the files with a specific ending from a certain path
Parameters: path (str) – a path on the filesystem to look for files
Keyword Arguments: Returns: All files in path which match ending and are filtered by sanitizer
Return type:
-
HErmes.utils.files.
strip_all_endings
(filename)[source]¶ Split a filename at the first dot and declare everything which comes after it and consists of 3 or 4 characters (including the dot) as “ending”
Parameters: filename (str) – a filename which shall be split Returns: file basename + ending Return type: list
HErmes.utils.itools module¶
Tools for managing iterables
HErmes.utils.logger module¶
A logger with customizable loglevel at runtime.
-
class
HErmes.utils.logger.
AbstractCustomLoggerType
[source]¶ Bases:
type
A modified logging.logger. Do not use directly, but as metaclass. Whenever the logger is called, HErmes.utils.logger.LOGLEVEL is queried to check for a change in the loglevel and a new logger instance is created accordingly. Python inspect is used to inspect the stack.
-
class
HErmes.utils.logger.
Logger
[source]¶ Bases:
object
A custom logger with loglevel changeable at runtime. To change the loglevel, set the HErmes.utils.logger.LOGLEVEL variable: 10 = DEBUG, 20 = INFO, 30 = WARNING
-
HErmes.utils.logger.
alertstring
(x)¶
Module contents¶
Miscellaneous tools