コード例 #1
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValSingle(self):
     val = util.closest_val(1., np.array([50.]))
     assert val == 0
コード例 #2
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testValueErrorOnEmptyList(self):
     util.closest_val(1., [])
コード例 #3
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testValueErrorOnEmptyArray(self):
     util.closest_val(1., np.array([]))
コード例 #4
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValBelowList(self):
     val = util.closest_val(-5., self.list)
     assert val == 0
コード例 #5
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValAboveList(self):
     val = util.closest_val(20., self.list)
     assert val == 2
コード例 #6
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValAbove(self):
     val = util.closest_val(20., self.array)
     assert val == 2
コード例 #7
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValAboveList(self):
     val = util.closest_val(20., self.list)
     assert val == 2
コード例 #8
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValAbove(self):
     val = util.closest_val(20., self.array)
     assert val == 2
コード例 #9
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternalNegative(self):
     val = util.closest_val(-3.5, -1 * self.array)
     assert val == 1
コード例 #10
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternal(self):
     val = util.closest_val(3.5, self.array)
     assert val == 1
コード例 #11
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValBelow(self):
     val = util.closest_val(-5., self.array)
     assert val == 0
コード例 #12
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValSingle(self):
     val = util.closest_val(1., np.array([50.]))
     assert val == 0
コード例 #13
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testValueErrorOnEmptyArray(self):
     util.closest_val(1., np.array([]))
コード例 #14
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testValueErrorOnEmptyList(self):
     util.closest_val(1., [])
コード例 #15
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternal(self):
     val = util.closest_val(3.5, self.array)
     assert val == 1
コード例 #16
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternalList(self):
     val = util.closest_val(3.5, self.list)
     assert val == 1
コード例 #17
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValBelow(self):
     val = util.closest_val(-5., self.array)
     assert val == 0
コード例 #18
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternalList(self):
     val = util.closest_val(3.5, self.list)
     assert val == 1
コード例 #19
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValInternalNegative(self):
     val = util.closest_val(-3.5, -1*self.array)
     assert val == 1
コード例 #20
0
ファイル: tests.py プロジェクト: jjhelmus/atmos
 def testClosestValBelowList(self):
     val = util.closest_val(-5., self.list)
     assert val == 0