Utils
unimol_tools.utils contains the utils related to the model, such as metrics and logger.
Metrics
unimol_tools.utils.metrics contains the metrics included in the model.
Logger
unimol_tools.utils.base_logger.py control the logger.
- class unimol_tools.utils.base_logger.PackagePathFilter(name='')[source]
A custom logging filter for adding the relative path to the log record.
- class unimol_tools.utils.base_logger.Logger(*args, **kwargs)[source]
A custom logger class that provides logging functionality to console and file.
- class unimol_tools.utils.base_logger.HighlightFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]
- format(record)[source]
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
Config
unimol_tools.utils.config_handler.py manages the config input file.
- class unimol_tools.utils.config_handler.YamlHandler(file_path)[source]
A class to read and write the yaml file
- __init__(file_path)[source]
A custom logger class that provides logging functionality to console and file.
- Parameters:
file_path – (str) The yaml file path of the config.
Padding
unimol_tools.utils.util.py contain some padding methods.