def test_charge_consistency(): """ The charge of a particle is presently stored in the CSV files (see Particle.charge for the motivation), but it can also be retrieved from the particle's PDG ID, *if* the latter is valid. This test makes sure both numbers are consistent for all particles in the PDG table. """ for p in Particle.table(): assert p.three_charge == p.pdgid.three_charge
def test_explicit_table_loading(): Particle.load_table(DIR / '../../particle/data/particle2018.csv') assert Particle.table_loaded() == True assert len(Particle.table_names()) == 1 assert Particle.table() is not None
def test_default_table_loading(): Particle.table() p = Particle.from_pdgid(211) assert p.table_loaded() is True assert p.table_names() == ('particle2018.csv', )