コード例 #1
0
 def testUsingBuffer(self):
     a = [2,3,4,5,1,6,34,34.2,134,5,9,2]
     result = array_utils.getSensibleLimits(a, buffer=True)
     assert(result[0] == -15 and result[1] == 150)
コード例 #2
0
 def testUsingBufferWithUpperBound(self):
     a = N.array([2,3,4,5,1,6,34,34.2,134,5,9,2])
     result = array_utils.getSensibleLimits(a, high=200, buffer=True)
     assert(result[0] == -31 and result[1] == 232)
コード例 #3
0
 def testWithBothBounds(self):
     a = [23.42,1.1,.200,4,124.2,10000000]
     result = array_utils.getSensibleLimits(a, high = 1e8, low=0.3)
     assert(result[0] == .2 and result[1] == 1e8)
コード例 #4
0
 def testWithUpperBound(self):
     a = [23.42,1.1,.2,4,124.2,44]
     result = array_utils.getSensibleLimits(a, high = 125)
     assert(result[0] == .2 and result[1] == 125)
コード例 #5
0
 def testWithLowerBound(self):
     a = N.array([12.2,3.22,230,43.48])
     result = array_utils.getSensibleLimits(a, low=0.3)
     assert(result[0] == 0.3 and result[1] == 230)
コード例 #6
0
 def testCompositeListWithNoBounds(self):
     a = [[1,2,3,4], [5,0,6,7,8,9]]
     result = array_utils.getSensibleLimits(a)
     assert(result[0] == 0 and result[1] == 9)
コード例 #7
0
 def testArrayWithNoBounds(self):
     a = N.array([1,2,3,4])
     result = array_utils.getSensibleLimits(a)
     assert(result[0] == 1 and result[1] == 4)