fig_bid_price_history

passengersim.contrast.fig_bid_price_history(summaries: dict[str, SimulationTables], *, by_carrier: bool | str = True, show_stdev: float | bool | None = None, cap: 'some' | 'zero' | None = None, raw_df: bool = False, title: str | None = 'Bid Price History', also_df: bool = False, width: int | None = None, height: int | None = None) Chart | DataFrame | tuple[Chart, DataFrame][source]

Generate a figure contrasting bid price history for one or more runs.

Plots average bid prices vs. days prior to departure, with one line per source. When multiple carriers are present and by_carrier is not a string, the chart is faceted by carrier.

Parameters:
summaries : dict[str, SimulationTables]

One or more SimulationTables to compare.

by_carrier : bool or str, default True

If True, facet the chart by carrier. If a string, filter to only that carrier and return a single unfaceted chart.

show_stdev : float or bool, optional

If truthy, overlay a shaded band and dashed boundary lines showing the bid-price distribution width. Requires by_carrier to be a specific carrier string.

cap : {'some', 'zero', None}, default None

Which bid-price capping variant to display. None uses the raw bid price; 'some' uses a partial-cap variant; 'zero' uses the zero-capped variant.

raw_df : bool, default False

If True, return the raw DataFrame instead of the chart.

title : str, optional

Chart title. Defaults to "Bid Price History". Pass None for no title.

also_df : bool, default False

If True, return a tuple of (figure, dataframe) instead of just the figure.

width : int, optional

Width of each facet panel in pixels. Uses Altair’s default if None.

height : int, optional

Height of each facet panel in pixels. Uses Altair’s default if None.

Returns:

alt.Chart or pd.DataFrame or tuple[alt.Chart, pd.DataFrame] – The Altair chart, or the raw DataFrame if raw_df is True, or a (chart, dataframe) tuple if also_df is True.

Raises:
  • NotImplementedError – If show_stdev is truthy and by_carrier is not a specific carrier string.

  • ValueError – If cap is not one of 'some', 'zero', or None.