easier to use if end time is included:

This commit is contained in:
Martin Diehl 2019-10-20 10:42:45 +02:00
parent fe94718bcd
commit 8f315836b0
1 changed files with 4 additions and 4 deletions

View File

@ -103,7 +103,7 @@ class DADF5():
def __time_to_inc(self,start,end): def __time_to_inc(self,start,end):
selected = [] selected = []
for i,time in enumerate(self.times): for i,time in enumerate(self.times):
if start <= time < end: if start <= time <= end:
selected.append(self.increments[i]) selected.append(self.increments[i])
return selected return selected
@ -117,7 +117,7 @@ class DADF5():
start : float start : float
start time (included) start time (included)
end : float end : float
end time (exclcuded) end time (included)
""" """
self.__manage_visible(self.__time_to_inc(start,end),'increments','set') self.__manage_visible(self.__time_to_inc(start,end),'increments','set')
@ -132,7 +132,7 @@ class DADF5():
start : float start : float
start time (included) start time (included)
end : float end : float
end time (exclcuded) end time (included)
""" """
self.__manage_visible(self.__time_to_inc(start,end),'increments','add') self.__manage_visible(self.__time_to_inc(start,end),'increments','add')
@ -147,7 +147,7 @@ class DADF5():
start : float start : float
start time (included) start time (included)
end : float end : float
end time (exclcuded) end time (included)
""" """
self.__manage_visible(self.__time_to_inc(start,end),'increments','del') self.__manage_visible(self.__time_to_inc(start,end),'increments','del')