simplify interface
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
class AbstractStimulus:
|
class AbstractStimulus:
|
||||||
|
|
||||||
def value_at_time_in_ms(self, time_point):
|
def value_at_time_in_ms(self, time_point):
|
||||||
raise NotImplementedError("This is an abstract class!")
|
return self.value_at_time_in_s(time_point / 1000)
|
||||||
|
|
||||||
def value_at_time_in_s(self, time_point):
|
def value_at_time_in_s(self, time_point):
|
||||||
raise NotImplementedError("This is an abstract class!")
|
raise NotImplementedError("This is an abstract class!")
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ class StepStimulus(AbstractStimulus):
|
|||||||
self.start = start / 1000
|
self.start = start / 1000
|
||||||
self.duration = duration / 1000
|
self.duration = duration / 1000
|
||||||
|
|
||||||
def value_at_time_in_ms(self, time_point):
|
|
||||||
return self.value_at_time_in_s(time_point/1000)
|
|
||||||
|
|
||||||
def value_at_time_in_s(self, time_point):
|
def value_at_time_in_s(self, time_point):
|
||||||
if self.start <= time_point <= self.start + self.duration:
|
if self.start <= time_point <= self.start + self.duration:
|
||||||
return self.value
|
return self.value
|
||||||
|
|||||||
Reference in New Issue
Block a user