Skip to content

table

Classes:

Name Description
TableMetric

Synchronizes the state of a dict[str, list[Any]] across multiple worker processes.

TableMetric

Bases: Metric

Synchronizes the state of a dict[str, list[Any]] across multiple worker processes.

Methods:

Name Description
__init__

Construct a TableMetric.

__len__

Return the number of rows in the aggregated table.

compute

Return the aggregated table.

reset

Reset the aggregated table.

update

Aggregate the incoming update from all workers processes and share it with all other worker processes.

__init__

__init__() -> None

Construct a TableMetric.

__len__

__len__() -> int

Return the number of rows in the aggregated table.

compute

compute() -> dict[str, list[Any]]

Return the aggregated table.

Raises:

Type Description
ValueError

If no updates have been performed yet.

Returns:

Type Description
dict[str, list[Any]]

The aggregated table.

reset

reset() -> None

Reset the aggregated table.

update

update(table: dict[str, list[Any]]) -> None

Aggregate the incoming update from all workers processes and share it with all other worker processes.

Parameters:

Name Type Description Default

table

dict[str, list[Any]]

Additional rows to add to the aggregated table.

required

Raises:

Type Description
ValueError

If the table update has no columns.

ValueError

If the table update's keys does not match the aggregated table's keys.

ValueError

If the table update's values are not lists.

ValueError

If the table update's lists are not all of equal length.

ValueError

If the table update has no rows.