Skip to content

Commit 72bb994

Browse files
committed
update architecture diagram for release
- add test_loading_columns_fw() in test_ue.py; - update the release date in README.md; - replace TransOMS with OpenDTA systematically; - fix legacy comments on including path geometry info for output_columns() in tutorial.ipynb and usecases.md; - polish where is needed.
1 parent bb5427a commit 72bb994

File tree

7 files changed

+30
-13
lines changed

7 files changed

+30
-13
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Path4GMNS is an open-source, cross-platform, lightweight, and fast Python path engine for networks encoded in [GMNS](https://github.com/zephyr-data-specs/GMNS). Besides finding static shortest paths for simple analyses, its main functionality is to provide an efficient and flexible framework for column-based (path-based) modeling and applications in transportation (e.g., activity-based demand modeling). Path4GMNS supports, in short,
77

8-
1. finding (static) shortest path between two nodes,
8+
1. finding (static) shortest paths,
99
2. performing either path-based or link-based User-Equilibrium (UE) traffic assignment,
1010
3. conducting dynamic traffic assignment (DTA) after UE.
1111
4. evaluating multimodal accessibility and equity,
@@ -24,7 +24,7 @@ Path4GMNS also serves as an API to the C++-based [DTALite](https://github.com/jd
2424

2525
1. **[Tutorial](https://github.com/jdlph/Path4GMNS/blob/master/tutorial/tutorial.ipynb)** written in Jupyter notebook with step-by-step demonstration.
2626
2. **[Documentation](https://path4gmns.readthedocs.io/en/stable/)** on Installation, Use Cases, Public API, and more.
27-
3. **[TransOMS](https://github.com/jdlph/TransOMS)** on the C++ equivalent.
27+
3. **[OpenDTA](https://github.com/jdlph/OpenDTA)** on the C++ equivalent.
2828

2929
We highly recommend that you go through the above [Tutorial](https://github.com/jdlph/Path4GMNS/blob/master/tutorial/tutorial.ipynb), no matter you are one of the existing users or new to Path4GMNS.
3030

@@ -35,7 +35,7 @@ $ pip install path4gmns
3535
```
3636

3737
> [!IMPORTANT]
38-
> v0.10.0 introduces the link-based UE that adopts the Frank-Wolfe algorithm with line search. As it does not preserve any paths, each iteration runs faster than the path-based procedure with less memory footprint. Besides, it fixes potential issues on invoking DTALite. Please **discard all old versions**.
38+
> v0.10.0 introduces the link-based UE that adopts the Frank-Wolfe algorithm with line search. As it does not preserve any paths, each iteration runs faster than the path-based procedure with less memory footprint. Besides, it fixes potential issues of invoking DTALite. Please **discard all old versions**.
3939
4040
> [!WARNING]
4141
> find_shortest_path() computes the shortest path per travel time rather than distance for v0.9.9.post1 and any earlier versions. See [Issue #58](https://github.com/jdlph/Path4GMNS/issues/58) for details. v0.9.10 offers the correct implementation with the flexibility to switch between time and distance.
@@ -60,7 +60,7 @@ The Python modules are written in **Python 3.x**, which is the minimum requireme
6060

6161
## How to Cite
6262

63-
Li, P. and Zhou, X. (2025, December 12). *Path4GMNS*. Retrieved from https://github.com/jdlph/Path4GMNS
63+
Li, P. and Zhou, X. (2025, December 15). *Path4GMNS*. Retrieved from https://github.com/jdlph/Path4GMNS
6464

6565
## Please Contribute
6666

docs/source/imgs/architecture.png

4.73 KB
Loading

docs/source/implnotes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ An easy and smooth installation process by **low dependency** is one of our majo
1414

1515
In order to resolve this issue, we have deprecated node sum and introduced a side-by-side column comparison in Path4GMNS only. As columns between an OD pair are largely different in number of nodes, this comparison can be very efficiently. Slight improvements are actually observed in both running time and convergence gap over the original implementation.
1616

17-
DTALite uses arrays rather than STL containers to store columns. These arrays are fixed in size (1,000), which prevents a fast filtering using the number of nodes as described above. For two (long) columns only different in the last few nodes, this side-by-side comparison has to be continued until the very end and ruins the performance. Thus, we decide **NOT TO ADOPT** this updated implementation to DTALite and leave it to **[TransOMS](https://github.com/jdlph/TransOMS)**.
17+
DTALite uses arrays rather than STL containers to store columns. These arrays are fixed in size (1,000), which prevents a fast filtering using the number of nodes as described above. For two (long) columns only different in the last few nodes, this side-by-side comparison has to be continued until the very end and ruins the performance. Thus, we decide **NOT TO ADOPT** this updated implementation to DTALite and leave it to **[OpenDTA](https://github.com/jdlph/OpenDTA)**.

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ efficient and flexible framework for column-based (path-based) modeling and
1414
applications in transportation (e.g., activity-based demand modeling).
1515
Path4GMNS supports, in short,
1616

17-
1. finding (static) shortest path between two nodes,
17+
1. finding (static) shortest paths,
1818
2. performing either path-based or link-based User-Equilibrium (UE) traffic assignment,
1919
3. conducting dynamic traffic assignment (DTA) after UE.
2020
4. evaluating multimodal accessibility and equity,

docs/source/usecases.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ column_upd_num = 20
173173

174174
pg.find_ue(network, column_gen_num, column_upd_num)
175175

176-
# if you do not want to include geometry info in the output file,
177-
# use pg.output_columns(network, False)
176+
# if you want to include path geometry info in the output file,
177+
# use pg.output_columns(network, True)
178178
pg.output_columns(network)
179179
pg.output_link_performance(network)
180180
```
@@ -598,7 +598,7 @@ print('writing agent trajectories')
598598
pg.output_agent_trajectory(network)
599599
```
600600

601-
If you have route_assignment.csv (i.e.columns) from a previous run or DTALite, you can bypass find_ue() and directly load it to conduct simulation.
601+
If you have route_assignment.csv (i.e., columns) from a previous run or DTALite, you can bypass find_ue() and directly load it to conduct simulation.
602602

603603
```python
604604
import path4gmns as pg

tests/test_ue.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,23 @@ def test_loading_columns(sample_data_dir, tmp_output_dir):
5757
output_link_performance(network, output_dir=tmp_output_dir)
5858

5959

60+
def test_loading_columns_fw(sample_data_dir, tmp_output_dir):
61+
""" test loading columns to set up demand info for find_ue_fw()
62+
63+
WARNING
64+
-------
65+
This is just for testing purpose. It is NOT recommended to use!
66+
"""
67+
network = read_network(input_dir=sample_data_dir)
68+
load_columns(network, input_dir=tmp_output_dir)
69+
70+
rel_gap_tolerance = 1e-2
71+
rel_gap = find_ue_fw(network, max_iter=20, rel_gap_tolerance=rel_gap_tolerance)
72+
assert rel_gap <= rel_gap_tolerance
73+
74+
output_link_performance(network, output_dir=tmp_output_dir)
75+
76+
6077
def test_mixed_invoking1(sample_data_dir):
6178
""" test resolution on issue #51 (https://github.com/jdlph/Path4GMNS/issues/51)
6279
"""

tutorial/tutorial.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"id": "annoying-berry",
8080
"metadata": {},
8181
"source": [
82-
"Navigate to the target data set directory. In this tutorial, we will use the [data set](https://github.com/jdlph/Path4GMNS/tree/dev/tests) where this Jupyter notebook is located for simplicity. You can check your present working directory (PWD) by the following commnad."
82+
"Navigate to the target data set directory. In this tutorial, we will use the [directory](https://github.com/jdlph/Path4GMNS/blob/dev/tutorial) where this Jupyter notebook is located for simplicity. You can check your present working directory (PWD) by the following commnad."
8383
]
8484
},
8585
{
@@ -296,7 +296,7 @@
296296
"\n",
297297
"#### 3.3.2 Path-Based UE\n",
298298
"\n",
299-
"With the required demand file, then you can conduct path-based UE traffic assignment via the following lines."
299+
"With the required demand file, you can conduct path-based UE traffic assignment via the following lines."
300300
]
301301
},
302302
{
@@ -316,8 +316,8 @@
316316
"# path-based UE only\n",
317317
"pg.find_ue(network, column_gen_num, column_upd_num)\n",
318318
"\n",
319-
"# if you do not want to include geometry info in the output file,\n",
320-
"# use pg.output_columns(network, False)\n",
319+
"# if you want to include path geometry info in the output file,\n",
320+
"# use pg.output_columns(network, True)\n",
321321
"# output column information to route_assignment.csv\n",
322322
"pg.output_columns(network)\n",
323323
"# output link performance to link_performance.csv\n",

0 commit comments

Comments
 (0)