Loggers

class llamea.loggers.ExperimentLogger(name='')

Bases: object

create_log_dir(name='')

Creates a new directory for logging experiments based on the current date and time. Also creates subdirectories for IOH experimenter data and code files.

Returns:

str: The name of the created directory.

log_code(attempt, algorithm_name, code)

Logs the provided code into a file, uniquely named based on the attempt number and algorithm name.

Args:

attempt (int): The attempt number of the code execution. algorithm_name (str): The name of the algorithm used. code (str): The source code to be logged.

log_configspace(attempt, algorithm_name, config_space)

Logs the provided configuration space (str) into a file, uniquely named based on the attempt number and algorithm name.

Args:

attempt (int): The attempt number of the code execution. algorithm_name (str): The name of the algorithm used. config_space (ConfigSpace): The Config space to be logged.

log_conversation(role, content)

Logs the given conversation content into a conversation log file.

Args:

role (str): Who (the llm or user) said the content. content (str): The conversation content to be logged.

log_import_fails(import_fails: list[str])

Logs import failures, which happens when llm generated code tries to import un-available or not allowed to import libraries.

Args:

import_fails: list[str]: List of libraries needed to import.

log_individual(individual)

Logs the given individual in a general logfile.

Args:

individual (Individual): potential solution to be logged.

log_population(population)
log_solution(solution: Solution, sol_data: Any)

Logs solution, used to output of the programs generated by LLM.

Args:

solution: llamea.solution: A solution object from LLaMEA. sol_data: Any: The output deta, generated by execution solution.code.

set_attempt(attempt)
llamea.loggers.convert_to_serializable(data)