From e8bc29842a2b17ce001625f441e990c4bc327930 Mon Sep 17 00:00:00 2001 From: Renata Imai Date: Tue, 3 Sep 2024 17:44:06 -0300 Subject: [PATCH] . --- .../assignment_workflows/plot_forecasting.py | 26 ++++++++++++------- .../plot_public_transit_assignment.py | 22 ++++++++++++++-- .../plot_route_choice_basics.py | 14 ++++++++++ .../plot_route_choice_set.py | 12 +++++++++ .../plot_subarea_analysis.py | 12 +++++++++ .../hyperpath_routing.rst | 2 ++ .../3-transit_assignment/transit_graph.rst | 2 ++ 7 files changed, 79 insertions(+), 11 deletions(-) diff --git a/docs/source/examples/assignment_workflows/plot_forecasting.py b/docs/source/examples/assignment_workflows/plot_forecasting.py index 2a428d0fb..845fede11 100644 --- a/docs/source/examples/assignment_workflows/plot_forecasting.py +++ b/docs/source/examples/assignment_workflows/plot_forecasting.py @@ -18,14 +18,14 @@ import sys # %% + # We create the example project inside our temp folder fldr = join(gettempdir(), uuid4().hex) project = create_example(fldr) logger = project.logger - -#%% +# %% # Traffic assignment with skimming # -------------------------------- @@ -110,7 +110,7 @@ # And save the skims assig.save_skims("base_year_assignment_skims", which_ones="all", format="omx") -#%% +# %% # Trip distribution # ----------------- # Calibration @@ -137,7 +137,7 @@ # We can check which matrix cores were created for our skims to decide which one to use imped.names -#%% +# %% # Where ``free_flow_time_final`` is actually the congested time for the last iteration # %% @@ -185,7 +185,7 @@ for r in gc.report: otp.write(r + "\n") -#%% +# %% # Forecast # -------- # We create a set of 'future' vectors using some random growth factors. @@ -219,7 +219,7 @@ vectors.destinations[:] = destinations * (1 + np.random.rand(vectors.entries) / 10) vectors.destinations *= vectors.origins.sum() / vectors.destinations.sum() -#%% +# %% # Impedance # ~~~~~~~~~ @@ -259,7 +259,7 @@ proj_matrices.update_database() print(proj_matrices.list()) -#%% +# %% # IPF for the future vectors # ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -282,7 +282,7 @@ # %% df = proj_matrices.list() -#%% +# %% # Future traffic assignment # ------------------------- @@ -326,7 +326,7 @@ assig.max_iter = 500 assig.rgap_target = 0.00001 -#%% +# %% # Optional: Select link analysis # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # @@ -393,3 +393,11 @@ # %% # Close the project project.close() + +# %% +# .. seealso:: +# The use of the following functions, methods, classes and modules is shown in this example: +# +# * :func:`aequilibrae.paths.Graph` +# * :func:`aequilibrae.paths.TrafficClass` | :func:`aequilibrae.paths.TrafficAssignment` +# * :func:`aequilibrae.matrix.AequilibraeMatrix` \ No newline at end of file diff --git a/docs/source/examples/assignment_workflows/plot_public_transit_assignment.py b/docs/source/examples/assignment_workflows/plot_public_transit_assignment.py index df3903c35..2362cbb58 100644 --- a/docs/source/examples/assignment_workflows/plot_public_transit_assignment.py +++ b/docs/source/examples/assignment_workflows/plot_public_transit_assignment.py @@ -60,7 +60,7 @@ # Let's save this model for later use. transit.save_to_disk() -#%% +# %% # Graph building # -------------- # Let's build the transit network. We'll disable ``outer_stop_transfers`` and ``walking_edges`` @@ -131,6 +131,11 @@ # To perform an assignment we need to convert the graph builder into a graph. transit_graph = graph.to_transit_graph() +# %% +# .. admonition:: References +# +# :ref:`transit_assignment_graph` + # %% # Spiess & Florian assignment # --------------------------- @@ -155,7 +160,7 @@ mat.matrices[:, :, 0] = np.full((zones_in_the_model, zones_in_the_model), 1.0) mat.computational_view() -#%% +# %% # Hyperpath generation/assignment # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # We'll create a `TransitAssignment` object as well as a `TransitClass` @@ -200,3 +205,16 @@ # %% # Wrapping up project.close() + +# %% +# .. admonition:: References +# +# :ref:`transit_hyperpath_routing` + +# %% +# .. seealso:: +# The use of the following functions, methods, classes and modules is shown in this example: +# +# * :func:`aequilibrae.paths.TransitGraphBuilder` +# * :func:`aequilibrae.paths.TransitClass` | :func:`aequilibrae.paths.TransitAssignment` +# * :func:`aequilibrae.matrix.AequilibraeMatrix` \ No newline at end of file diff --git a/docs/source/examples/assignment_workflows/plot_route_choice_basics.py b/docs/source/examples/assignment_workflows/plot_route_choice_basics.py index 7ee5b40ea..15ff6221b 100644 --- a/docs/source/examples/assignment_workflows/plot_route_choice_basics.py +++ b/docs/source/examples/assignment_workflows/plot_route_choice_basics.py @@ -9,6 +9,7 @@ """ # %% + # Imports from uuid import uuid4 from tempfile import gettempdir @@ -18,6 +19,7 @@ # sphinx_gallery_thumbnail_path = 'images/plot_route_choice_assignment.png' # %% + # We create the example project inside our temp folder fldr = join(gettempdir(), uuid4().hex) @@ -251,3 +253,15 @@ def plot_results(link_loads): # %% project.close() + +# %% +# .. admonition:: References +# +# :ref:`route_choice` + +# %% +# .. seealso:: +# The use of the following functions, methods, classes and modules is shown in this example: +# +# * :func:`aequilibrae.paths.Graph` | :func:`aequilibrae.paths.RouteChoice` +# * :func:`aequilibrae.matrix.AequilibraeMatrix` \ No newline at end of file diff --git a/docs/source/examples/assignment_workflows/plot_route_choice_set.py b/docs/source/examples/assignment_workflows/plot_route_choice_set.py index 0448ede93..dae299ad8 100644 --- a/docs/source/examples/assignment_workflows/plot_route_choice_set.py +++ b/docs/source/examples/assignment_workflows/plot_route_choice_set.py @@ -162,3 +162,15 @@ # %% project.close() + +# %% +# .. admonition:: References +# +# :ref:`route_choice` + +# %% +# .. seealso:: +# The use of the following functions, methods, classes and modules is shown in this example: +# +# * :func:`aequilibrae.paths.Graph` | :func:`aequilibrae.paths.RouteChoice` +# * :func:`aequilibrae.matrix.AequilibraeMatrix` \ No newline at end of file diff --git a/docs/source/examples/assignment_workflows/plot_subarea_analysis.py b/docs/source/examples/assignment_workflows/plot_subarea_analysis.py index 136e0ba1d..5b7e27169 100644 --- a/docs/source/examples/assignment_workflows/plot_subarea_analysis.py +++ b/docs/source/examples/assignment_workflows/plot_subarea_analysis.py @@ -404,3 +404,15 @@ def plot_results(link_loads): map = plot_results(rc.get_load_results()["demand"]) subarea_zone.add_to(map) map + +# %% +# .. admonition:: References +# +# :ref:`route_choice` + +# %% +# .. seealso:: +# The use of the following functions, methods, classes and modules is shown in this example: +# +# * :func:`aequilibrae.paths.Graph` | :func:`aequilibrae.paths.RouteChoice` | :func:`aequilibrae.paths.SubAreaAnalysis` +# * :func:`aequilibrae.matrix.AequilibraeMatrix` \ No newline at end of file diff --git a/docs/source/modeling_with_aequilibrae/3-transit_assignment/hyperpath_routing.rst b/docs/source/modeling_with_aequilibrae/3-transit_assignment/hyperpath_routing.rst index 30ba62b32..61738483c 100644 --- a/docs/source/modeling_with_aequilibrae/3-transit_assignment/hyperpath_routing.rst +++ b/docs/source/modeling_with_aequilibrae/3-transit_assignment/hyperpath_routing.rst @@ -1,3 +1,5 @@ +.. _transit_hyperpath_routing: + Hyperpath routing in the context of transit assignment ====================================================== diff --git a/docs/source/modeling_with_aequilibrae/3-transit_assignment/transit_graph.rst b/docs/source/modeling_with_aequilibrae/3-transit_assignment/transit_graph.rst index 75e15ab68..dd02ec745 100644 --- a/docs/source/modeling_with_aequilibrae/3-transit_assignment/transit_graph.rst +++ b/docs/source/modeling_with_aequilibrae/3-transit_assignment/transit_graph.rst @@ -1,3 +1,5 @@ +.. _transit_assignment_graph: + The Transit assignment graph ============================