예제 #1
0
 def test_midpoint_should_return_correct_value_scaling_down(self):
     scaler = restraints.PlateauNonLinearScaler(0.7, 0.8, 0.9, 1.0, 4, 1.0,
                                                0.0)
     self.assertAlmostEqual(scaler(0.75), 0.88079708)
예제 #2
0
 def test_should_return_0_above_alpha_max(self):
     scaler = restraints.PlateauNonLinearScaler(0.2, 0.4, 0.6, 0.8, 4, 1.0,
                                                0.0)
     self.assertAlmostEqual(scaler(0.9), 0.0)
예제 #3
0
 def test_should_return_1_between_alpha_one_alpha_two(self):
     scaler = restraints.PlateauNonLinearScaler(0.2, 0.4, 0.6, 0.8, 4, 1.0,
                                                0.0)
     self.assertAlmostEqual(scaler(0.5), 1.0)
예제 #4
0
 def test_should_raise_if_factor_below_one(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauNonLinearScaler(0.0, 0.5, 0.7, 1.0, 0.2)
예제 #5
0
 def test_should_raise_if_alpha_is_above_one(self):
     scaler = restraints.PlateauNonLinearScaler(0.2, 0.4, 0.6, 0.8, 4)
     with self.assertRaises(RuntimeError):
         scaler(2)
예제 #6
0
 def test_should_raise_if_alpha_max_less_than_alpha_min(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauNonLinearScaler(0.7, 0.65, 0.63, 0.6, 4)
예제 #7
0
 def test_should_raise_when_alpha_max_above_one(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauNonLinearScaler(1, 0.5, 0.6, 2, 4)
예제 #8
0
 def test_should_raise_when_alpha_max_below_zero(self):
     with self.assertRaises(RuntimeError):
         restraints.PlateauNonLinearScaler(1, 0.5, 0.6, -1, 4)
예제 #9
0
 def test_midpoint_should_return_correct_value_scaling_up(self):
     scaler = restraints.PlateauNonLinearScaler(0.7, 0.8, 0.9, 1.0, 4)
     self.assertAlmostEqual(scaler(0.95), 0.119202922)
예제 #10
0
 def test_should_return_0_below_alpha_min(self):
     scaler = restraints.PlateauNonLinearScaler(0.2, 0.4, 0.6, 0.8, 4)
     self.assertAlmostEqual(scaler(0.1), 0.0)