[Pybrainsim-activity] SF.net SVN: pybrainsim:[94] trunk/src/Experiment.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-07 10:12:04
|
Revision: 94 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=94&view=rev Author: rgoj Date: 2009-08-07 10:11:53 +0000 (Fri, 07 Aug 2009) Log Message: ----------- * A warning is printed when findNearestTimeIndex invoked with out of bounds arguments. * Corrected a small mistake in findNearestTimeIndex - it would return the wrong number Modified Paths: -------------- trunk/src/Experiment.py Modified: trunk/src/Experiment.py =================================================================== --- trunk/src/Experiment.py 2009-08-07 10:09:11 UTC (rev 93) +++ trunk/src/Experiment.py 2009-08-07 10:11:53 UTC (rev 94) @@ -71,11 +71,14 @@ is smaller than the given value timePoint""" if timePoint in self.timePoints: return self.timePoints.index(timePoint) + elif (timePoint > max(self.timePoints)) | (timePoint < min(self.timePoints)): + print("findNearestTimeIndex: Something is WRONG! timePoint: " + str(timePoint) ) + return -1 else: for i in range(len(self.timePoints)): if timePoint < self.timePoints[i]: if timePoint > self.timePoints[i-1]: - return i-1 + return i def getRecordingSlice(self, sliceStart, sliceDuration, sliceChannel=0): startIndex = self.findNearestTimeIndex(sliceStart) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |