config

Config(*, tags, ~typing.Any] =, callbacks, ...)

Create a new model by parsing and validating input data from keyword arguments.

SimulationSettings(*, diagnostics, ...)

Create a new model by parsing and validating input data from keyword arguments.

Carrier(*, name, rm_system[, ...])

Configuration for passengersim.Carrier object.

Leg(*[, leg_id, orig_timezone, ...])

Configuration for a single leg in the simulated network.

Path(*[, path_id, carrier])

A travel path from an origin to a destination, comprised of one or more legs.

Demand(*, orig, dest, segment, base_demand, ...)

Specification of passenger demand between an origin–destination pair.

Fare(*, carrier, orig, dest, booking_class)

A single fare rule connecting a carrier, market, and booking class.

BookingCurve(*, name, curve)

A mathematical description of the relative arrival rate of customers over time.

ChoiceModel

Runtime representation of an annotated type.

DatabaseConfig(*[, engine, filename, ...])

Create a new model by parsing and validating input data from keyword arguments.

Frat5Curve(*, name[, enforce_monotonic, max_cap])

Fare Ratio at which 50% of customers will buy up to a higher fare.

ToddCurve(*[, name, min_distance, ...])

Customer preference data for Time Of Day for departure (TODD).

Place(*, name, label[, country, ...])

Create a new model by parsing and validating input data from keyword arguments.

LimitConnectTime(*, domestic_domestic, ...)

Create a new model by parsing and validating input data from keyword arguments.

SnapshotFilter(*[, type, title, carrier, ...])

Create a new model by parsing and validating input data from keyword arguments.

ConnectionBuilderSettings(*[, max_legs, ...])

Settings for the automatic connection builder.

OutputConfig(*, base_dir, filename_stem, ...)

Create a new model by parsing and validating input data from keyword arguments.

HtmlOutputConfig(*[, filename, title, ...])

Configuration for HTML outputs.

StateOutputConfig(*[, save, filename, ...])

Create a new model by parsing and validating input data from keyword arguments.

SpeedLimits(*[, SHORT_HAUL_MAX_DISTANCE, ...])

Create a new model by parsing and validating input data from keyword arguments.

YamlConfig(*[, tags])

A Pydantic BaseModel with methods for loading from and writing to YAML files.

PrettyModel()

Pretty-print as YAML style outputs.

Configuration Figures

These functions are also available as methods on a Config object.

passengersim.config._figures.fig_route_map(cfg: Config, carrier: str | None = None) → Chart[source]

Create a figure showing the route map for the configured network.

Routes are drawn as geodesic arcs on either a CONUS or world projection, determined automatically by the geographic extent of the network. Airport locations are shown as points, with major hubs (airports serving more than 20% of all legs) rendered as stars.

Parameters:
cfg : Config

Configuration object containing legs and places.

carrier : str, optional

If provided, only show legs operated by this carrier. If None (default), all carriers are shown.

Returns:

alt.Chart – An Altair layered chart combining the base map, route arcs, and airport point markers.

passengersim.config._figures.fig_booking_curves(cfg: Config, raw_df: bool = False) → Chart | DataFrame[source]

Create a figure showing all booking curves defined in the config.

Each curve is plotted as a line showing the cumulative proportion of bookings made at each number of days prior to departure. Curves are colored by passenger segment and labeled to indicate which demand(s) use them.

Parameters:
cfg : Config

Configuration object containing booking curves and demands.

raw_df : bool, optional

If True, return the underlying pandas DataFrame instead of the chart. Default is False.

Returns:

alt.Chart or pd.DataFrame – An Altair line chart of the booking curves, or the raw DataFrame if raw_df is True.