custom_tools.decorators package

Submodules

custom_tools.decorators.partition_io_decorator module

custom_tools.decorators.partition_io_decorator.partition_io_decorator(input_param_names: List[str] | None = None, output_param_names: List[str] | None = None) Callable[source]
What:

A decorator that adds metadata about input and output parameters for partitioning logic functions.

Parameters:
  • input_param_names (Optional[List[str]]) – A list of input parameter names for the decorated function.

  • output_param_names (Optional[List[str]]) – A list of output parameter names for the decorated function.

Returns:

The decorated function with added metadata attributes for inputs and outputs.

Return type:

Callable

custom_tools.decorators.timing_decorator module

custom_tools.decorators.timing_decorator.timing_decorator(func)[source]

Logs the execution time of a function to both the console and a log file

custom_tools.decorators.timing_decorator.format_time(seconds)[source]

Convert seconds to a formatted string: HH:MM:SS.

Parameters:

seconds (float) – Time in seconds.

Returns:

Formatted time string.

Return type:

str

custom_tools.decorators.timing_decorator.log_to_console_and_file(function_name, elapsed_time)[source]

Logs a message to both the console and a file

custom_tools.decorators.timing_decorator.log_to_console(message)[source]

Prints a given message to the console

custom_tools.decorators.timing_decorator.log_to_file(message)[source]

Writes a given message to a log file

Module contents