Skip to content

Replay

replay

Rebuild a simulation run from its provenance record.

A recorded seed is worth nothing if replaying it produces a different catalogue, so the record is designed to be sufficient on its own: given one, these functions rebuild the simulator and redraw the samples without the configuration file, the preset or the catalogue being present.

Classes

Functions:

reconstruct_run

reconstruct_run(record: Mapping[str, Any]) -> tuple[GraphSimulator, int]

Rebuild the simulator and sample count a record describes.

Parameters:

Name Type Description Default
record Mapping[str, Any]

A provenance record with a graph_simulation origin.

required

Returns:

Type Description
GraphSimulator

The reconstructed simulator and the number of samples the recorded run

int

drew from it.

Raises:

Type Description
ValueError

If the record does not describe a run this package can replay, or if the reconstructed simulator disagrees with the recorded column list.

replay_catalogue

replay_catalogue(record: Mapping[str, Any]) -> dict[str, Array]

Redraw the catalogue a record describes.

Parameters:

Name Type Description Default
record Mapping[str, Any]

A provenance record with a graph_simulation origin.

required

Returns:

Type Description
dict[str, Array]

Mapping from parameter name to the redrawn column, in recorded order.

Raises:

Type Description
ValueError

If the record does not describe a replayable run.