Exemple #1
0
def test_fuzzy_string():
    """
    The input name is not specific enough, in which case the search is done
    by pdg_name after failing a match by name.
    """
    p = Particle.from_string("a(0)(980)")  # all 3 charge stages match
    assert p.pdgid == 9000111
Exemple #2
0
def test_ampgen_style_names(name, pid):
    particle = Particle.from_string(name)

    assert int(particle) == pid
    assert particle.pdgid == pid
    assert particle == pid
Exemple #3
0
def test_string():
    pi = Particle.from_string("pi+")
    assert pi.pdgid == 211

    with pytest.raises(ParticleNotFound):
        Particle.from_string("unknown")