From 0ab953d491ea16556c5fa36fe1f124aa3057c175 Mon Sep 17 00:00:00 2001 From: Quarto GHA Workflow Runner Date: Mon, 24 Jun 2024 10:44:37 +0000 Subject: [PATCH] Built site for gh-pages --- .nojekyll | 2 +- docs/tutorials/index.html | 561 +++++++++++++++++++++----------------- search.json | 14 +- sitemap.xml | 30 +- 4 files changed, 334 insertions(+), 273 deletions(-) diff --git a/.nojekyll b/.nojekyll index 2987e97..49302e7 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -b23a2ff8 \ No newline at end of file +7603784b \ No newline at end of file diff --git a/docs/tutorials/index.html b/docs/tutorials/index.html index 7088f45..0fb62c0 100644 --- a/docs/tutorials/index.html +++ b/docs/tutorials/index.html @@ -291,7 +291,7 @@

Requirements

Working With GTFS

Let’s import the necessary dependencies:

-
+
import datetime
 import os
 import pathlib
@@ -313,7 +313,7 @@ 

Working With GTFS

You may wish to manually download at least one GTFS feed and store somewhere in your file system. Alternatively you may programmatically download the data, as in the solution here.

-
+
BUS_URL = "<INSERT_SOME_URL_TO_BUS_GTFS>"
 RAIL_URL = "<INSERT_SOME_URL_TO_RAIL_GTFS>"
 
@@ -325,7 +325,7 @@ 

Working With GTFS

-
+
BUS_URL = "https://tsvc.pilote4.cityway.fr/api/Export/v1/GetExportedDataFile?ExportFormat=Gtfs&OperatorCode=RTM"
 RAIL_URL = "https://eu.ftp.opendatasoft.com/sncf/gtfs/export-intercites-gtfs-last.zip"
 # using tmp for tutorial but not necessary
@@ -337,13 +337,13 @@ 

Working With GTFS

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
-  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0 4644k    0  1127    0     0    969      0  1:21:48  0:00:01  1:21:47   970  1 4644k    1 88007    0     0  45041      0  0:01:45  0:00:01  0:01:44 45039 98 4644k   98 4596k    0     0  1527k      0  0:00:03  0:00:03 --:--:-- 1527k100 4644k  100 4644k    0     0  1539k      0  0:00:03  0:00:03 --:--:-- 1539k
+  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  1 4723k    1 92351    0     0  80773      0  0:00:59  0:00:01  0:00:58 80726100 4723k  100 4723k    0     0  2534k      0  0:00:01  0:00:01 --:--:-- 2534k
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
-  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100 87726  100 87726    0     0   163k      0 --:--:-- --:--:-- --:--:--  163k
+ 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 86239 100 86239 0 0 192k 0 --:--:-- --:--:-- --:--:-- 192k
-
CompletedProcess(args=['curl', 'https://eu.ftp.opendatasoft.com/sncf/gtfs/export-intercites-gtfs-last.zip', '-o', '/tmp/tmp4yt_16vr/intercity_rail_gtfs.zip'], returncode=0)
+
CompletedProcess(args=['curl', 'https://eu.ftp.opendatasoft.com/sncf/gtfs/export-intercites-gtfs-last.zip', '-o', '/tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip'], returncode=0)
@@ -359,14 +359,14 @@

Working With GTFS

Instantiate a feed object by pointing the MultiGtfsInstance class at a path to the GTFS feed(s) that you have downloaded. Once you have successfully instantiated feed, inspect the correct attribute in order to confirm the number of separate feeds instances contained within it.

-
+
gtfs_pth = "<INSERT_PATH_TO_GTFS>"
 feed = MultiGtfsInstance(path=gtfs_pth)
 print(len(feed.<INSERT_CORRECT_ATTRIBUTE>))
-
+
gtfs_pth = pathlib.Path(tmp_path.name) # need to use pathlib for tmp_path
 feed = MultiGtfsInstance(path=gtfs_pth)
 print(f"There are {len(feed.instances)} feed instances")
@@ -385,14 +385,14 @@

Working With GTFS

By accessing the appropriate attribute, print out the first 5 stops of the first instance within the feed object.

