OutputConfig

class passengersim.config.outputs.OutputConfig[source]

Bases: PrettyModel

Attributes:

base_dir

Base directory for all output files.

filename_stem

Default stem for all output files.

log_reports

Write basic reports directly to the run log.

excel

Write excel outputs to this file after a run.

reports

Reports to include.

html

Configuration for HTML outputs.

pickle

Write a pickle of the SimulationTables output to this file after a run.

sim_state

Configuration for writing simulation dynamic state after each trial.

disk

Write the SimulationTables output to this file after a run.

Methods:

get_output_filename(which[, timestamp, ...])

serialize_reports(reports)

base_dir : Path | None

Base directory for all output files.

Whenever an output file is designated as a simple filename or a relative path, it will be relative to this directory.

If not provided, the current working directory will be used.

filename_stem : str

Default stem for all output files.

If an output file is designated as True instead of giving an explicit filename, then this stem will be used with an appropriate file extension.

log_reports : bool

Write basic reports directly to the run log.

excel : bool | Path | None

Write excel outputs to this file after a run.

reports : set[str | tuple[str, ...]]

Reports to include.

Database queries reports can be included here. This is important for multiprocessing runs with in-memory databases, as database results will not be available after the database connection is closed in each subprocess.

If this is a set containing only “*”, all reports will be included; this may be computationally expensive.

html : HtmlOutputConfig

Configuration for HTML outputs.

pickle : bool | Path | None

Write a pickle of the SimulationTables output to this file after a run.

sim_state : StateOutputConfig

Configuration for writing simulation dynamic state after each trial.

In contrast with the static state, the dynamic state includes things that are created or change during a trial of the simulation, such as attribute counters, histories, and summaries. The dynamic state is the information needed to recreate the Simulation object (beyond the contents of the Config) to facilitate various debugging and introspection.

disk : bool | Path | None

Write the SimulationTables output to this file after a run.

This will use pxsim format, an efficient binary file that allows “lazy” file loading. If set to True, the file will be named with the same name as the HTML output file, except with the extension .pxsim, unless there is no HTML output file, in which case no file will written.

get_output_filename(which: 'html' | 'disk' | 'pickle' | 'sim_state' | 'excel', timestamp: str | float | struct_time | datetime | None = None, make_dirs: bool = False, **kwargs) Path | None[source]
serialize_reports(reports: set[str | tuple[str, ...]]) list[str | tuple[str, ...]][source]