From 8715d29a2a5c196057b1acfadad00f5271a375fc Mon Sep 17 00:00:00 2001 From: djfrancesco Date: Tue, 12 Dec 2023 13:53:30 +0100 Subject: [PATCH] more documentation (HyperpathGenerating) --- aequilibrae/paths/__init__.py | 1 + aequilibrae/paths/public_transport.pyx | 33 ++++++++++++++++++++++++++ docs/source/api.rst | 1 + 3 files changed, 35 insertions(+) diff --git a/aequilibrae/paths/__init__.py b/aequilibrae/paths/__init__.py index 654c319a6..d31974a4f 100644 --- a/aequilibrae/paths/__init__.py +++ b/aequilibrae/paths/__init__.py @@ -8,6 +8,7 @@ from aequilibrae.paths.traffic_assignment import TrafficAssignment from aequilibrae.paths.vdf import VDF from aequilibrae.paths.graph import Graph +from aequilibrae.paths.public_transport import HyperpathGenerating from aequilibrae import global_logger diff --git a/aequilibrae/paths/public_transport.pyx b/aequilibrae/paths/public_transport.pyx index e6038e2c1..8cfc29ae4 100644 --- a/aequilibrae/paths/public_transport.pyx +++ b/aequilibrae/paths/public_transport.pyx @@ -19,6 +19,23 @@ include 'hyperpath.pyx' class HyperpathGenerating: + """A class for hyperpath generation. + + :Arguments: + **edges** (:obj:`pandas.DataFrame`): The edges of the graph. + + **tail** (:obj:`str`): The column name for the tail of the edge (optional, default is "tail"). + + **head** (:obj:`str`): The column name for the head of the edge (optional, default is "head"). + + **trav_time** (:obj:`str`): The column name for the travel time of the edge (optional, default is "trav_time"). + + **freq** (:obj:`str`): The column name for the frequency of the edge (optional, default is "freq"). + + **check_edges** (:obj:`bool`): If True, check the validity of the edges (optional, default is False). + """ + + def __init__(self, edges, tail="tail", head="head", trav_time="trav_time", freq="freq", check_edges=False): # load the edges if check_edges: @@ -154,6 +171,22 @@ class HyperpathGenerating: check_demand=False, threads=0 ): + """Assigns demand to the edges of the graph. + + :Arguments: + **demand** (:obj:`pandas.DataFrame`): The demand information. + + **origin_column** (:obj:`str`): The column name for the origin vertices (optional, default is "orig_vert_idx"). + + **destination_column** (:obj:`str`): The column name for the destination vertices (optional, default is "dest_vert_idx"). + + **demand_column** (:obj:`str`): The column name for the demand values (optional, default is "demand"). + + **check_demand** (:obj:`bool`): If True, check the validity of the demand data (optional, default is False). + + **threads** (:obj:`int`):The number of threads to use for computation (optional, default is 0, using all available threads). + """ + # check the input demand paramater if check_demand: self._check_demand(demand, origin_column, destination_column, demand_column) diff --git a/docs/source/api.rst b/docs/source/api.rst index 687395582..393e98cda 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -106,6 +106,7 @@ Paths VDF TrafficClass TrafficAssignment + HyperpathGenerating Transit -------