Skip to content

Commit

Permalink
changed sampling behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
benmaier committed Jun 12, 2019
1 parent d630659 commit 80df920
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tacoma/tools.py
Expand Up @@ -451,8 +451,10 @@ def sample_a_function(t,y,time_points,sample_width=0):
indices = np.searchsorted(x,[bin])
if indices[0] == 0:
this_index = 0
elif indices[0] == len(x):
this_index = -1
else:
this_index = indices[0]-1
this_index = indices[0]
new_y.append(y[this_index])

return np.array(new_y)
Expand Down

0 comments on commit 80df920

Please sign in to comment.