Skip to content

Commit

Permalink
Merge branch 'main' into fix-reading-java-array
Browse files Browse the repository at this point in the history
  • Loading branch information
KasiaKoz committed Jan 31, 2024
2 parents 19b8390 + 127fcf0 commit d0891cf
Show file tree
Hide file tree
Showing 67 changed files with 1,102 additions and 1,265 deletions.
86 changes: 0 additions & 86 deletions .github/workflows/build_pipeline.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/commit-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Minimal CI

on:
push:
branches:
- "**"
paths-ignore:
- README.md
- CHANGELOG.md
- LICENSE
- CONTRIBUTING.md
- docs/**
- mkdocs.yml

jobs:
test:
uses: arup-group/actions-city-modelling-lab/.github/workflows/python-install-lint-test.yml@main
with:
os: ubuntu-latest
py3version: "11"
notebook_kernel: genet
lint: false
additional_mamba_args: coin-or-cbc

aws-upload:
needs: test
if: needs.test.result == 'success'
uses: arup-group/actions-city-modelling-lab/.github/workflows/aws-upload.yml@main
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_CODE_BUCKET: ${{ secrets.AWS_S3_CODE_BUCKET }}
91 changes: 29 additions & 62 deletions .github/workflows/daily-scheduled-ci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,36 @@
name: Daily GeNet CI Build
name: Daily CI

on:
schedule:
- cron: '37 14 * * 1-5'
- cron: '37 14 * * 1-5' # checks on the 37th minute of the 14th hour every weekday

jobs:
build:
get-date:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-python@v1
with:
python-version: 3.11

- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
export ACCEPT_EULA=Y
sudo apt-get update
python -m pip install --upgrade pip
sudo apt-get install -y python3-pip libgdal-dev locales
sudo apt-get install -y libspatialindex-dev
sudo apt-get install -y coinor-cbc
export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
sudo apt-get install ca-certificates
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
pip install GDAL==3.4.1
pip install -e '.[dev]'
- name: Install jupyter kernel
run: python -m ipykernel install --user --name genet

- name: Run tests
run: pytest

- name: Send build success notification
if: success()
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_MESSAGE: ${{ github.repository }} Daily scheduled CI Build ${{ github.run_number }} has succeeded
SLACK_TITLE: Daily Scheduled CI Build Success
SLACK_CHANNEL: city-modelling-feeds
SLACK_USERNAME: GitHub Build Bot
SLACK_ICON: https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-12-19/288981919427_f45f04edd92902a96859_512.png
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

- name: Send build failure notification
if: failure()
uses: rtCamp/action-slack-notify@v2.2.0
env:
SLACK_COLOR: '#FF0000'
SLACK_LINK_NAMES: true
SLACK_MESSAGE: '<!here> ${{ github.repository }} Daily scheduled CI Build ${{ github.run_number }} has failed'
SLACK_TITLE: Daily Scheduled CI Build Failure!
SLACK_CHANNEL: city-modelling-feeds
SLACK_USERNAME: GitHub Build Bot
SLACK_ICON: https://slack-files2.s3-us-west-2.amazonaws.com/avatars/2017-12-19/288981919427_f45f04edd92902a96859_512.png
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
- name: Add date to github output env
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

test:
needs: get-date
uses: arup-group/actions-city-modelling-lab/.github/workflows/python-install-lint-test.yml@main
with:
os: ubuntu-latest
py3version: "11"
notebook_kernel: genet
pytest_args: '--no-cov' # ignore coverage
cache_mamba_env: false
lint: false
mamba_env_name: daily-ci
additional_mamba_args: coin-or-cbc

slack-notify-ci:
needs: test
if: always()
uses: arup-group/actions-city-modelling-lab/.github/workflows/slack-notify.yml@main
secrets:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
with:
result: needs.test.result
channel: genet-feed
message: Daily CI action
48 changes: 48 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Pull Request CI

on:
pull_request:
branches:
- main
paths-ignore:
- README.md
- CHANGELOG.md
- LICENSE
- CONTRIBUTING.md
- docs/**
- mkdocs.yml

jobs:
test:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
py3version: ["9", "11"]
include:
- os: windows-latest
add_args: ""
- os: ubuntu-latest
add_args: coin-or-cbc
- os: macos-latest
add_args: coin-or-cbc
fail-fast: false
uses: arup-group/actions-city-modelling-lab/.github/workflows/python-install-lint-test.yml@main
with:
os: ${{ matrix.os }}
py3version: ${{ matrix.py3version }}
notebook_kernel: genet
lint: false
pytest_args: '--no-cov' # ignore coverage
upload_to_codecov: false
additional_mamba_args: ${{ matrix.add_args }}

test-coverage:
uses: arup-group/actions-city-modelling-lab/.github/workflows/python-install-lint-test.yml@main
with:
os: ubuntu-latest
py3version: "11"
notebook_kernel: genet
lint: false
pytest_args: 'tests/' # ignore example notebooks
upload_to_codecov: true
additional_mamba_args: coin-or-cbc
15 changes: 3 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ coverage.xml
*.cover
.hypothesis/
.pytest_cache/
reports/

# Translations
*.mo
Expand Down Expand Up @@ -122,15 +123,5 @@ dmypy.json
.pyre/
.idea

tests/test_outputs/
test_chunks.csv
reports/
mprofile*
benchmark-outputs/
working-dir/
scripts/secrets-mgr-exploration.py
*.nbconvert.*
example_data/pt2matsim_network/genet_output/*
genet_output/*
example_data/output_*/*
example_data/api_requests_send.json
# Project specific
examples/example_data/outputs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## [Unreleased]

