more foundation work for scoring
This commit is contained in:
@@ -2,6 +2,11 @@ from __future__ import absolute_import
|
||||
from __future__ import division
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# low level methods
|
||||
def coordinate_in_path(latitude,longitude, p):
|
||||
|
||||
@@ -18,12 +23,12 @@ def time_in_path(df,p,maxmin='max',getall=False):
|
||||
|
||||
if df.empty:
|
||||
return 0
|
||||
|
||||
|
||||
latitude = df.latitude
|
||||
longitude = df.longitude
|
||||
|
||||
f = lambda x: coordinate_in_path(x['latitude'],x['longitude'],p)
|
||||
|
||||
|
||||
df['inpolygon'] = df.apply(f,axis=1)
|
||||
|
||||
if maxmin=='max':
|
||||
@@ -40,7 +45,7 @@ def time_in_path(df,p,maxmin='max',getall=False):
|
||||
|
||||
raise InvalidTrajectoryError("Trajectory doesn't go through path")
|
||||
|
||||
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
@@ -64,7 +69,7 @@ def coursetime_paths(data,paths,finalmaxmin='min'):
|
||||
entrytime = data['time'].max()
|
||||
entrydistance = data['cum_dist'].max()
|
||||
coursecompleted = False
|
||||
|
||||
|
||||
# corner case - empty list of paths
|
||||
if len(paths) == 0:
|
||||
return 0,True
|
||||
|
||||
Reference in New Issue
Block a user