Skip to content

Commit

Permalink
chotre: Prep small osm fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
r-leyshon committed Nov 8, 2023
1 parent 35557f9 commit ffaea6c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# exception for test fixtures/package data
!tests/data/newport-2023-06-13.osm.pbf
!tests/data/small-osm.pbf
!tests/data/chester-20230816-small_gtfs.zip
!tests/data/gtfs/newport-20230613_gtfs.zip
!src/transport_performance/data/gtfs/route_lookup.pkl
Expand Down
16 changes: 16 additions & 0 deletions scripts/prep-fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import gtfs_kit as gk
import geopandas as gpd
from shapely.geometry import box
from pyprojroot import here

from transport_performance.osm.osm_utils import filter_osm


fix_dat = os.path.join("tests", "data", "gtfs")
gtfs_zip = [
Expand All @@ -31,3 +35,15 @@
feed=newport_feed, dates=[date_today]
)
newport_today.write(os.path.join(fix_dat, f"newport-{date_today}_gtfs.zip"))

# prepare small osm fixture for costly validate_osm tests

FIX_PTH = here("tests/data/")
NEWPORT_OSM = os.path.join(FIX_PTH, "newport-2023-06-13.osm.pbf")
OUT_PTH = os.path.join(FIX_PTH, "small-osm.pbf")

filter_osm(
pbf_pth=NEWPORT_OSM,
out_pth=OUT_PTH,
bbox=[-3.0224023262, 51.5668731118, -3.0199831413, 51.5685191918],
)
Binary file added tests/data/small-osm.pbf
Binary file not shown.

0 comments on commit ffaea6c

Please sign in to comment.