Skip to content

Commit

Permalink
Merge pull request #143 from UDST/node-id-fix
Browse files Browse the repository at this point in the history
[v0.5.1] Patch restoring get_node_ids() performance
  • Loading branch information
smmaurer authored Aug 6, 2020
2 parents 3ed8e40 + 3593222 commit 740c1d7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 11 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
v0.5.1
======

2020/08/05

* Fixes a performance bug in network.get_node_ids()

v0.5
====

Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
![Version](https://img.shields.io/badge/version-0.5-blue.svg)
[![Travis build status](https://travis-ci.org/UDST/pandana.svg?branch=master)](https://travis-ci.org/UDST/pandana)
[![Appveyor build status](https://ci.appveyor.com/api/projects/status/a90kvns7qe56kg57?svg=true)](https://ci.appveyor.com/project/smmaurer/pandana)
[![Coverage Status](https://coveralls.io/repos/github/UDST/pandana/badge.svg?branch=master)](https://coveralls.io/github/UDST/pandana?branch=master)

# Pandana
Expand Down
7 changes: 7 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change log
==========

v0.5.1
------

2020/08/05

* Fixes a performance bug in network.get_node_ids()

v0.5
----

Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@
# built documents.
#
# The short X.Y version.
version = '0.5'
version = '0.5.1'
# The full version, including alpha/beta/rc tags.
release = '0.5'
release = '0.5.1'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Pandana

Pandana is a Python library for network analysis that uses `contraction hierarchies <https://en.wikipedia.org/wiki/Contraction_hierarchies>`_ to calculate super-fast travel accessibility metrics and shortest paths. The numerical code is in C++.

v0.5, released July 28, 2020
v0.5.1, released August 5, 2020


Acknowledgments
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.5'
version = __version__ = '0.5.1'
6 changes: 4 additions & 2 deletions pandana/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import numpy as np
import pandas as pd
from scipy.spatial import KDTree
from sklearn.neighbors import KDTree

from .cyaccess import cyaccess
from .loaders import pandash5 as ph5
Expand Down Expand Up @@ -379,7 +379,7 @@ def aggregate(self, distance, type="sum", decay="linear", imp_name=None,
decay : string, optional (default 'linear')
The type of decay to apply, which makes things that are further
away count less in the aggregation: 'linear', 'exponential', or
'flat' (no decay).
'flat' (no decay).
*Additional notes:* see ``aggregateAccessibilityVariable`` in
accessibility.cpp to read through the code that applies decays.
Expand Down Expand Up @@ -468,6 +468,8 @@ def get_node_ids(self, x_col, y_col, mapping_distance=None):
xys = pd.DataFrame({'x': x_col, 'y': y_col})

distances, indexes = self.kdtree.query(xys.values)
indexes = np.transpose(indexes)[0]
distances = np.transpose(distances)[0]

node_ids = self.nodes_df.iloc[indexes].index

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def run(self):
## Standard setup
###############################################

version = '0.5'
version = '0.5.1'

packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])

Expand All @@ -154,7 +154,7 @@ def run(self):
'numpy >=1.8',
'pandas >=0.17',
'requests >=2.0',
'scipy >=0.9',
'scikit-learn >=0.18',
'tables >=3.1, <3.6; python_version <"3.6"',
'tables >=3.1, <3.7; python_version >="3.6"'
],
Expand Down

0 comments on commit 740c1d7

Please sign in to comment.