Skip to content

Commit

Permalink
Merge branch 'dev' into issue/shpath_168
Browse files Browse the repository at this point in the history
  • Loading branch information
smmaurer authored Jul 25, 2023
2 parents dd14d3b + 0e82a24 commit a4d71e8
Show file tree
Hide file tree
Showing 21 changed files with 497 additions and 299 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Build-wheels
# the GitHub website. Wheels should be uploaded manually to PyPI -- see CONTRIBUTING.md.

# The Linux wheels cannot be generated using `ubuntu-latest` because they require a
# special Docker image to ensure cross-Linux compatibility. There are at least a couple
# special Docker image to provide cross-Linux compatibility. There are at least a couple
# of third-party actions set up using the official image; we could switch to another if
# this ever breaks.

Expand All @@ -25,10 +25,9 @@ jobs:
# with:
# ref: 'v0.6' # enable to check out prior version of codebase
- name: Build wheels
uses: RalfG/[email protected].3
uses: RalfG/[email protected].4
with:
python-versions: 'cp35-cp35m cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
build-requirements: 'cython numpy'
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
Expand All @@ -55,10 +54,10 @@ jobs:
- name: Set up environment
run: |
conda config --append channels conda-forge
conda install cython numpy clang llvm-openmp
conda install build clang llvm-openmp
- name: Build wheel
run: |
python setup.py bdist_wheel
python -m build --sdist --wheel
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ jobs:
run: |
pip install .
pip install osmnet
- name: Generate coverage report
run: |
pip install 'pytest<4.0' 'pytest-cov<2.10' coverage
python setup.py test --pytest-args "--cov pandana --cov-report term-missing"
echo "coverage=$(coverage report | grep '^TOTAL' | grep -oE '[^ ]+$')" >> $GITHUB_ENV
- name: Post comment on PR
uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: "Test coverage is ${{ env.coverage }}"
check_for_duplicate_msg: true
# `coverage run ...` is failing in GitHub Actions, but I'm not able to reproduce the
# problem locally. We should look into this again another time. (11-May-2021)

# - name: Generate coverage report
# run: |
# pip install pytest coverage
# coverage run --source pandana --module pytest --verbose
# coverage report --show-missing
# echo "coverage=$(coverage report | grep '^TOTAL' | grep -oE '[^ ]+$')" >> $GITHUB_ENV
# - name: Post comment on PR
# uses: unsplash/comment-on-pr@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# msg: "Test coverage is ${{ env.coverage }}"
# check_for_duplicate_msg: true
18 changes: 11 additions & 7 deletions .github/workflows/cross-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
python examples/simple_example.py
- name: Run unit tests
run: |
pip install 'pytest<4.0'
python setup.py test
pip install pytest
pytest -s
build-conda:
runs-on: ${{ matrix.os }}
Expand All @@ -52,11 +52,15 @@ jobs:
- name: Install Pandana
run: |
pip install .
conda install osmnet --channel conda-forge
# OSMNet is causing a version of Pandas to be installed that crashes in GitHub Actions.
# Assume this will resolve itself on its own. (11-May-2021)

# conda install osmnet --channel conda-forge
- name: Run demo
run: |
python examples/simple_example.py
- name: Run unit tests
run: |
pip install 'pytest<4.0'
python setup.py test
# - name: Run unit tests
# run: |
# pip install pytest
# pytest -s
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- name: Install Pandana
run: |
pip install .
pip install osmnet
- name: Run unit tests
run: |
pip install 'pytest<4.0'
python setup.py test
pip install pytest
pytest -s
39 changes: 39 additions & 0 deletions examples/range_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import sys
import time

import pandana

import numpy as np
import pandas as pd
from pympler.asizeof import asizeof

print()
print("Loading data...")
t0 = time.time()
store = pd.HDFStore('examples/data/bayareanetwork.h5', 'r')
nodes, edges = store.nodes, store.edges
print(round(time.time()-t0, 1), ' sec.')

print()
print("Initializing network...")
t0 = time.time()
net = pandana.Network(nodes.x, nodes.y, edges.from_int, edges.to_int, edges[['weight']])
store.close()
print(round(time.time()-t0, 1), ' sec.')

print()
print("Calculating nodes in 100m range...")
t0 = time.time()
r = net.nodes_in_range([53114882, 53107159], 100.0)
print(round(time.time()-t0, 1), ' sec.')

# print(net.node_idx.values)
# print(net.node_idx.index.values)

print(asizeof(r)) # 88.8 million bytes raw

print()

# dataframe.info()
# dataframe.memory_usage(deep=True)
# .set_index(['1','2'], inplace=True)
2 changes: 1 addition & 1 deletion examples/shortest_path_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# if no argument provided look for it in the test data
storef = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'../pandana/tests/osm_sample.h5'))
'../tests/osm_sample.h5'))

if not os.path.isfile(storef):
raise IOError('Could not find test input file: {!r}'.format(storef))
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# if no argument provided look for it in the test data
storef = os.path.normpath(os.path.join(
os.path.dirname(os.path.abspath(__file__)),
'../pandana/tests/osm_sample.h5'))
'../tests/osm_sample.h5'))

if not os.path.isfile(storef):
raise IOError('Could not find test input file: {!r}'.format(storef))
Expand Down
2 changes: 1 addition & 1 deletion pandana/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .network import Network

version = __version__ = '0.6.1'
version = __version__ = '0.7.dev0'
Loading

0 comments on commit a4d71e8

Please sign in to comment.