smac.utils.logging

Functions

format_array(inputs[, format_vals])

Transform a numpy array to a list of format so that it can be printed by logger.

get_logger(logger_name)

Get the logger by name

setup_logging([level])

Sets up the logging configuration for all modules.

Interfaces

smac.utils.logging.format_array(inputs, format_vals=True)[source]

Transform a numpy array to a list of format so that it can be printed by logger. If the list holds one element only, then a formatted string is returned.

Parameters:
  • inputs (np.ndarray or list.) – inputs value, could be anything serializable or a np array

  • format_vals (bool.) – if the items in list are formatted values

Returns:

result

Return type:

float or list of floats.

smac.utils.logging.get_logger(logger_name)[source]

Get the logger by name

Return type:

Logger

smac.utils.logging.setup_logging(level=None)[source]

Sets up the logging configuration for all modules.

Parameters:

level (int | Path | None, defaults to None) – An integer representing the logging level. An own logging configuration can be used when passing a path.

Return type:

None