layup.log

This module is meant to be an example for how to logging works in Layup. It has a corresponding layup_cmdline verb, log as well.

Attributes

logger

Functions

_apply_log(data[, primary_id_column_name])

Simple function that is executed in parallel across all processes.

log_by_chunk(samples, num_workers)

This example function will generate a random dataset with length samples.

log_by_id(samples, num_workers)

This example function will generate a random dataset with length samples.

log_cli()

This function is called by src/layup_cmdline/log.py. Here it demonstrates

Module Contents

logger[source]
_apply_log(data, primary_id_column_name=None)[source]

Simple function that is executed in parallel across all processes.

log_by_chunk(samples: int, num_workers: int)[source]

This example function will generate a random dataset with length samples. The example dataset is then passed to the multiprocessing function that will distribute the data evenly across all available CPU workers.

log_by_id(samples: int, num_workers: int)[source]

This example function will generate a random dataset with length samples. The data will have an id column that will take a value between 0 and 4 and a value column with a random value between 0 and 1. The example dataset is then passed to the multiprocessing function that will group data by id and then distribute the subsets of data evenly across all available CPU workers.

log_cli()[source]

This function is called by src/layup_cmdline/log.py. Here it demonstrates the use of a few different logging levels and calls the two example functions that will trigger the two modes of multiprocessing currently implemented in Layup.