Skip to content

Commit

Permalink
Merge branch 'bart_transit_improvements' into acceptance-criteria-int…
Browse files Browse the repository at this point in the history
…egration
  • Loading branch information
AshishKuls committed Jan 8, 2024
2 parents 6ce8500 + afde37e commit a638b9c
Show file tree
Hide file tree
Showing 100 changed files with 16,221 additions and 911 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ Progress:
- [ ] Test passes

## To Reproduce

Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

### Failing tests

- [ ] No applicable test failed, need to create.
- [ ] other...specify

Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ labels: enhancement
assignees: ''
---
### User Story

*As a ...insert type of user... I'd like to ...insert desired feature or behavior...*

Progress:
Expand Down
18 changes: 7 additions & 11 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
## What existing problem does the pull request solve and why should we include it?


## What is the testing plan?

*Demonstrate the code is solid by discussing how results are verified and covered by tests*

- [ ] Code for this PR is covered in tests
- [ ] Code passes all existing tests
- [ ] Code for this PR is covered in tests
- [ ] Code passes all existing tests

## Code formatting

*Code should be PEP8 compliant before merging by running a package like [`black`](https://pypi.org/project/black/)*

- [ ] Code linted
- [ ] Code linted

## Applicable Issues

*Please do not create a Pull Request without creating an issue first.*

*Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes.*


#### Issues List

- closes...
- closes...


- closes...
- closes...
30 changes: 30 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Clean Docs for Deleted References
on:
delete:

env:
PYTHON_VERSION: 3.8

jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python $PYTHON_VERSION
uses: actions/setup-python@v2
with:
python-version: $PYTHON_VERSION
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mike
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Delete defunct docs versions
run: |
echo "Deleting ${{ github.event.ref_name }} version from docs"
mike delete --rebase --push ${{ github.event.ref_name }}
14 changes: 14 additions & 0 deletions .github/workflows/flake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main, develop]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
14 changes: 11 additions & 3 deletions .github/workflows/test.yml → .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python package
name: Push Workflow

on: [push]

Expand All @@ -9,20 +9,28 @@ jobs:
if: "!contains(github.event.head_commit.message, 'skip ci')"
strategy:
matrix:
python-version: [3.7, 3.8]
python-version: [3.8]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Document branch
run: echo ${{ github.ref_name }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev
pip install GDAL==3.2.3
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Lint with flake8
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Workflow

on:
release:
types: [published]

jobs:
build-test-deploy:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
env:
DEPLOY_TARGET: ${{ matrix.python-version == '3.8' }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Document python/os version
run: |
echo "Python V ${{ matrix.python-version }}"
echo "Targeted Deployment Combo? $DEPLOY_TARGET"
- name: Document branch
run: echo ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest -s -m "not skipci"
- name: Configure Git user
if: ${{DEPLOY_TARGET}}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build docs
if: ${{DEPLOY_TARGET}}
run: |
mike deploy --push --rebase --update-aliases ${{ github.ref_name }} latest
- name: Install deployment dependencies
if: ${{DEPLOY_TARGET}}
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Publish to PyPI
if: ${{DEPLOY_TARGET}}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dist/
downloads/
eggs/
.eggs/
lib/
#lib/
lib64/
parts/
sdist/
Expand All @@ -41,9 +41,19 @@ MANIFEST
pip-log.txt
pip-delete-this-directory.txt
*.log

# except logs in the example
!examples/**/*.log

# dowloaded example files
examples/example_union_test_highway.zip
examples/UnionCity/demand_matrices/
examples/UnionCity/emme_project/
examples/UnionCity/inputs/
examples/UnionCity/ref_skim_matrices/
examples/UnionCity/skim_matrices
examples/UnionCity/

#temp files
tests/scratch/*
!tests/scratch/readme.md
Expand Down
16 changes: 14 additions & 2 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,17 @@ default: true
MD007:
indent: 4

# Remove line length limit
MD013: false
# Remove line length limit
MD013: false

# Allow us to skip levels of headings
MD001: false

# Allow us to use emphasis on whole lines.
MD036: false

# Allow us to use lower-level headings to start files
MD041: false

# Fenced code blocks in tabbed views will flag
MD046: false
47 changes: 47 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
default_stages: [commit]
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python3
- id: black-jupyter
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
stages: [manual]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
args: [--unsafe]
- id: requirements-txt-fixer
- id: check-executables-have-shebangs
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.27.1
hooks:
- id: markdownlint
stages: [manual]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.3
hooks:
- id: check-github-workflows
- id: check-github-actions
- repo: http://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
stages: [manual]
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Version (date)

- a list
- of things
- that have changed
- that have changed
36 changes: 36 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Helps auto-assign code reviews for pull requests
# The last match will 'win'

# Global owners
* @lmz @FlaviaTsang

# DevOps / Quality Assurance
/.github/ @e-lo @lmz
setup.config @e-lo @lmz
pre-commit-config.yaml @e-lo @lmz
.markdownlint.yaml @e-lo @lmz

# Documentation Setup
/docs/ @e-lo @lmz
mkdocs.yml @e-lo @lmz

# Documentation Content
*.md @lmz @FlaviaTsang

# Tests should be reviewed by dev team
pytest.ini @e-lo @inrokevin @lmz
/tests/ @e-lo @inrokevin @lmz

# EMME related things should be reviewed by INRO
/tm2py/emme/ @inrokevin

# Packaging
setup.py @e-lo @lmz
*requirements*.txt @inrokevin @lmz
manifest.in @e-lo @lmz
environment.yml @inrokevin @lmz
Dockerfile @inrokevin @lmz
/bin/ @inrokevin @lmz @e-lo

# Examples
/examples/ @FlaviaTsang @i-am-sijia
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Contribution Guide

Please refer to contribution documentation website: [](https://bayareametro.github.io/tm2py/contributing)
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# docker build -t mypackage .
# docker run --rm -v "$PWD":/home/jovyan/work mypackage /bin/bash
# docker run --rm -v "$PWD":/home/jovyan/work mypackage /bin/bash
FROM jupyter/minimal-notebook

COPY ../requirements.txt /tmp/requirements.txt
Expand Down Expand Up @@ -28,4 +28,4 @@ RUN conda clean --all --yes && \
WORKDIR /home/jovyan/work

# set default command to launch when container is run
CMD ["jupyter", "lab", "--ip='0.0.0.0'", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''"]
CMD ["jupyter", "lab", "--ip='0.0.0.0'", "--port=8888", "--no-browser", "--NotebookApp.token=''", "--NotebookApp.password=''"]
Loading

0 comments on commit a638b9c

Please sign in to comment.