Skip to content

Commit

Permalink
chore: merged with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-moss committed Nov 13, 2023
2 parents cab799d + fda1e1b commit 9a35f0c
Show file tree
Hide file tree
Showing 28 changed files with 2,850 additions and 176 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/all-os-tests.yml

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies and run only integration tests
# This is a standalone runner such that if integration testing fails it does not
# impact other runners.
# Fixing OS version to avoid breaking OS changes during development stage.
# Will open up OS versions before release.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: MacOS Integration Tests

on:
push:
pull_request:
branches: [ "dev", "main" ]

jobs:
build:
name: Integration
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: ["macos-12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Check Java Install
run: |
java --version
- name: Install mac depencies with brew # not updating brew version, issue with aom
run: |
brew install geos
brew install osmosis
shell: sh
- name: Run Integration Tests Only
run: |
pytest -m runinteg --runinteg --ignore tests/analyse_network --deselect tests/gtfs/test_gtfs_utils.py::TestBboxFilterGtfs::test_bbox_filter_gtfs_to_date_builds_network
50 changes: 50 additions & 0 deletions .github/workflows/python-package-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies and run tests on Linux OS.
# Fixing OS version to avoid breaking OS changes during development stage.
# Will open up OS versions before release.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Linux Full Test Suite

on:
push:
pull_request:
branches: [ "dev", "main" ]

jobs:
build:
name: Full
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: ["ubuntu-22.04"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Check Java Install
run: |
java --version
- name: Install linux depencies with apt
run: |
sudo apt update
sudo apt install -y libgeos-dev
sudo apt install -y osmosis
shell: sh
- name: Test with pytest
run: |
pytest
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# This workflow will install Python dependencies, run tests and lint with Python 3.9
# This workflow will install Python dependencies, pre-commit checks, run tests and generate Coverage report
# Not caching pip dependencies in this runner to catch breaking changes in unpinned dependencies
# Fixing OS version to avoid breaking OS changes during development stage.
# Will open up OS versions before release.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: MacOS Full Test Suite and Coverage

on:
push:
Expand All @@ -10,12 +13,14 @@ on:

jobs:
build:
name: Full & Coverage
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: ["macos-latest", "ubuntu-latest"]
os: ["macos-12"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -34,36 +39,20 @@ jobs:
- name: Check Java Install
run: |
java --version
- name: Install mac depencies with brew
if: runner.os == 'macOS' # not updating brew version, issue with aom
- name: Install mac depencies with brew # not updating brew version, issue with aom
run: |
brew install geos
brew install osmosis
shell: sh
- name: Install linux depencies with apt
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y libgeos-dev
sudo apt install -y osmosis
shell: sh
- name: Run Integration Tests
run: |
pytest -m runinteg --runinteg # run only those tests marked runinteg
- name: pre-commit
run: |
pre-commit install
pre-commit run --all-files
- name: Test with pytest
run: |
pytest
- name: Generate Report
if: runner.os == 'macOS' # run coverage report only on macOS
- name: Run Tests and Generate Coverage Report
run: |
coverage run -m pytest
coverage xml
- name: Upload coverage reports to Codecov
if: runner.os == 'macOS' # run coverage report only on macOS
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/python-package-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will install OS dependencies and run a 'base' set of unit tests with Python 3.9
# The base set is selected based on dependencies that have previously caused issues on Windows
# Will look to open up the windows test suite in the future.
# Fixing OS version to avoid breaking OS changes during development stage.
# Will open up OS versions before release.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Windows Partial Test Suite

on:
push:
pull_request:
branches: [ "dev", "main" ]

jobs:
build:
name: Partial
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
os: ["windows-2022"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Print windows version
run: |
cmd /c ver
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install kaleido==0.1.0.post1 # fixing kaleido version within runner, known issue: https://github.com/plotly/Kaleido/issues/134
- name: Run 'base' Tests
run: |
pytest --ignore tests/osm/ --ignore tests/analyse_network --deselect tests/gtfs/test_gtfs_utils.py::TestBboxFilterGtfs::test_bbox_filter_gtfs_to_date_builds_network
6 changes: 5 additions & 1 deletion .github/workflows/sphinx-render.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Fixing OS version to avoid breaking OS changes during development stage.
# Will open up OS versions before release.

name: "Render docs"

on: push
Expand All @@ -8,7 +11,8 @@ env:

jobs:
build:
runs-on: ubuntu-latest
name: Sphinx
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
Expand Down
21 changes: 21 additions & 0 deletions LICENSE.note
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The transport_performance package as a whole is distributed under MIT license
(see file LICENSE). The transport_performance package includes other open
source software components. The following is a list of these components:

* /./src/transport_performance/data/gtfs/route_lookup.pkl This table is the
result of a pandas concatenation of 2 scraped HTML tables:
1. [GTFS route_type table](https://gtfs.org/schedule/reference/#routestxt)
©Mobility Data, distributed under
[Creative Commons 3.0](https://creativecommons.org/licenses/by/3.0/)
2. [Google Extended Route Type Schema](https://developers.google.com/transit/gtfs/reference/extended-route-types)
©Google, distributed under
[Creative Commons 4.0](https://creativecommons.org/licenses/by/4.0/)
* /./tests/data/newport-2023-06-13.osm.pbf Sourced from
[Geofabrik Download Server](https://www.geofabrik.de/data/download.html).
©OpenStreetMap,
This file is made available under the Open Database License:
http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual
contents of the database are licensed under the Database Contents License:
http://opendatacommons.org/licenses/dbcl/1.0/
* /./tests/data/gtfs/newport-20230613_gtfs.zip ©Crown Copyright. Licensed under
[Open Government Licence 3.0](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--- Badges start --->
<img src="https://img.shields.io/badge/repo%20status-in%20development%20(caution)-red" alt="Repository status is still in development (caution required)"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/python-package.yml/badge.svg" alt="Build status badge"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/sphinx-render.yml/badge.svg" alt="Docs status badge"/> <a href="https://codecov.io/gh/datasciencecampus/transport-network-performance" > <img src="https://codecov.io/gh/datasciencecampus/transport-network-performance/branch/dev/graph/badge.svg?token=ZKJFT321CN"/></a>
<img src="https://img.shields.io/badge/repo%20status-in%20development%20(caution)-red" alt="Repository status is still in development (caution required)"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/python-package-mac.yml/badge.svg" alt="Build status badge on mac"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/python-package-linux.yml/badge.svg" alt="Build status badge on linux"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/python-package-windows.yml/badge.svg" alt="Build status badge on windows"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/integration-tests.yml/badge.svg" alt="Integration Tests"/> <img src="https://github.com/datasciencecampus/transport-network-performance/actions/workflows/sphinx-render.yml/badge.svg" alt="Docs status badge"/> <a href="https://codecov.io/gh/datasciencecampus/transport-network-performance" > <img src="https://codecov.io/gh/datasciencecampus/transport-network-performance/branch/dev/graph/badge.svg?token=ZKJFT321CN"/></a>

<!--- Badges end --->

Expand Down
71 changes: 71 additions & 0 deletions notebooks/e2e/config/e2e_leeds.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
title = "Config for an E2E example around the Leeds area"

# `override` variable in the sections below can be used to skip over stages
# which take some time to execute. When running for the first time, it is
# necessary to set these variables to `true` so that the intermediate and
# processed data sources can be built. Afterwards, feel free to set these to
# `false` to avoid rebuilding 'expensive' processed inputs.
# Use the `write_outputs` flags below to control whether or not to write
# geneerated outputs to file (useful if you do not want to overwrite results).

[urban_centre] # configuration section for urban centre
override = true
input_dir = "data/external/urban_centre/"
merged_path = "data/processed/urban_centre/leeds_uc_merged.tif"
bbox = [
-145000.0,
6247000.0,
-93000.0,
6282000.0
] # must in in 'ESRI:54009'
centre = [-119000.0, 6264500.0]
buffer_size = 12000
write_outputs = true
output_map_path = "outputs/e2e/leeds/urban_centre/urban_centre_map.html"

[population] # configuration section for population
override = true
input_dir = "data/external/population/"
merged_path = "data/interim/population/pop_merged.tif"
merged_resampled_path = "data/processed/population/pop_merged_resampled.tif"
threshold = 1 # set small and positive, to remove 0 pop cells
write_outputs = true
output_map_path = "outputs/e2e/population/leeds/population_map.html"

[gtfs] # configuration section for gtfs
override = true
input_path = "data/external/gtfs/itm_england_gtfs.zip"
filtered_path = "data/interim/gtfs/itm_leeds_filtered_gtfs.zip"
units = "km"
write_outputs = true
cleaned_path = "data/processed/gtfs/itm_leeds_filtered_cleaned_gtfs.zip"
stops_map_path = "outputs/e2e/leeds/gtfs/stops_map.html"
hull_map_path = "outputs/e2e/leeds/gtfs/hull_map.html"
used_stops_map_path = "outputs/e2e/leeds/gtfs/used_stops_map.html"

[osm] # configuration section for osm clipping
override = true
input_path = "data/external/osm/england-latest.osm.pbf"
filtered_path = "data/processed/osm/leeds_latest_filtered.osm.pbf"
tag_filter = false

[analyse_network] # configuration for the analyse_network stage
departure_year = 2023
departure_month = 10
departure_day = 24 # this is the date, not the day of the week
departure_hour = 8
departure_minute = 0
departure_time_window = 1 # this is in hours
max_time = 45 # this is in minutes
write_outputs = true
outputs_dir = "outputs/e2e/leeds/analyse_network/"
qa_travel_times = false # set to true to qa results with `qa_path`
qa_path = "outputs/e2e/leeds/analyse_network/travel_times.pkl"
save_travel_times_for_qa = true # set to true to write to `save_qa_path`
save_qa_path = "outputs/e2e/leeds/analyse_network/travel_times.pkl"

[metrics] # configuration for the metrics stage
cut_off_time = 45 # this is in minutes
cut_off_distance = 11250 # this is in meters
write_outputs = true
outputs_dir = "outputs/e2e/leeds/metrics/"
Loading

0 comments on commit 9a35f0c

Please sign in to comment.