legenddataflowscripts.utils package

Submodules

legenddataflowscripts.utils.alias_table module

legenddataflowscripts.utils.alias_table.alias_table(file, mapping)

Create an alias table for the given file and mapping.

Args:

file (str): Path to the input file. mapping (dict): Mapping of current table name and alias table name.

Returns:

dict: A dictionary containing the alias table.

legenddataflowscripts.utils.cfgtools module

legenddataflowscripts.utils.cfgtools.get_channel_config(mapping, channel, default_key='__default__')

Get channel key from mapping with default.

Returns the value at key channel, if existing, otherwise return value at default_key.

legenddataflowscripts.utils.convert_np module

legenddataflowscripts.utils.convert_np.convert_dict_np_to_float(dic)

Convert all numpy floats in a dictionary to Python floats.

Parameters:

dic (dict) – The dictionary to convert.

Returns:

dict – The dictionary with all numpy floats converted to Python floats.

Return type:

dict

legenddataflowscripts.utils.log module

class legenddataflowscripts.utils.log.StreamToLogger(logger, log_level=40)

Bases: object

File-like stream object that redirects writes to a logger instance.

flush()
write(buf)
legenddataflowscripts.utils.log.build_log(config_dict, log_file=None, fallback='prod')

Build a logger from a configuration dictionary.

If a log file is provided, the logger will write to that file.

Parameters:
  • config_dict (dict) – A dictionary containing the logging configuration.

  • log_file (str | None) – The path to the log file.

Return type:

Logger

legenddataflowscripts.utils.pulser_removal module

legenddataflowscripts.utils.pulser_removal.get_pulser_mask(pulser_file)