combine_values

passengersim.callbacks.combine.combine_values(key: str, a: Any, b: Any) → Any[source]

Combine two values stored under the same callback_data key.

Parameters:
key : str

The callback_data key, used in error messages.

a : Any

The two values. Neither is modified.

b : Any

The two values. Neither is modified.

Returns:

Any – For tables declaring an aggregation process, the result of that process’s combiner. Otherwise a + b, which concatenates the lists of rows collected by callback functions, and adds undeclared tables.

Raises:

ValueError – If the two values declare different processes (other than the legacy fallback for pooled_moments), or a process with no registered combiner.