Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfaslak committed May 3, 2019
1 parent cf9e88b commit be4c861
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion infostop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
This package implements stop location detection using Infomap.
"""

from .detect import label_trace
from .detect import best_partition
from .detect import run_infomap
from .detect import label_distance_matrix

name = "infostop"

Expand Down
5 changes: 5 additions & 0 deletions infostop/detect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import numpy as np
import warnings
from infostop import utils

def best_partition(coords, r1=10, r2=10, label_singleton=False, min_staying_time=300, max_time_between=86400, distance_function=utils.haversine, return_intervals=False, min_size=2):
warnings.warn("`best_partition` is deprecated and will be removed in a future version. Instead use `label_trace`.")
return label_trace(coords, r1, r2, label_singleton, min_staying_time, max_time_between, distance_function, return_intervals, min_size)

def label_trace(coords, r1=10, r2=10, label_singleton=False, min_staying_time=300, max_time_between=86400, distance_function=utils.haversine, return_intervals=False, min_size=2):
"""Infer best stop-location labels from stationary points using infomap.
Expand Down
2 changes: 1 addition & 1 deletion infostop/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def infomap_communities(nodes, edges):
for k, v in infomapSimple.getModules().items()
])

def distance_matrix(stop_events, distance_function):
def distance_matrix(stop_events, distance_function=haversine):
"""Compute distance matrix between list of points.
Input
Expand Down

0 comments on commit be4c861

Please sign in to comment.