def test_ties_str_for_fixed_width(self): test_profile = GramCharlierMassProfile(5, 16, [1, 0, 1], k_free=1, sears_flag=1) expected = "Mass=16.000000,Width=5.000000" self.assertEqual(expected, test_profile.create_ties_str()) # k is tied, sears=0 test_profile = GramCharlierMassProfile(5, 16, [1, 0, 1], k_free=0, sears_flag=0) expected = "f0.Mass=16.000000,f0.Width=5.000000,f0.FSECoeff=0" self.assertEqual(expected, test_profile.create_ties_str("f0.")) # k is tied, sears=1 test_profile = GramCharlierMassProfile(5, 16, [1, 0, 1], k_free=0, sears_flag=1) expected = "f0.Mass=16.000000,f0.Width=5.000000,f0.FSECoeff=f0.Width*sqrt(2)/12" self.assertEqual(expected, test_profile.create_ties_str("f0."))
def test_ties_str_for_fixed_width(self): test_profile = GramCharlierMassProfile(5, 16, [1,0,1], k_free=1, sears_flag=1) expected = "Mass=16.000000,Width=5.000000" self.assertEqual(expected, test_profile.create_ties_str()) # k is tied, sears=0 test_profile = GramCharlierMassProfile(5, 16, [1,0,1], k_free=0, sears_flag=0) expected = "f0.Mass=16.000000,f0.Width=5.000000,f0.FSECoeff=0" self.assertEqual(expected, test_profile.create_ties_str("f0.")) # k is tied, sears=1 test_profile = GramCharlierMassProfile(5, 16, [1,0,1], k_free=0, sears_flag=1) expected = "f0.Mass=16.000000,f0.Width=5.000000,f0.FSECoeff=f0.Width*sqrt(2)/12" self.assertEqual(expected, test_profile.create_ties_str("f0."))
def test_ties_str_for_constrained_width_and_k_is_free_is_empty(self): test_profile = GramCharlierMassProfile([2, 5, 7], 16, [1, 0, 1], k_free=1, sears_flag=1) expected = "Mass=16.000000" self.assertEqual(expected, test_profile.create_ties_str())
def test_ties_str_for_constrained_width(self): # k is free test_profile = GramCharlierMassProfile([2,5,7], 16, [1,0,1], k_free=1, sears_flag=1) expected = "" self.assertEqual(expected, test_profile.create_ties_str()) # k is tied, sears=0 test_profile = GramCharlierMassProfile([2,5,7], 16, [1,0,1], k_free=0, sears_flag=0) expected = "f0.FSECoeff=0" self.assertEqual(expected, test_profile.create_ties_str("f0.")) # k is tied, sears=1 test_profile = GramCharlierMassProfile([2,5,7], 16, [1,0,1], k_free=0, sears_flag=1) expected = "f0.FSECoeff=f0.Width*sqrt(2)/12" self.assertEqual(expected, test_profile.create_ties_str("f0."))
def test_ties_str_for_constrained_width_and_k_is_free_is_empty(self): test_profile = GramCharlierMassProfile([2,5,7], 16, [1,0,1], k_free=1, sears_flag=1) expected = "Mass=16.000000" self.assertEqual(expected, test_profile.create_ties_str())