Skip to content

Commit

Permalink
chore: Bring up to speed with changes in dev branch
Browse files Browse the repository at this point in the history
  • Loading branch information
r-leyshon committed Aug 26, 2024
2 parents 59f4858 + 6ecfb39 commit e6d18f3
Show file tree
Hide file tree
Showing 47 changed files with 261 additions and 252 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Runs the test suite.
# Runs the test suite, including intergration and sanity checks - do not
# release to PYPI if anything fails.
# Triggered on tagged release.
# If tests pass, uses hatch to build the distribution, releases with GitHub &
# deploys to PyPI.
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/integration-tests.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/python-package-linux.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/python-package-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.9", "3.10", "3.11"]
os: ["macos-12"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # sha for 4.1.7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-package-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
python-version: ["3.9", "3.10", "3.11"]
os: ["windows-2022"]
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # sha for 4.1.7
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/quarto-render.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install '.[docs]'
- name: Install java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # sha for 4.2.1
with:
distribution: 'temurin'
java-version: '11.0.21'
- name: Check Java Install
run: |
java --version
- name: Install linux depencies with apt
run: |
sudo apt update
Expand Down
15 changes: 8 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ docs/tutorials/outputs/
# exception for test fixtures/package data
!tests/data/newport-2023-06-13.osm.pbf
!tests/data/chester-20230816-small_gtfs.zip
!tests/data/gtfs/newport-20230613_gtfs.zip
!src/assess_gtfs/data/gtfs/route_lookup.pkl
!tests/data/gtfs/report/html_template.html
!tests/data/newport-20230613_gtfs.zip
!src/assess_gtfs/data/route_lookup.pkl
!src/assess_gtfs/data/newport-20230613_gtfs.zip
!tests/data/report/html_template.html

# exception for html templates
!src/assess_gtfs/data/gtfs/report/html_templates/evaluation_template.html
!src/assess_gtfs/data/gtfs/report/html_templates/stops_template.html
!src/assess_gtfs/data/gtfs/report/html_templates/summary_template.html
!src/assess_gtfs/data/report/html_templates/evaluation_template.html
!src/assess_gtfs/data/report/html_templates/stops_template.html
!src/assess_gtfs/data/report/html_templates/summary_template.html

### Project structure ###
data/*
Expand Down Expand Up @@ -187,7 +188,7 @@ docs/build/
!docs/source/_templates/footer.html
docs/_sidebar.yml
docs/reference/
!docs/_static/tp_logo_white_background.png
!docs/_static/assess-gtfs.png
!docs/explanation/**/*.PNG

# PyBuilder
Expand Down
45 changes: 8 additions & 37 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,22 @@ Install Dependencies:

Package set-up and installation:

1. Setup a new conda env: `conda create -n r5py python=3.9.13`
2. Activate the environment: `conda activate r5py`
1. Setup a new conda env: `conda create -n assess-gtfs python=3.11 -y`
2. Activate the environment: `conda activate assess-gtfs`
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`
4. Clone this repo, eg with https: `git clone https://github.com/datasciencecampus/assess_gtfs.git`
5. Change directory to the repo: `cd assess_gtfs`
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 with all dependencies: `pip install -e '.[test,dev,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 set-up pytests: `pytest --runinteg`.
11. If everything is working as expected, you should see a full test suite
pass.
12. If you've made it this far, you've earned yourself a coffee.

#### Dependencies

##### Geos

`geos` is a dependency of the python package `cartopy`, which is used here for building and visualising static maps. See [this cartopy installation guidance note](https://github.com/SciTools/cartopy/blob/main/INSTALL) for more details on the installation process.

For macOS, this is straight forward using `brew`:

```console
brew install geos
```

##### Java Development Kit
Java is required for handling the transport network routing. Openjdk 11 is recommended by r5py docs. [sdkman](https://sdkman.io/) is used here.

> Note: for macOS on ARM architectures (M1/M2 machines), sdkman does not currently provide a suitable openjdk11 version. Instead you can follow this [blog post, which introduces Java version mangaement using `jEnv`](https://blog.bigoodyssey.com/how-to-manage-multiple-java-version-in-macos-e5421345f6d0), and install AdoptOpenJDK-11.
1. Get sdkman: `curl -s "https://get.sdkman.io" | bash`
2. Follow instructions in terminal, you’ll be asked to: `source “<SOME_PATH>.sdkman/bin/sdkman-init.sh"`
This will add sdkman env variables to: `~/.bash_profile` and possibly `~/.zshrc` too.
3. To see versions available on your os: `sdk list java`
4. Install the required version using the `identifier` column, eg: `sdk install java 11.0.19-amzn`
5. Check this is the currenty used java version: `sdk current java`.

##### Pyosmium Requirements

Pyosmium needs to integrate with C++ Osmium, therefore you will need the
following dependencies installed on macos:
* `brew install boost`
* `brew install cmake`

### Pre-commit actions
This repository contains a configuration of pre-commit hooks. These are language agnostic and focussed on repository security (such as detection of passwords and API keys). If approaching this project as a developer, you are encouraged to install and enable `pre-commits` by running the following in your shell:
Expand Down
15 changes: 7 additions & 8 deletions LICENSE.note
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
The assess_gtfs package as a whole is distributed under MIT license
(see file LICENSE). The assess_gtfs package includes other open
The assess-gtfs package as a whole is distributed under MIT license
(see file LICENSE). The assess-gtfs package includes other open
source software components. The following is a list of these components:

* /./src/assess_gtfs/data/route_lookup.pkl This table is the
* /./src/assess-gtfs/data/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
* /./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/)
* /./tests/data/osm/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:
©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/)
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!--- 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/assess_gtfs/actions/workflows/python-package-mac.yml/badge.svg" alt="Build status badge on mac"/><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/python-package-linux.yml/badge.svg" alt="Build status badge on linux"/><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/python-package-windows.yml/badge.svg" alt="Build status badge on windows"/><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/integration-tests.yml/badge.svg" alt="Integration Tests"/><img src="https://codecov.io/github/datasciencecampus/assess_gtfs/graph/badge.svg?token=iEWElAdksI" alt="Codecov coverage result"/><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/assess-gtfs?style=plastic&logo=pypi&logoColor=white&label=PyPI%20downloads">
<img src="https://img.shields.io/badge/repo%20status-in%20development%20(caution)-red?style=plastic" alt="Repository status is still in development (caution required)"/><img alt="PyPI - Version" src="https://img.shields.io/pypi/v/assess-gtfs?style=plastic"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/assess-gtfs?style=plastic&logo=pypi&logoColor=white&label=PyPI%20downloads"><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/python-package-mac.yml/badge.svg" alt="Build status badge on mac"/><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/python-package-windows.yml/badge.svg" alt="Build status badge on windows"/><img src="https://github.com/datasciencecampus/assess_gtfs/actions/workflows/build-deploy.yml/badge.svg" alt="Deploy PYPI"/><img src="https://codecov.io/github/datasciencecampus/assess_gtfs/graph/badge.svg?token=iEWElAdksI" alt="Codecov coverage result"/>

