Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
def test_charge(PDGIDs):
assert charge(PDGIDs.Photon) == 0
assert charge(PDGIDs.Gluon) == 0
assert charge(PDGIDs.Electron) == -1
assert charge(PDGIDs.AntiMuon) == +1
assert charge(PDGIDs.jpsi) == 0
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None
assert charge(PDGIDs.Upsilon_1S) == 0
assert charge(PDGIDs.PiPlus) == +1
assert charge(PDGIDs.KMinus) == -1
assert charge(PDGIDs.D0) == 0
assert charge(PDGIDs.DPlus) == +1
assert charge(PDGIDs.DsPlus) == +1
assert charge(PDGIDs.B0) == 0
assert charge(PDGIDs.Bs) == 0
assert charge(PDGIDs.BcPlus) == +1
assert charge(PDGIDs.Proton) == +1
assert charge(PDGIDs.LcPlus) == +1
assert charge(PDGIDs.Lb) == 0
assert charge(PDGIDs.DD1) == -2 / 3
assert charge(PDGIDs.SD0) == -2 / 3
assert charge(PDGIDs.Invalid1) == None
assert charge(PDGIDs.Invalid2) == None