### Fixed
* Fixed problem snapping and routing PT services with stops whose names started with 'x' [#225](https://github.com/arup-group/genet/pull/225)
* Fixed summary report:
* Intermodal Access/Egress reporting is more general (not expecting just car and bike mode access to PT) [#204](https://github.com/arup-group/genet/pull/204)
* Node/Links numbers were reported incorrectly (switched) [#207](https://github.com/arup-group/genet/pull/207)
Expand Down
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ automated `PEP8` checks and runs unit tests in a fresh environment, as well as i
8. Update/add to or generate a new jupyter notebook in `notebooks` directory which takes the user through your new feature or
change.
1. Jupyter notebooks are closely linked to the [wiki pages](https://github.com/arup-group/genet/wiki).
1. Make sure you follow the naming convention: `number.number. Theme: Catchy Title`
2. Make sure you structure the notebook in a way that you would like to see it in a wiki page, with a lot of
1. Make sure you follow the naming convention to title your page: `number.number. Theme: Catchy Title`
2. Make sure to also name the notebook so that it is machine readable: `number_number_theme_catchy_title.ipynb`
3. Make sure you structure the notebook in a way that you would like to see it in a wiki page, with a lot of
markdown cells containing quality descriptions. Use existing notebook as examples.
2. After your changes have been merged, you may like to update the wiki pages. To do this in an automated way:
1. Clone the wiki part of the repo: ```git clone https://github.com/arup-group/genet.wiki.git```
2. Run the `notebooks/generate_usage_wiki_from_notebooks.py` script, pointing at the folder containing the
2. Run the `examples/generate_usage_wiki_from_notebooks.py` script, pointing at the folder containing the
notebooks and the wiki repo folder to receive the output.
3. You may use example data already in `example_data` directory of this repo, or add more (small amount of) data to
3. You may use example data already in `examples/example_data` directory of this repo, or add more (small amount of) data to
it to show off your new features.
9. Add section in the `README.md` which shows usage of your new feature. This can be paraphrased from the jupyter
notebook in point above.
Expand Down
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM python:3.11.4-bullseye
FROM mambaorg/micromamba:1.5.3-bullseye-slim

RUN apt-get update && \
apt-get upgrade -y && \
apt-get -y install gcc git libgdal-dev libgeos-dev libspatialindex-dev curl coinor-cbc cmake && \
rm -rf /var/lib/apt/lists/*
COPY --chown=$MAMBA_USER:$MAMBA_USER . ./src

RUN python -m pip install --no-cache-dir --compile --upgrade pip
RUN micromamba install -y -n base -c conda-forge -c city-modelling-lab python=3.11 "proj>=9.3" pip coin-or-cbc --file src/requirements/base.txt && \
micromamba clean --all --yes
ARG MAMBA_DOCKERFILE_ACTIVATE=1

COPY . ./src

RUN pip3 install --no-cache-dir --compile -e ./src && pip cache purge
RUN pip install --no-deps ./src

ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]
Loading

0 comments on commit d0891cf

Please sign in to comment.