<!--- Badges end --->

<img src="https://github.com/datasciencecampus/awesome-campus/blob/master/ons_dsc_logo.png">

# assess_gtfs
# assess-gtfs

> :warning: This repository is still in the development phase. Caution should
be taken before using or referencing this work in any way - use it at your own
Expand All @@ -14,7 +14,7 @@ risk.
## Introduction
<!-- *Describe what this repo contains and what the project is.* -->

`assess_gtfs` provides a method for inspecting and validating General Transit
`assess-gtfs` provides a method for inspecting and validating General Transit
Feed Specification.

## Developers
Expand All @@ -27,8 +27,7 @@ We welcome contributions from others. Please check out our

### Installation

This package is designed to work with python 3.11. Full functionality is
tested on macos only.
This package is designed to work with python 3.9, 3.10 and 3.11.

We recommend running the package with a virtual environment such as
[conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
Expand Down
4 changes: 2 additions & 2 deletions _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ website:
title: "Assess GTFS"
favicon: docs/_static/favicon.ico
navbar:
logo: docs/_static/tp_logo_white_background.png
logo: docs/_static/assess-gtfs.png
left:
- href: docs/getting_started/index.qmd
text: Getting Started
Expand Down Expand Up @@ -61,7 +61,7 @@ metadata-files:

quartodoc:
title: API reference
package: transport_performance
package: assess-gtfs
dir: docs/reference
sidebar: docs/_sidebar.yml
sections:
Expand Down
Binary file added docs/_static/assess-gtfs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/_static/tp_logo_white_background.png
Binary file not shown.
Loading

0 comments on commit e6d18f3

Please sign in to comment.