コード例 #1
0
 def test_should_return_correct_value_between_alpha_one_alpha_two_down(
         self):
     scaler = restraints.PlateauLinearScaler(0.0, 0.4, 0.6, 1.0, 1.0, 0.0)
     self.assertAlmostEqual(scaler(0.3), 0.75)
コード例 #2
0
 def test_should_return_correct_value_between_alpha_two_alpha_max_up2(self):
     scaler = restraints.PlateauLinearScaler(0.0, 0.4, 0.6, 1.0, 1.0, 0.0)
     self.assertAlmostEqual(scaler(0.9), 0.25)
コード例 #3
0
 def test_should_raise_if_alpha_is_above_one(self):
     scaler = restraints.PlateauLinearScaler(0.2, 0.6, 0.7, 0.8)
     with self.assertRaises(RuntimeError):
         scaler(2)
コード例 #4
0
 def test_should_return_0_above_alpha_max(self):
     scaler = restraints.PlateauLinearScaler(0.2, 0.4, 0.6, 0.8, 1.0, 0.0)
     self.assertAlmostEqual(scaler(0.9), 0.0)
コード例 #5
0
 def test_should_raise_if_alpha_is_below_zero(self):
     scaler = restraints.PlateauLinearScaler(0.2, 0.5, 0.7, 0.8)
     with self.assertRaises(RuntimeError):
         scaler(-1)
コード例 #6
0
 def test_should_raise_if_alpha_max_less_than_alpha_min(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauLinearScaler(0.7, 0, 0.5, 0.6)
コード例 #7
0
 def test_should_raise_when_alpha_max_above_one(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauLinearScaler(1, 0, 0.5, 2)
コード例 #8
0
 def test_should_raise_when_alpha_max_below_zero(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauLinearScaler(1, 0, 0.5, -1)
コード例 #9
0
ファイル: test_restraints.py プロジェクト: cing/meld
 def test_should_return_0_below_alpha_min(self):
     scaler = restraints.PlateauLinearScaler(0.2, 0.4, 0.6, 0.8)
     self.assertAlmostEqual(scaler(0.1), 0.0)