aequilibrae.paths.public_transport#

Functions

convert_graph_to_csc_uint32(edges, tail, ...)

Convert an edge dataframe in COO format into CSC format.

Classes

HyperpathGenerating(edges[, tail, head, ...])

A class for hyperpath generation.

class aequilibrae.paths.public_transport.HyperpathGenerating(edges, tail='tail', head='head', trav_time='trav_time', freq='freq', check_edges=False, skim_cols=None, *, o_vert_ids=array([], dtype=int64), d_vert_ids=array([], dtype=int64), nodes_to_indices)#

A class for hyperpath generation.

Arguments:

edges (pandas.DataFrame): The edges of the graph.

tail (str, optional): The column name for the tail of the edge. Default is “tail”.

head (str, optional): The column name for the head of the edge. Default is “head”.

trav_time (str, optional): The column name for the travel time of the edge. Default is “trav_time”.

freq (str, optional): The column name for the frequency of the edge. Default is “freq”.

check_edges (bool, optional): If True, check the validity of the edges. Default is False.

assign(origin_column, destination_column, demand_column, check_demand=False, threads=None)#

Assigns demand to the edges of the graph.

Assumes the *_column arguments are provided as numpy arrays that form a COO sprase matrix.

Arguments:

origin_column (np.ndarray, optional): The column for the origin vertices. Default is “orig_vert_idx”.

destination_column (np.ndarray, optional): The column or the destination vertices. Default is “dest_vert_idx”.

demand_column (np.ndarray, optional): The column for the demand values. Default is “demand”.

check_demand (bool, optional): If True, check the validity of the demand data. Default is False.

threads (int, optional): The number of threads to use for computation. Default is 0 (using all available threads).

check_skim_cols(skim_cols: Union(list[str], tuple[str], set(str)))#
compute_skim_cols(skim_cols, edges: DataFrame, trav_time: str)#
info() dict#
run(origin, destination, volume)#
save_results(table_name: str, keep_zero_flows=True, project=None) None#

Saves the assignment results to results_database.sqlite

Method fails if table exists

Arguments:

table_name (str): Name of the table to hold this assignment result.

keep_zero_flows (bool): Whether we should keep records for zero flows. Defaults to True.

project (Project, optional): Project we want to save the results to. Defaults to the active project

aequilibrae.paths.public_transport.convert_graph_to_csc_uint32(edges, tail, head, data, vertex_count)#

Convert an edge dataframe in COO format into CSC format.

The data vector is of uint32 type.

Parameters:
  • edges (pandas.core.frame.DataFrame) – The edges dataframe.

  • tail (str) – The column name in the edges dataframe for the tail vertex index.

  • head (str) – The column name in the edges dataframe for the head vertex index.

  • data (str) – The column name in the edges dataframe for the int edge attribute.

  • vertex_count (int) – The vertex count in the given network edges.

Return type:

tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]