X-DataInitiative/tick

Issue with TimeFunction

tonygracious opened this issue · 0 comments

t_values1 = np.array([0, 1, 1.5, 2., 3.5, 4], dtype=float) y_values1 = np.array([0, 0.2, 0, 0.1, 0.2, 0.3], dtype=float) tf1 = TimeFunction([t_values1, y_values1], inter_mode=TimeFunction.InterConstRight,\ dt=0.1) print(tf1.smapled_y)

gives following output

array([0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0.2, 0.2, 0.2,
0.2, 0.2, 0. , 0. , 0. , 0. , 0. , 0.1, 0.1, 0.1, 0.1, 0.1, 0.1,
0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2,
0.2, 0.3, 0.2])

I think the last values should also be 0.3.