def test_copydecay_statement_parsing(): p = DecFileParser(DIR / "../data/test_CopyDecay_RemoveDecay.dec") p.parse() assert len(p.dict_decays2copy()) == 2 assert p.number_of_decays == 4 # 2 original + 2 copied assert p.list_decay_modes("phi_copy") == p.list_decay_modes("phi")
def test_list_decay_modes(): p = DecFileParser(DIR / '../data/test_example_Dst.dec') p.parse() assert p.list_decay_modes('D*-') == [['anti-D0', 'pi-'], ['D-', 'pi0'], ['D-', 'gamma']] assert p.list_decay_modes('D*(2010)-', pdg_name=True) == [['anti-D0', 'pi-'], ['D-', 'pi0'], ['D-', 'gamma']]
def test_list_decay_modes_on_the_fly(): """ Unlike in the example above the charge conjugate decay modes are created on the fly from the non-CC. decay. """ p = DecFileParser(DIR / '../data/test_Xicc2XicPiPi.dec') p.parse() # Parsed directly from the dec file assert p.list_decay_modes('MyXic+') == [['p+', 'K-', 'pi+']] # Decay mode created on-the-fly from the above assert p.list_decay_modes('MyantiXic-') == [['anti-p-', 'K+', 'pi-']]
def test_list_decay_modes(): p = DecFileParser(DIR / "../data/test_example_Dst.dec") p.parse() assert p.list_decay_modes("D*-") == [ ["anti-D0", "pi-"], ["D-", "pi0"], ["D-", "gamma"], ] assert p.list_decay_modes("D*(2010)-", pdg_name=True) == [ ["anti-D0", "pi-"], ["D-", "pi0"], ["D-", "gamma"], ]
def test_list_decay_modes_on_the_fly(): """ Unlike in the example above the charge conjugate decay modes are created on the fly from the non-CC. decay. """ p = DecFileParser(DIR / "../data/test_Xicc2XicPiPi.dec") with pytest.warns(UserWarning) as record: p.parse() assert len(record) == 1 # Parsed directly from the dec file assert p.list_decay_modes("MyXic+") == [["p+", "K-", "pi+"]] # Decay mode created on-the-fly from the above assert p.list_decay_modes("MyantiXic-") == [["anti-p-", "K+", "pi-"]]
def test_simple_dec(): p = DecFileParser(DIR / '../data/test_example_Dst.dec') p.parse() assert p.list_decay_mother_names() == ['D*+', 'D*-', 'D0', 'D+', 'pi0'] assert p.list_decay_modes('D0') == [['K-', 'pi+']]
def test_simple_dec(): p = DecFileParser(DIR / "../data/test_example_Dst.dec") p.parse() assert p.list_decay_mother_names() == ["D*+", "D*-", "D0", "D+", "pi0"] assert p.list_decay_modes("D0") == [["K-", "pi+"]]
def test_non_existent_decay(): with pytest.raises(DecayNotFound): p = DecFileParser(DIR / '../data/test_example_Dst.dec') p.parse() p.list_decay_modes('XYZ')