Skip to content

Commit

Permalink
more documentation (HyperpathGenerating)
Browse files Browse the repository at this point in the history
  • Loading branch information
djfrancesco committed Dec 12, 2023
1 parent 9e393bc commit 8715d29
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions aequilibrae/paths/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
33 changes: 33 additions & 0 deletions aequilibrae/paths/public_transport.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Paths
VDF
TrafficClass
TrafficAssignment
HyperpathGenerating

Transit
-------
Expand Down

0 comments on commit 8715d29

Please sign in to comment.