-
+
feed.<INSERT_CORRECT_ATTR>[0].feed.stops.<INSERT_CORRECT_METHOD>(5)

These records will match the contents of the stops.txt file within the feed that you downloaded.


-
+
feed.instances[0].feed.stops.head(5)
@@ -487,12 +487,12 @@

Working With GTFS

Checking Validity

Transport routing operations require services that run upon a specified date. It is a useful sanity check to confirm that the dates that you expect to perform routing on exist within the GTFS feed. To do this, we can use the get_dates() method to print out the first and last date in the available date range, as below.

-
+
s0, e0 = feed.get_dates()
 print(f"Feed starts at: {s0}\nFeed ends at: {e0}")
-
Feed starts at: 20240618
-Feed ends at: 20240919
+
Feed starts at: 20240623
+Feed ends at: 20240922
@@ -506,15 +506,10 @@

Checking Validity

-
+
feed.get_dates(return_range=False)
-
['20240618',
- '20240619',
- '20240620',
- '20240621',
- '20240622',
- '20240623',
+
['20240623',
  '20240624',
  '20240625',
  '20240626',
@@ -602,7 +597,10 @@ 

Checking Validity

'20240916', '20240917', '20240918', - '20240919']
+ '20240919', + '20240920', + '20240921', + '20240922']
@@ -621,10 +619,10 @@

Checking Validity

-
+
feed.is_valid(validation_kwargs={"far_stops": False})
-
  0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmp4yt_16vr/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmp4yt_16vr/intercity_rail_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  6.59it/s]Validating GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  6.59it/s]           Validating GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  2.07s/it]Validating GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  1.78s/it]
+
  0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.96it/s]Validating GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.96it/s]           Validating GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  2.12s/it]Validating GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  1.83s/it]
@@ -648,7 +646,7 @@

Checking Validity

Unrecognized column feed_id feed_info [] -/tmp/tmp4yt_16vr/intercity_rail_gtfs.zip +/tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip 1 @@ -656,7 +654,7 @@

Checking Validity

Unrecognized column conv_rev feed_info [] -/tmp/tmp4yt_16vr/intercity_rail_gtfs.zip +/tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip 2 @@ -664,7 +662,7 @@

Checking Validity

Unrecognized column plan_rev feed_info [] -/tmp/tmp4yt_16vr/intercity_rail_gtfs.zip +/tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip 3 @@ -672,7 +670,7 @@

Checking Validity

Repeated pair (trip_id, departure_time) stop_times [236, 239, 241, 243, 245, 248, 251, 253, 254, ... -/tmp/tmp4yt_16vr/rtm_gtfs.zip +/tmp/tmpzz1v5nxn/rtm_gtfs.zip 4 @@ -680,7 +678,7 @@

Checking Validity

Stop has no stop times stops [2135] -/tmp/tmp4yt_16vr/rtm_gtfs.zip +/tmp/tmpzz1v5nxn/rtm_gtfs.zip @@ -706,12 +704,12 @@

Viz Stops

Inspect the MultiGtfsInstance docstring for the appropriate method.

-
+
feed.viz_...()
-
+
feed.viz_stops()
Make this Notebook Trusted to load map: File -> Trust Notebook
@@ -1053,10 +1051,10 @@

By Bounding Box

Pass the BBOX list in [xmin, ymin, xmax, ymax] order to the filter_to_bbox() method.

-
+
feed.filter_to_bbox(BBOX)
-
  0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmp4yt_16vr/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]           Filtering GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  8.23it/s]Filtering GTFS from path /tmp/tmp4yt_16vr/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  8.20it/s]
+
  0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmpzz1v5nxn/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]           Filtering GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  6.40it/s]Filtering GTFS from path /tmp/tmpzz1v5nxn/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  6.39it/s]
@@ -1064,7 +1062,7 @@

By Bounding Box

Notice that a progress bar confirms the number of successful filter operations performed depending on the number of separate GTFS zip files passed to MultiGtfsInstance.

Below I plot the filtered feed stop locations in relation to the bounding box used to restrict the feed’s extent.

-
+
imap = feed.viz_stops()
 poly_gdf.explore(m=imap)
@@ -1095,7 +1093,7 @@

By Bounding Box