Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

297 restructure package #299

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.9", "3.10", "3.11"]
os: ["macos-12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # SHA for v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@9a7ac94420f42ee15fc60ab88d0dca4be1fd5757 # SHA for v5.1.0
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
pip install '.[test]'
- name: Install java
uses: actions/setup-java@v3
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # SHA for v4.2.1
with:
distribution: 'temurin'
java-version: '11.0.21'
Expand All @@ -47,6 +47,9 @@ jobs:
brew install --build-from-source ./osmosis.rb
brew info osmosis
shell: sh
- name: Run Integration Tests Only
run: |
pytest -m runinteg --runinteg --ignore tests/analyse_network --ignore tests/test_analyse_network.py --deselect tests/gtfs/test_gtfs_utils.py::TestBboxFilterGtfs::test_bbox_filter_gtfs_to_date_builds_network
- name: Run Integration Tests with retry
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # SHA for v3.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: pytest -m runinteg --runinteg --ignore tests/analyse_network --ignore tests/test_analyse_network.py
19 changes: 11 additions & 8 deletions .github/workflows/python-package-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.9", "3.10", "3.11"]
os: ["ubuntu-22.04"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # SHA for v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@9a7ac94420f42ee15fc60ab88d0dca4be1fd5757 # SHA for v5.1.0
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
pip install '.[test]'
- name: Install java
uses: actions/setup-java@v3
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # SHA for v4.2.1
with:
distribution: 'temurin'
java-version: '11.0.21'
Expand All @@ -44,6 +44,9 @@ jobs:
sudo apt update
sudo apt install -y libgeos-dev
shell: sh
- name: Test with pytest
run: |
pytest
- name: Test with retry
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # SHA for v3.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: pytest
24 changes: 14 additions & 10 deletions .github/workflows/python-package-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.9", "3.10", "3.11"]
os: ["macos-12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # SHA for v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@9a7ac94420f42ee15fc60ab88d0dca4be1fd5757 # SHA for v5.1.0
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
pip install '.[dev,test]'
- name: Install java
uses: actions/setup-java@v3
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # SHA for v4.2.1
with:
distribution: 'temurin'
java-version: '11.0.21'
Expand All @@ -48,12 +48,16 @@ jobs:
run: |
pre-commit install
pre-commit run --all-files
- name: Run Tests and Generate Coverage Report
run: |
coverage run -m pytest
coverage xml
- name: Base tests with retry
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # SHA for v3.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: |
coverage run -m pytest
coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@ab904c41d6ece82784817410c45d8b8c02684457 # SHA for v3.1.6
with:
file: ./coverage.xml
flags: unittests
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/python-package-windows.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will install OS dependencies and run a 'base' set of unit tests with Python 3.9
# This workflow will install OS dependencies and run a 'base' set of unit tests with Python 3.9, 3.10, 3.11
# 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.
Expand All @@ -20,12 +20,12 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
python-version: ["3.9", "3.10", "3.11"]
os: ["windows-2022"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # SHA for v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@9a7ac94420f42ee15fc60ab88d0dca4be1fd5757 # SHA for v5.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -35,8 +35,10 @@ jobs:
- 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 --ignore tests/test_analyse_network.py --deselect tests/gtfs/test_gtfs_utils.py::TestBboxFilterGtfs::test_bbox_filter_gtfs_to_date_builds_network
pip install '.[test]'
- name: Base tests with retry
uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # SHA for v3.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: pytest --ignore tests/osm/ --ignore tests/analyse_network --ignore tests/test_analyse_network.py
14 changes: 7 additions & 7 deletions .github/workflows/quarto-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # SHA for v4.1.7
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@9a7ac94420f42ee15fc60ab88d0dca4be1fd5757 # SHA for v5.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install '.[docs]'
- name: Install java
uses: actions/setup-java@v3
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # SHA for v4.2.1
with:
distribution: 'temurin'
java-version: '11.0.21'
Expand All @@ -44,9 +44,9 @@ jobs:
run: |
python -m quartodoc build
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
uses: quarto-dev/quarto-actions/setup@c1b50d36cf3c22b3dc7e530bd1b36634e824e545 # SHA for v2.1.4
- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
uses: quarto-dev/quarto-actions/publish@c1b50d36cf3c22b3dc7e530bd1b36634e824e545 # SHA for v2.1.4
with:
target: gh-pages
env:
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ Install Dependencies:

Package set-up and installation:

1. Setup a new conda env: `conda create -n r5py python=3.9.13`
1. Setup a new conda env: `conda create -n r5py python=3.11`
2. Activate the environment: `conda activate r5py`
3. Launch terminal and change directory to wherever you keep your GitHub repos: `cd ~/Documents`
4. Clone this repo, eg with https: `git clone https://github.com/datasciencecampus/transport-network-performance.git`
5. Change directory to the repo: `cd transport-network-performance`
6. Install pre-commit hooks: `pre-commit install`
7. Update pip: `pip install --upgrade pip`
8. Install r5py & other reqs: `pip install -r requirements.txt`
8. Install package & dependencies: `pip install -e '.[dev,test,docs]'`

Set-up check:

10. Run set-up pytests: `pytest --runsetup`.
11. If everything is working as expected, you should see some Java flavoured warnings about `--illegal-access` that you can ignore. But importantly look out for the message: `r5py has created the expected database files.`
10. Run `pytest --runinteg --runexpensive` to check test suite passes.
11. If everything is working as expected, you should see some Java flavoured warnings about `--illegal-access` that you can ignore. But importantly look out for any fails or errors in the pytest report.
12. If you've made it this far, you've earned yourself a coffee.

#### Dependencies
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ We welcome contributions from others. Please check out our
## Installation
*Describe technical set-up. Such as the required dependencies.*

This package is designed to work with python 3.9.13. Full functionality is
tested on macos only. Other operating systems may be incompatible with
`transport_performance.osm` specifically.
This package is designed to work with python 3.9, 3.10 & 3.11. Full
functionality is tested on macos only. Other operating systems may be
incompatible with `transport_performance.osm` specifically.

The transport modelling features in `transport_performance.analyse_network`
depends upon a compatible Java Development Kit (JDK). Please consult the
Expand All @@ -63,15 +63,15 @@ or [venv](https://docs.python.org/3/library/venv.html).

With conda:
```
conda create -n transport-performance python=3.9.13 -y
conda create -n transport-performance python=3.11 -y
```
Once completed, activate the environment:
```
conda activate transport-performance
```
Install the python requirements:
Install the python package:
```
pip install -r requirements.txt
pip install .
```
Additional Java dependencies are required for full functionality. See the
[contributing guidance](./CONTRIBUTING.md) for assistance.
Expand Down
15 changes: 0 additions & 15 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ project:
- "!docs/source/"
- "!docs/build/"
- "!*.ipynb"
- "!docs/gtfs/*"
preview:
port: 1111
browser: true
Expand Down Expand Up @@ -56,14 +55,12 @@ website:
href: docs/how_to/index.qmd
contents:
- "docs/how_to/uc_pop/index.qmd"
- "docs/how_to/gtfs/index.qmd"
- "docs/how_to/osm/index.qmd"
- section: Tutorials
href: docs/tutorials/index.qmd
contents:
- "docs/tutorials/urban_centre/index.qmd"
- "docs/tutorials/population/index.qmd"
- "docs/tutorials/gtfs/index.qmd"
- "docs/tutorials/osm/index.qmd"
- "docs/tutorials/analyse_network/index.qmd"
- "docs/tutorials/metrics/index.qmd"
Expand Down Expand Up @@ -120,18 +117,6 @@ quartodoc:
package: transport_performance.population.rasterpop
contents:
- RasterPop
- title: "`gtfs`"
desc: >
Modules for working with GTFS public transit schedule files.
package: transport_performance.gtfs
contents:
- calendar
- cleaners
- gtfs_utils
- multi_validation
- routes
- validation
- validators
- title: "`osm`"
desc: >
Modules for OpenStreetMap utilities, such are cropping .pbf files to a bounding box.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/analyse_network/index.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "5. Analyse Network"
title: "4. Analyse Network"
description: Learn how to use the `transport_performance.analyse_network` module through examples.
date-modified: 05/17/2024 # must be in MM/DD/YYYY format
categories: ["Tutorial"] # see https://diataxis.fr/tutorials-how-to/#tutorials-how-to, delete as appropriate
Expand Down
Loading
Loading