Skip to content
Skip to Content

Read the outputs

What a run writes to its output folder: the journal, the provenance manifest and the effective configuration.

After cohortix run docs/scenario.toml --output output/tracer, the folder holds four files:

output/tracer
effective.toml
journal/test/Tick/part-000000.parquet
provenance.json
provenance.toml

The journal

Every state change is an event appended to one journal, and the journal is the single source of every output. It is written as Parquet, one partition per contract: journal/<namespace>/<Contract>/part-000000.parquet. The example run has one contract, c:test/Tick, and its 1,200 rows are one Tick event per person and month.

Each row has these columns, then one column per payload field of the event:

ColumnTypeMeaning
timeinteger, daysDay of the event, counted from 1900-01-01: the first day of its step.
stepintegerStep number, from 0.
event_typetextCanonical event name, such as c:test/Tick.Tick.
egointegerId of the person the event is about.
otherslist of integersOther people the event names, such as the mother of a newborn.
territory_unittext, may be emptyThe person's territorial unit when the row was written.
seqintegerOrder of the event in the run: unique and increasing.

Any Parquet reader opens it, for example pandas.read_parquet in Python or arrow::read_parquet in R. See journal and provenance for the persistence modes.

The provenance manifest

provenance.json records everything needed to know how the run was made, and provenance.toml is the same content rendered for reading. An extract from the example run:

output/tracer/provenance.toml
agents = 100
rows = 1200
scenario = "tracer"
schema = "[email protected]"
wave_depth = 8

[contracts]
"c:official/Core" = "1.0.0"
"c:test/Tick" = "1.0.0"

[persistence]
mode = "full"

[seed]
crn_across_parameter_sets = false
parameter_set = 0
population_realization = 0
replication = 0
root = 20180101

[time]
mode = "fixed"
start = "2018-01"
step_unit = "month"
steps = 12

It also records the engine version, commit, compiler and build target, the hash of the Cargo.lock the engine was built with, every active plugin and its version, the handler order of every phase, the BLAKE3 hash of every journal file and the effective configuration. Only the [timing] table (start, end and duration of each step) differs between two runs of one configuration. The format is defined by the JSON Schema schemas/output/v1/provenance.schema.json.

The effective configuration

effective.toml is the scenario with every default written out: here it adds nothing the example did not set, but a scenario that relies on defaults gets them in full. Run it into a new folder to reproduce the journal byte for byte:

Terminal
cohortix run output/tracer/effective.toml --output output/again

What comes later

Indicators computed from the journal, ensembles with intervals, the HTML report (1.1) and the dashboard (1.2) all read these same files. The Python and R client libraries, which read the output folder directly, are not written yet: see clients.

On this page

You are reading the docs for 0.1. Keys can change between versions: use the version that matches cohortix --version.