-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from KrishnaswamyLab/scipy-graph-shortest-path
Use `scipy.sparse.csgraph.shortest_path`
- Loading branch information
Showing
28 changed files
with
465 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,5 +15,3 @@ exclude_lines = | |
# Don't complain if non-runnable code isn't run: | ||
if 0: | ||
if __name__ == .__main__. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: pre-commit | ||
on: | ||
push: | ||
branches-ignore: | ||
- 'master' | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
|
||
if: >- | ||
!endsWith(github.event.head_commit.message, '# ci skip') && | ||
( | ||
startsWith(github.ref, 'refs/heads') || | ||
github.event.pull_request.draft == false | ||
) | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Cache pre-commit | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}- | ||
|
||
- name: Run pre-commit | ||
id: precommit | ||
uses: pre-commit/[email protected] | ||
continue-on-error: true | ||
|
||
- name: Commit files | ||
if: steps.precommit.outcome == 'failure' && startsWith(github.ref, 'refs/heads') | ||
run: | | ||
if [[ `git status --porcelain --untracked-files=no` ]]; then | ||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --local user.name "github-actions[bot]" | ||
git add . | ||
git checkout -- .github/workflows | ||
git commit -m "pre-commit" -a | ||
fi | ||
shell: bash -ex {0} | ||
|
||
- name: Push changes | ||
if: steps.precommit.outcome == 'failure' && startsWith(github.ref, 'refs/heads') | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
|
||
- name: Check pre-commit | ||
if: steps.precommit.outcome == 'failure' | ||
uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'test_deploy' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
run_tester: | ||
runs-on: ${{ matrix.config.os }} | ||
if: "!contains(github.event.head_commit.message, 'ci skip')" | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {name: '3.10', os: ubuntu-latest, python: '3.10' } | ||
- {name: '3.9', os: ubuntu-latest, python: '3.9' } | ||
- {name: '3.8', os: ubuntu-latest, python: '3.8' } | ||
- {name: '3.7', os: ubuntu-latest, python: '3.7' } | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt-get install -y libhdf5-dev libhdf5-serial-dev pandoc gfortran libblas-dev liblapack-dev llvm-dev | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.config.python }} | ||
|
||
- name: Cache Python packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.pythonLocation }} | ||
key: ${{runner.os}}-${{ matrix.config.python }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | ||
restore-keys: ${{runner.os}}-${{ matrix.config.python }}-pip-${{ env.pythonLocation }}- | ||
|
||
- name: Install package & dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U wheel setuptools | ||
pip install -U .[test] | ||
python -c "import graphtools" | ||
- name: Run tests | ||
run: | | ||
nose2 -vvv | ||
- name: Coveralls | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_SERVICE_NAME: github | ||
run: | | ||
coveralls | ||
- name: Upload check results on fail | ||
if: failure() | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: ${{ matrix.config.name }}_results | ||
path: check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.3.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
exclude: \.(ai|gz)$ | ||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.6.4 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
args: ['--target-version=py36'] | ||
- repo: https://github.com/pre-commit/mirrors-autopep8 | ||
rev: v1.5.4 | ||
hooks: | ||
- id: autopep8 | ||
# - repo: https://gitlab.com/pycqa/flake8 | ||
# rev: 3.8.4 | ||
# hooks: | ||
# - id: flake8 | ||
# additional_dependencies: ['hacking'] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,3 @@ for file in \$files; do | |
done | ||
EOF | ||
chmod +x .git/hooks/pre-commit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
from .api import Graph, from_igraph, read_pickle | ||
from .api import from_igraph | ||
from .api import Graph | ||
from .api import read_pickle | ||
from .version import __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.