diff --git a/.nojekyll b/.nojekyll index afcb223..ce020f3 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -23eff278 \ No newline at end of file +8c620ab8 \ No newline at end of file diff --git a/docs/reference/validation.html b/docs/reference/validation.html index 0b907f6..612a6ca 100644 --- a/docs/reference/validation.html +++ b/docs/reference/validation.html @@ -470,16 +470,16 @@

Methods

clean_feed
-

validation.GtfsInstance.clean_feed(validate=False, fast_travel=True)

+

validation.GtfsInstance.clean_feed(validate=False, fast_travel=False)

Attempt to clean feed using gtfs_kit.

Parameters
----++++ @@ -493,14 +493,14 @@
Parameters
- + - - + +
validate boolWhether or not to validate the dataframe before cleaningWhether or not to validate the dataframe before cleaning, by default False. False
fast_travel boolWhether or not to clean warnings related to fast travel.TrueWhether or not to clean warnings related to fast travel, by default False.False
@@ -689,7 +689,7 @@
Returns
html_report
-

validation.GtfsInstance.html_report(report_dir='outputs', overwrite=False, summary_type='mean', extended_validation=True, clean_feed=True)

+

validation.GtfsInstance.html_report(report_dir='outputs', overwrite=False, summary_type='mean', extended_validation=False, clean_feed=True)

Generate a HTML report describing the GTFS data.

Parameters
@@ -730,8 +730,8 @@
Parameters
extended_validation bool -Whether or not to create extended reports for gtfs validation errors/warnings, by default True -True +Whether or not to create extended reports for gtfs validation errors/warnings, by default False +False clean_feed @@ -783,16 +783,16 @@
Raises
is_valid
-

validation.GtfsInstance.is_valid(far_stops=True)

+

validation.GtfsInstance.is_valid(far_stops=False)

Check a feed is valid with gtfs_kit.

Parameters
-+--++ @@ -806,8 +806,8 @@
Parameters
- - + +
far_stops boolWhether or not to perform validation for far stops (both between consecutive stops and over multiple stops)TrueWhether or not to perform validation for far stops (both between consecutive stops and over multiple stops), by default False.False
diff --git a/docs/tutorials/index.html b/docs/tutorials/index.html index 5447c96..6d7eeef 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     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0 4773k    0 35879    0     0  25772      0  0:03:09  0:00:01  0:03:08 25775 21 4773k   21 1020k    0     0   440k      0  0:00:10  0:00:02  0:00:08  440k 60 4773k   60 2889k    0     0   882k      0  0:00:05  0:00:03  0:00:02  882k100 4773k  100 4773k    0     0  1182k      0  0:00:04  0:00:04 --:--:-- 1182k
+  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0  8 4769k    8  402k    0     0   276k      0  0:00:17  0:00:01  0:00:16  276k 82 4769k   82 3923k    0     0  1630k      0  0:00:02  0:00:02 --:--:-- 1630k100 4769k  100 4769k    0     0  1853k      0  0:00:02  0:00:02 --:--:-- 1853k
   % 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     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0100 86185  100 86185    0     0   111k      0 --:--:-- --:--:-- --:--:--  111k
+ 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0100 86133 100 86133 0 0 161k 0 --:--:-- --:--:-- --:--:-- 162k
-
CompletedProcess(args=['curl', 'https://eu.ftp.opendatasoft.com/sncf/gtfs/export-intercites-gtfs-last.zip', '-o', '/tmp/tmp104_krhg/intercity_rail_gtfs.zip'], returncode=0)
+
CompletedProcess(args=['curl', 'https://eu.ftp.opendatasoft.com/sncf/gtfs/export-intercites-gtfs-last.zip', '-o', '/tmp/tmpv4nsw7b2/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: 20240624
-Feed ends at: 20240923
+Feed ends at: 20240924
@@ -506,7 +506,7 @@

Checking Validity

-
+
feed.get_dates(return_range=False)
['20240624',
@@ -600,7 +600,8 @@ 

Checking Validity

'20240920', '20240921', '20240922', - '20240923']
+ '20240923', + '20240924']
@@ -619,10 +620,10 @@

Checking Validity

-
+
feed.is_valid(validation_kwargs={"far_stops": False})
-
  0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmp104_krhg/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmp104_krhg/intercity_rail_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.99it/s]Validating GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.99it/s]           Validating GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  2.09s/it]Validating GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  1.81s/it]
+
  0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Validating GTFS from path /tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.77it/s]Validating GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  4.77it/s]           Validating GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  2.14s/it]Validating GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip: 100%|██████████| 2/2 [00:03<00:00,  1.85s/it]
@@ -646,7 +647,7 @@

Checking Validity

Unrecognized column feed_id feed_info [] -/tmp/tmp104_krhg/intercity_rail_gtfs.zip +/tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip 1 @@ -654,7 +655,7 @@

Checking Validity

Unrecognized column conv_rev feed_info [] -/tmp/tmp104_krhg/intercity_rail_gtfs.zip +/tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip 2 @@ -662,23 +663,31 @@

Checking Validity

Unrecognized column plan_rev feed_info [] -/tmp/tmp104_krhg/intercity_rail_gtfs.zip +/tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip 3 warning +Route has no trips +routes +[128, 129] +/tmp/tmpv4nsw7b2/rtm_gtfs.zip + + +4 +warning Repeated pair (trip_id, departure_time) stop_times [236, 239, 241, 243, 245, 248, 251, 253, 254, ... -/tmp/tmp104_krhg/rtm_gtfs.zip +/tmp/tmpv4nsw7b2/rtm_gtfs.zip - -4 + +5 warning Stop has no stop times stops -[2134] -/tmp/tmp104_krhg/rtm_gtfs.zip +[2134, 2666] +/tmp/tmpv4nsw7b2/rtm_gtfs.zip @@ -704,12 +713,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
@@ -1051,10 +1060,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/tmp104_krhg/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]           Filtering GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  5.79it/s]Filtering GTFS from path /tmp/tmp104_krhg/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  5.78it/s]
+
  0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip:   0%|          | 0/2 [00:00<?, ?it/s]Filtering GTFS from path /tmp/tmpv4nsw7b2/intercity_rail_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  9.12it/s]Filtering GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip:  50%|█████     | 1/2 [00:00<00:00,  9.12it/s]           Filtering GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  5.70it/s]Filtering GTFS from path /tmp/tmpv4nsw7b2/rtm_gtfs.zip: 100%|██████████| 2/2 [00:00<00:00,  6.03it/s]
@@ -1062,7 +1071,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)
@@ -1093,7 +1102,7 @@

By Bounding Box