Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-particle for openSUSE:Factory
checked in at 2021-09-20 23:32:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-particle (Old)
and /work/SRC/openSUSE:Factory/.python-particle.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-particle"
Mon Sep 20 23:32:58 2021 rev:10 rq:920076 version:0.16.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-particle/python-particle.changes
2021-07-07 18:31:56.874299662 +0200
+++
/work/SRC/openSUSE:Factory/.python-particle.new.1899/python-particle.changes
2021-09-20 23:34:34.283278700 +0200
@@ -1,0 +2,41 @@
+Sat Sep 18 17:26:47 UTC 2021 - Atri Bhattacharya <[email protected]>
+
+- Update to version 0.16.1:
+ * Fixed a regression with the import time being unreasonably
+ slow.
+ * Restore Python 3.5 support (no benefit to drop until 2.7 is
+ dropped).
+- Changes from version 0.16.0:
+ * Particle class:
+ - Added finditer, which returns an iterator instead of a
+ complete list like findall.
+ - Method find deprecated. It will be removed from version
+ 0.17.0 onwards.
+ * PDGID class:
+ - New functions is_sm_lepton, is_sm_quark and
+ is_excited_quark_or_lepton for qualification of PDG IDs.
+ - is_composite_quark_or_lepton deprecated in favour of better
+ named is_excited_quark_or_lepton.
+ - is_lepton fixed to match the behaviour of the related
+ is_quark, i.e. now excited leptons are not considered
+ leptons (only SM and 4th generation leptons).
+ - Improvements to documentation.
+ - Test suite enhanced accordingly.
+ * Data files:
+ - Added the 2021 PDG data table .mcd file, now default.
+ - Version 10 of package CSV data files: Since PDG 2021
+ information now the default.
+ - Lifetimes of neutrinos set to infinity.
+ - Check added for duplicate entries in .mcd PDG data files.
+ * Tests:
+ - Tests of coverage added back, using Codecov on GHAs.
+ - CI enhanced, e.g. adding codespell, isort and flake8 checks
+ tp pre-commit hooks.
+ * Miscellaneous:
+ - Support for Python 3.10 added.
+ - Several FutureWarning warnings fixed.
+ - Code modernisation.
+- Update _service file for new tests.
+- New BuildRequires for tests: python-Deprecated.
+
+-------------------------------------------------------------------
Old:
----
particle-0.15.1.tar.gz
New:
----
particle-0.16.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-particle.spec ++++++
--- /var/tmp/diff_new_pack.TTQpSR/_old 2021-09-20 23:34:34.827279372 +0200
+++ /var/tmp/diff_new_pack.TTQpSR/_new 2021-09-20 23:34:34.831279377 +0200
@@ -19,7 +19,7 @@
%global modname particle
%define skip_python2 1
Name: python-particle
-Version: 0.15.1
+Version: 0.16.1
Release: 0
Summary: PDG particle data and identification codes
License: BSD-3-Clause
@@ -38,6 +38,7 @@
Recommends: python-tabulate
BuildArch: noarch
# SECTION For tests
+BuildRequires: %{python_module Deprecated}
BuildRequires: %{python_module hepunits}
BuildRequires: %{python_module importlib_resources}
BuildRequires: %{python_module pytest}
++++++ _service ++++++
--- /var/tmp/diff_new_pack.TTQpSR/_old 2021-09-20 23:34:34.855279407 +0200
+++ /var/tmp/diff_new_pack.TTQpSR/_new 2021-09-20 23:34:34.859279412 +0200
@@ -2,7 +2,7 @@
<service name="tar_scm" mode="disabled">
<param
name="url">https://github.com/scikit-hep/particle.git</param>
<param name="scm">git</param>
- <param name="revision">v0.15.1</param>
+ <param name="revision">v0.16.1</param>
<param name="subdir">tests</param>
<param name="version">_none_</param>
<param name="filename">tests</param>
++++++ particle-0.15.1.tar.gz -> particle-0.16.1.tar.gz ++++++
++++ 3318 lines of diff (skipped)
++++++ tests.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/conftest.py new/tests/conftest.py
--- old/tests/conftest.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/conftest.py 2021-09-11 04:45:58.000000000 +0200
@@ -4,11 +4,11 @@
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/particle for details.
-import pytest
-
# Backport needed if Python 2 is used
from enum import IntEnum
+import pytest
+
class PDGIDsEnum(IntEnum):
"""Sample of PDGIDs on which to run tests."""
@@ -26,7 +26,6 @@
Muon = 13
AntiMuon = -Muon
Tau = 15
- TauPrime = 17
# Neutrinos
Nu_e = 12
NuBar_tau = -16
@@ -37,7 +36,9 @@
CQuark = 4
BQuark = 5
TQuark = 6
- BPrimeQuark = 7 # 4th generation
+ # 4th generation quarks and leptons
+ TauPrime = 17
+ BPrimeQuark = 7
TPrimeQuark = 8
# Quarkonia
jpsi = 443
@@ -118,7 +119,7 @@
# Technicolor
Pi0TC = 3000111
PiMinusTC = -3000211
- # Composite quarks and leptons
+ # Excited (composite) quarks and leptons
UQuarkStar = 4000002
AntiElectronStar = -4000011
# Generator specific pseudoparticles or concepts
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/converters/test_maps.py
new/tests/converters/test_maps.py
--- old/tests/converters/test_maps.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/converters/test_maps.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,16 +6,12 @@
import pytest
-from particle.converters.bimap import BiMap
-from particle.converters.bimap import DirectionalMaps
-
+from particle import data
+from particle.converters.bimap import BiMap, DirectionalMaps
+from particle.exceptions import MatchingIDNotFound
from particle.pdgid import PDGID
from particle.pythia import PythiaID
-from particle.exceptions import MatchingIDNotFound
-
-from particle import data
-
def test_BiMap():
bimap = BiMap(PDGID, PythiaID)
@@ -24,11 +20,11 @@
assert "BiMap(PDGID-PythiaID)" in str(bimap)
with pytest.raises(MatchingIDNotFound):
- pyid = bimap[PDGID(9000221)]
+ bimap[PDGID(9000221)]
def test_DirectionalMaps():
- filename = data.open_text(data, "pdgid_to_pythiaid.csv")
+ filename = data.basepath / "pdgid_to_pythiaid.csv"
PDG2PyIDMap, Py2PDGIDMap = DirectionalMaps(
"PDGID", "PythiaID", filename=filename, converters=(int, int)
)
@@ -40,6 +36,6 @@
assert "DirectionalMap(PYTHIAID->PDGID)" in str(Py2PDGIDMap)
with pytest.raises(MatchingIDNotFound):
- pyid = PDG2PyIDMap[PDGID(9000221)]
+ PDG2PyIDMap[PDGID(9000221)]
with pytest.raises(MatchingIDNotFound):
- pdgid = Py2PDGIDMap[PythiaID(9000221)]
+ Py2PDGIDMap[PythiaID(9000221)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/data/README.rst new/tests/data/README.rst
--- old/tests/data/README.rst 1970-01-01 01:00:00.000000000 +0100
+++ new/tests/data/README.rst 2021-09-11 04:45:58.000000000 +0200
@@ -0,0 +1,5 @@
+Particle test data folder contents
+==================================
+
+This folder contains files used for testing purposes.
+By construction files can have features, hence not be fully correct.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/data/test_PDG_mcd_file_duplicates.mcd
new/tests/data/test_PDG_mcd_file_duplicates.mcd
--- old/tests/data/test_PDG_mcd_file_duplicates.mcd 1970-01-01
01:00:00.000000000 +0100
+++ new/tests/data/test_PDG_mcd_file_duplicates.mcd 2021-09-11
04:45:58.000000000 +0200
@@ -0,0 +1,15 @@
+* Example PDG particle data file in ".mcd format" for testing purposes.
+* File in the very same format as the mass_width_<year>.mcd files.
+* Values below come from the 2021 file.
+*
+* Particle ID(s) Mass (GeV) Errors (GeV) Width
(GeV) Errors (GeV) Name Charges
+ 1 4.67E-03 +0.5E-03 -0.2E-03
d -1/3
+ 2 2.16E-03 +0.5E-03 -0.3E-03
u +2/3
+ 3 9.3E-02 +1.1E-02 -5.0E-03
s -1/3
+ 4 1.27E+00 +2.0E-02 -2.0E-02
c +2/3
+ 5 4.180E+00 +3.0E-02 -2.0E-02
b -1/3
+ 6 1.725E+02 +7.0E-01 -7.0E-01
1.42E+00 +1.9E-01 -1.5E-01 t +2/3
+ 313 8.9555E-01 +2.0E-04 -2.0E-04
4.73E-02 +5.0E-04 -5.0E-04 K*(892) 0
+ 323 8.9167E-01 +2.6E-04 -2.6E-04
5.14E-02 +8.0E-04 -8.0E-04 K*(892) +
+ 323 8.955E-01 +8.0E-04 -8.0E-04
4.62E-02 +1.3E-03 -1.3E-03 K*(892) +
+ 1114 2114 2214 2224 1.2320E+00 +2.0E-03 -2.0E-03
1.170E-01 +3.0E-03 -3.0E-03 Delta(1232) -,0,+,++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/geant/test_geant3id.py
new/tests/geant/test_geant3id.py
--- old/tests/geant/test_geant3id.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/geant/test_geant3id.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,9 +6,9 @@
import pytest
+from particle.exceptions import MatchingIDNotFound
from particle.geant import Geant3ID
from particle.pdgid import PDGID
-from particle.exceptions import MatchingIDNotFound
def test_class_string_representations():
@@ -35,7 +35,7 @@
def test_from_pdgid_non_matching():
with pytest.raises(MatchingIDNotFound):
- gid = Geant3ID.from_pdgid(55)
+ Geant3ID.from_pdgid(55)
def test_to_pdgid():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_convert.py
new/tests/particle/test_convert.py
--- old/tests/particle/test_convert.py 1970-01-01 01:00:00.000000000 +0100
+++ new/tests/particle/test_convert.py 2021-09-11 04:45:58.000000000 +0200
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018-2021, Eduardo Rodrigues and Henry Schreiner.
+#
+# Distributed under the 3-clause BSD license, see accompanying file LICENSE
+# or https://github.com/scikit-hep/particle for details.
+
+import pytest
+
+# Requires pandas
+pd = pytest.importorskip("pandas")
+
+from particle.particle.convert import get_from_pdg_mcd
+
+try:
+ from pathlib2 import Path
+except ImportError:
+ from pathlib import Path
+
+
+DIR = Path(__file__).parent.resolve()
+
+
+def test_get_from_pdg_mcd():
+ with (DIR / "../data/test_PDG_mcd_file_duplicates.mcd").open() as f:
+ with pytest.raises(AssertionError):
+ get_from_pdg_mcd(f)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_decfilenames.py
new/tests/particle/test_decfilenames.py
--- old/tests/particle/test_decfilenames.py 2021-06-24 11:03:53.000000000
+0200
+++ new/tests/particle/test_decfilenames.py 2021-09-11 04:45:58.000000000
+0200
@@ -6,11 +6,8 @@
from __future__ import absolute_import, division, print_function
-import pytest
-
from particle.particle import Particle, ParticleNotFound
-
# All particle names found in DECAY.DEC
dec_names = [
"B'_1+",
@@ -571,7 +568,7 @@
]
-# Sub-list of .dec particle names unkown to the PDG data table (the .mcd and
our .csv files)
+# Sub-list of .dec particle names unknown to the PDG data table (the .mcd and
our .csv files)
list_dec_but_not_in_pdt = [
"B'_1+",
"B'_1-",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_generation.py
new/tests/particle/test_generation.py
--- old/tests/particle/test_generation.py 2021-06-24 11:03:53.000000000
+0200
+++ new/tests/particle/test_generation.py 2021-09-11 04:45:58.000000000
+0200
@@ -14,37 +14,36 @@
from particle import data
from particle.particle.convert import produce_files
-
-FILES = ["particle2019.csv", "particle2020.csv"]
+FILES = ["particle2020.csv", "particle2021.csv"]
def test_generate(tmp_path):
"This verifies that the input and output files match."
- particle2019 = tmp_path / "particle2019.csv"
particle2020 = tmp_path / "particle2020.csv"
+ particle2021 = tmp_path / "particle2021.csv"
- produce_files(particle2019, particle2020, "DUMMY", "2020")
+ produce_files(particle2020, particle2021, "DUMMY", "2021")
"""
# No longer test this file, which eventually will be removed
- particle2018_data = data.open_text(data, "particle2018.csv")
+ particle2018_data = data.basepath / "particle2018.csv"
with particle2018.open() as src, particle2018_data as res:
src = [l for l in src.readlines() if not l.startswith("#")]
res = [l for l in res.readlines() if not l.startswith("#")]
assert src == res
"""
- particle2020_data = data.open_text(data, "particle2020.csv")
- with particle2020.open() as src, particle2020_data as res:
- src = [l for l in src.readlines() if not l.startswith("#")]
- res = [l for l in res.readlines() if not l.startswith("#")]
+ particle2021_data = data.basepath / "particle2021.csv"
+ with particle2021.open() as src, particle2021_data.open() as res:
+ src = [line for line in src.readlines() if not line.startswith("#")]
+ res = [line for line in res.readlines() if not line.startswith("#")]
assert src == res
@pytest.mark.parametrize("filename", FILES)
-def test_file_dup(filename):
- with data.open_text(data, filename) as particle_data:
+def test_csv_file_duplicates(filename):
+ with data.basepath / filename as particle_data:
p = pd.read_csv(particle_data, comment="#")
duplicates = {item for item, count in Counter(p.ID).items() if count > 1}
@@ -52,8 +51,8 @@
@pytest.mark.parametrize("filename", FILES)
-def test_file_has_latex(filename):
- with data.open_text(data, filename) as particle_data:
+def test_csv_file_has_latex(filename):
+ with data.basepath / filename as particle_data:
p = pd.read_csv(particle_data, comment="#")
assert p[p.Latex == ""].empty
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_kinematics.py
new/tests/particle/test_kinematics.py
--- old/tests/particle/test_kinematics.py 2021-06-24 11:03:53.000000000
+0200
+++ new/tests/particle/test_kinematics.py 2021-09-11 04:45:58.000000000
+0200
@@ -5,13 +5,11 @@
# or https://github.com/scikit-hep/particle for details.
import pytest
+from hepunits.constants import hbar
+from hepunits.units import GeV, MeV, ps
from pytest import approx
-from particle.particle import width_to_lifetime
-from particle.particle import lifetime_to_width
-
-from hepunits.units import MeV, GeV, ps
-from hepunits.constants import hbar
+from particle.particle import lifetime_to_width, width_to_lifetime
def test_valid_width_lifetime_conversions():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_literals.py
new/tests/particle/test_literals.py
--- old/tests/particle/test_literals.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/particle/test_literals.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,8 +6,6 @@
from __future__ import division
-import pytest
-
from particle import literals as lp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_particle.py
new/tests/particle/test_particle.py
--- old/tests/particle/test_particle.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/particle/test_particle.py 2021-09-11 04:45:58.000000000 +0200
@@ -9,32 +9,36 @@
import sys
import pytest
+from hepunits import meter, second
from pytest import approx
-from particle.particle.enums import Charge, Parity, SpinType, Status, Inv
+from particle import data
from particle.particle import Particle
-from particle.particle.particle import ParticleNotFound, InvalidParticle
+from particle.particle.enums import Charge, Inv, Parity, SpinType, Status
+from particle.particle.particle import InvalidParticle, ParticleNotFound
from particle.pdgid import PDGID
-from particle.pdgid.functions import _digit, Location
-from particle import data
-
-from hepunits import second, meter
+from particle.pdgid.functions import Location, _digit
def test_find():
# 1 match found
- prepr = repr(Particle.find(name="gamma"))
+ with pytest.deprecated_call():
+ prepr = repr(Particle.find(name="gamma"))
assert prepr == '<Particle: name="gamma", pdgid=22, mass=0.0 MeV>'
# No match found
- with pytest.raises(ParticleNotFound):
+ with pytest.deprecated_call(), pytest.raises(ParticleNotFound):
Particle.find(name="NotInPDT")
# Multiple matches found
- with pytest.raises(RuntimeError):
+ with pytest.deprecated_call(), pytest.raises(RuntimeError):
Particle.find(name=lambda x: "Upsilon" in x)
+def test_sorted_find():
+ assert Particle.findall() == sorted(Particle.finditer())
+
+
def test_lambda_style_search():
particles = Particle.findall(lambda p: p.pdg_name == "p")
assert len(particles) == 4
@@ -43,11 +47,15 @@
assert 1000010010 in particles
assert -1000010010 in particles
- [p.pdgid for p in Particle.findall(lambda p: p.pdg_name == "p" and p > 0)]
== [
+ assert [
+ p.pdgid for p in Particle.findall(lambda p: p.pdg_name == "p" and p >
0)
+ ] == [
2212,
1000010010,
]
- [p.pdgid for p in Particle.findall(lambda p: p.pdg_name == "p" and p < 0)]
== [
+ assert [
+ p.pdgid for p in Particle.findall(lambda p: p.pdg_name == "p" and p <
0)
+ ] == [
-2212,
-1000010010,
]
@@ -78,17 +86,20 @@
assert 2212 in particles
assert 1000010010 in particles
- [p.pdgid for p in Particle.findall(pdg_name="p", particle=True)] == [
+ assert [p.pdgid for p in Particle.findall(pdg_name="p", particle=True)] ==
[
2212,
1000010010,
]
- [p.pdgid for p in Particle.findall(pdg_name="p", particle=False)] == [
+ assert [p.pdgid for p in Particle.findall(pdg_name="p", particle=False)]
== [
-2212,
-1000010010,
]
- [p.pdgid for p in Particle.findall(name="p", particle=True)] == [2212,
1000010010]
- [p.pdgid for p in Particle.findall(name="p~", particle=False)] == [
+ assert [p.pdgid for p in Particle.findall(name="p", particle=True)] == [
+ 2212,
+ 1000010010,
+ ]
+ assert [p.pdgid for p in Particle.findall(name="p~", particle=False)] == [
-2212,
-1000010010,
]
@@ -251,7 +262,7 @@
As for baryons with undefined parity, that of the antibaryon
is equally undefined, of course.
"""
- pdgid = lambda p: p.pdgid
+ pdgid = lambda p: p.pdgid # noqa: E731
pdgids_baryons_defined_P = [
pdgid(b)
@@ -303,7 +314,7 @@
[22, "Width = 0.0 MeV"], # photon
# Test print-out of symmetric width errors
[413, u"Width = 0.0834 ?? 0.0018 MeV"], # D*(2010)+
- [443, u"Width = 0.093 ?? 0.003 MeV"], # J/psi
+ [443, u"Width = 0.0926 ?? 0.0017 MeV"], # J/psi
# Test print-out of asymmetric width errors
[4222, "Width = 1.89 + 0.09 - 0.18 MeV"], # Sigma_c(2455)++
[23, u"Width = 2495.2 ?? 2.3 MeV"], # H0
@@ -331,32 +342,34 @@
def test_default_table_loading():
- assert Particle.table_names() == ("particle2020.csv", "nuclei2020.csv")
+ assert Particle.table_names() == ("particle2021.csv", "nuclei2020.csv")
def test_default_table_loading_bis():
Particle.all()
p = Particle.from_pdgid(211)
assert p.table_loaded() is True
- assert p.table_names() == ("particle2020.csv", "nuclei2020.csv")
+ assert p.table_names() == ("particle2021.csv", "nuclei2020.csv")
def test_explicit_table_loading():
- Particle.load_table(data.open_text(data, "particle2020.csv"))
- assert Particle.table_loaded() == True
+ Particle.load_table(data.basepath / "particle2021.csv")
+ assert Particle.table_loaded()
assert len(Particle.table_names()) == 1
assert Particle.all() is not None
def test_all_particles_are_loaded():
- Particle.load_table(data.open_text(data, "particle2018.csv"))
+ Particle.load_table(data.basepath / "particle2018.csv")
assert len(Particle.all()) == 605
- Particle.load_table(data.open_text(data, "particle2019.csv"))
+ Particle.load_table(data.basepath / "particle2019.csv")
assert len(Particle.all()) == 610
- Particle.load_table(data.open_text(data, "particle2020.csv"))
+ Particle.load_table(data.basepath / "particle2020.csv")
assert len(Particle.all()) == 610
+ Particle.load_table(data.basepath / "particle2021.csv")
+ assert len(Particle.all()) == 616
- Particle.load_table(data.open_text(data, "nuclei2020.csv"))
+ Particle.load_table(data.basepath / "nuclei2020.csv")
assert len(Particle.all()) == 5880
# Load default table to restore global state
@@ -491,12 +504,12 @@
_non_unflavoured_mesons = [pid for pid in PDGIDs if pid not in
_unflavoured_mesons]
for pid in _unflavoured_mesons:
try:
- assert Particle.from_pdgid(pid).is_unflavoured_meson == True
+ assert Particle.from_pdgid(pid).is_unflavoured_meson
except (ParticleNotFound, InvalidParticle):
pass
for pid in _non_unflavoured_mesons:
try:
- assert Particle.from_pdgid(pid).is_unflavoured_meson == False
+ assert not Particle.from_pdgid(pid).is_unflavoured_meson
except (ParticleNotFound, InvalidParticle):
pass
@@ -567,7 +580,7 @@
def test_isospin(pid, isospin):
particle = Particle.from_pdgid(pid)
- assert particle.I == isospin
+ assert particle.I == isospin # noqa: E741
def test_default_particle():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/particle/test_utilities.py
new/tests/particle/test_utilities.py
--- old/tests/particle/test_utilities.py 2021-06-24 11:03:53.000000000
+0200
+++ new/tests/particle/test_utilities.py 2021-09-11 04:45:58.000000000
+0200
@@ -4,16 +4,13 @@
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/particle for details.
-import pytest
import sys
-from particle import Particle
-from particle.particle.utilities import programmatic_name
-from particle.particle.utilities import str_with_unc
-from particle.particle.particle import ParticleNotFound
+import pytest
+from particle.particle.utilities import str_with_unc
-possibilites = (
+possibilities = (
(1.234567, 0.01, None, u"1.235 ?? 0.010"),
(1.234567e-9, 0.01e-9, None, u"1.235e-09 ?? 1.0e-11"),
(1.234567e9, 0.04e9, None, u"1.23e+09 ?? 4e+07"),
@@ -29,7 +26,7 @@
)
[email protected]("value,err_u,err_l,test_str", possibilites)
[email protected]("value,err_u,err_l,test_str", possibilities)
def test_unc_printout(value, err_u, err_l, test_str):
if sys.version_info < (3, 0):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/pdgid/test_functions.py
new/tests/pdgid/test_functions.py
--- old/tests/pdgid/test_functions.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/pdgid/test_functions.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,44 +6,46 @@
from __future__ import absolute_import, division, print_function
-import pytest
-
-from particle.pdgid import is_valid
-from particle.pdgid import is_quark
-from particle.pdgid import is_lepton
-from particle.pdgid import is_hadron
-from particle.pdgid import is_meson
-from particle.pdgid import is_baryon
-from particle.pdgid import is_pentaquark
-from particle.pdgid import is_gauge_boson_or_higgs
-from particle.pdgid import is_sm_gauge_boson_or_higgs
-from particle.pdgid import is_generator_specific
-from particle.pdgid import is_special_particle
-from particle.pdgid import is_nucleus
-from particle.pdgid import is_diquark
-from particle.pdgid import is_Rhadron
-from particle.pdgid import is_Qball
-from particle.pdgid import is_dyon
-from particle.pdgid import is_SUSY
-from particle.pdgid import is_technicolor
-from particle.pdgid import is_composite_quark_or_lepton
-from particle.pdgid import has_down
-from particle.pdgid import has_up
-from particle.pdgid import has_strange
-from particle.pdgid import has_charm
-from particle.pdgid import has_bottom
-from particle.pdgid import has_top
-from particle.pdgid import has_fundamental_anti
-from particle.pdgid import charge
-from particle.pdgid import three_charge
-from particle.pdgid import J
-from particle.pdgid import j_spin
-from particle.pdgid import S
-from particle.pdgid import s_spin
-from particle.pdgid import L
-from particle.pdgid import l_spin
-from particle.pdgid import A
-from particle.pdgid import Z
+from particle.pdgid import (
+ A,
+ J,
+ L,
+ S,
+ Z,
+ charge,
+ has_bottom,
+ has_charm,
+ has_down,
+ has_fundamental_anti,
+ has_strange,
+ has_top,
+ has_up,
+ is_baryon,
+ is_diquark,
+ is_dyon,
+ is_excited_quark_or_lepton,
+ is_gauge_boson_or_higgs,
+ is_generator_specific,
+ is_hadron,
+ is_lepton,
+ is_meson,
+ is_nucleus,
+ is_pentaquark,
+ is_Qball,
+ is_quark,
+ is_Rhadron,
+ is_sm_gauge_boson_or_higgs,
+ is_sm_lepton,
+ is_sm_quark,
+ is_special_particle,
+ is_SUSY,
+ is_technicolor,
+ is_valid,
+ j_spin,
+ l_spin,
+ s_spin,
+ three_charge,
+)
def test_charge(PDGIDs):
@@ -87,27 +89,27 @@
def test_is_valid(PDGIDs):
- assert is_valid(PDGIDs.Photon) == True
- assert is_valid(PDGIDs.Gluon) == True
- assert is_valid(PDGIDs.Electron) == True
- assert is_valid(PDGIDs.AntiMuon) == True
- assert is_valid(PDGIDs.jpsi) == True
- assert is_valid(PDGIDs.Upsilon_1S) == True
- assert is_valid(PDGIDs.PiPlus) == True
- assert is_valid(PDGIDs.KMinus) == True
- assert is_valid(PDGIDs.D0) == True
- assert is_valid(PDGIDs.DPlus) == True
- assert is_valid(PDGIDs.DsPlus) == True
- assert is_valid(PDGIDs.B0) == True
- assert is_valid(PDGIDs.Bs) == True
- assert is_valid(PDGIDs.BcPlus) == True
- assert is_valid(PDGIDs.Proton) == True
- assert is_valid(PDGIDs.LcPlus) == True
- assert is_valid(PDGIDs.Lb) == True
- assert is_valid(PDGIDs.DD1) == True
- assert is_valid(PDGIDs.SD0) == True
- assert is_valid(PDGIDs.Invalid1) == False
- assert is_valid(PDGIDs.Invalid2) == False
+ assert is_valid(PDGIDs.Photon)
+ assert is_valid(PDGIDs.Gluon)
+ assert is_valid(PDGIDs.Electron)
+ assert is_valid(PDGIDs.AntiMuon)
+ assert is_valid(PDGIDs.jpsi)
+ assert is_valid(PDGIDs.Upsilon_1S)
+ assert is_valid(PDGIDs.PiPlus)
+ assert is_valid(PDGIDs.KMinus)
+ assert is_valid(PDGIDs.D0)
+ assert is_valid(PDGIDs.DPlus)
+ assert is_valid(PDGIDs.DsPlus)
+ assert is_valid(PDGIDs.B0)
+ assert is_valid(PDGIDs.Bs)
+ assert is_valid(PDGIDs.BcPlus)
+ assert is_valid(PDGIDs.Proton)
+ assert is_valid(PDGIDs.LcPlus)
+ assert is_valid(PDGIDs.Lb)
+ assert is_valid(PDGIDs.DD1)
+ assert is_valid(PDGIDs.SD0)
+ assert not is_valid(PDGIDs.Invalid1)
+ assert not is_valid(PDGIDs.Invalid2)
def test_is_quark(PDGIDs):
@@ -123,9 +125,25 @@
)
_non_quarks = [id for id in PDGIDs if id not in _quarks]
for id in _quarks:
- assert is_quark(id) == True
+ assert is_quark(id)
for id in _non_quarks:
- assert is_quark(id) == False
+ assert not is_quark(id)
+
+
+def test_is_sm_quark(PDGIDs):
+ _sm_quarks = (
+ PDGIDs.DQuark,
+ PDGIDs.UQuark,
+ PDGIDs.SQuark,
+ PDGIDs.CQuark,
+ PDGIDs.BQuark,
+ PDGIDs.TQuark,
+ )
+ _non_sm_quarks = [id for id in PDGIDs if id not in _sm_quarks]
+ for id in _sm_quarks:
+ assert is_sm_quark(id)
+ for id in _non_sm_quarks:
+ assert not is_sm_quark(id)
def test_is_lepton(PDGIDs):
@@ -138,13 +156,29 @@
PDGIDs.TauPrime,
PDGIDs.Nu_e,
PDGIDs.NuBar_tau,
- PDGIDs.AntiElectronStar,
)
_non_leptons = [id for id in PDGIDs if id not in _leptons]
for id in _leptons:
- assert is_lepton(id) == True
+ assert is_lepton(id)
for id in _non_leptons:
- assert is_lepton(id) == False
+ assert not is_lepton(id)
+
+
+def test_is_sm_lepton(PDGIDs):
+ _sm_leptons = (
+ PDGIDs.Electron,
+ PDGIDs.Positron,
+ PDGIDs.Muon,
+ PDGIDs.AntiMuon,
+ PDGIDs.Tau,
+ PDGIDs.Nu_e,
+ PDGIDs.NuBar_tau,
+ )
+ _non_sm_leptons = [id for id in PDGIDs if id not in _sm_leptons]
+ for id in _sm_leptons:
+ assert is_sm_lepton(id)
+ for id in _non_sm_leptons:
+ assert not is_sm_lepton(id)
def test_is_meson(PDGIDs):
@@ -188,9 +222,9 @@
)
_non_mesons = [id for id in PDGIDs if id not in _mesons]
for id in _mesons:
- assert is_meson(id) == True
+ assert is_meson(id)
for id in _non_mesons:
- assert is_meson(id) == False
+ assert not is_meson(id)
def test_is_baryon(PDGIDs):
@@ -214,9 +248,9 @@
)
_non_baryons = [id for id in PDGIDs if id not in _baryons]
for id in _baryons:
- assert is_baryon(id) == True
+ assert is_baryon(id)
for id in _non_baryons:
- assert is_baryon(id) == False
+ assert not is_baryon(id)
def test_is_hadron(PDGIDs):
@@ -227,10 +261,10 @@
def test_is_pentaquark(PDGIDs):
_pentaquarks = (PDGIDs.UCbarCUDPentaquark, PDGIDs.AntiUCbarCUDPentaquark)
_non_pentaquarks = [id for id in PDGIDs if id not in _pentaquarks]
- assert is_pentaquark(PDGIDs.UCbarCUDPentaquark) == True
- assert is_pentaquark(PDGIDs.AntiUCbarCUDPentaquark) == True
+ assert is_pentaquark(PDGIDs.UCbarCUDPentaquark)
+ assert is_pentaquark(PDGIDs.AntiUCbarCUDPentaquark)
for id in _non_pentaquarks:
- assert is_pentaquark(id) == False
+ assert not is_pentaquark(id)
def test_is_gauge_boson_or_higgs(PDGIDs):
@@ -245,9 +279,9 @@
)
_non_gb_and_higgs = [id for id in PDGIDs if id not in _gb_and_higgs]
for id in _gb_and_higgs:
- assert is_gauge_boson_or_higgs(id) == True
+ assert is_gauge_boson_or_higgs(id)
for id in _non_gb_and_higgs:
- assert is_gauge_boson_or_higgs(id) == False
+ assert not is_gauge_boson_or_higgs(id)
def test_is_sm_gauge_boson_or_higgs(PDGIDs):
@@ -260,18 +294,18 @@
)
_non_sm_gb_and_higgs = [id for id in PDGIDs if id not in _sm_gb_and_higgs]
for id in _sm_gb_and_higgs:
- assert is_sm_gauge_boson_or_higgs(id) == True
+ assert is_sm_gauge_boson_or_higgs(id)
for id in _non_sm_gb_and_higgs:
- assert is_sm_gauge_boson_or_higgs(id) == False
+ assert not is_sm_gauge_boson_or_higgs(id)
def test_is_generator_specific(PDGIDs):
_generator_specific = (PDGIDs.AntiCHadron,)
_non_generator_specific = [id for id in PDGIDs if id not in
_generator_specific]
for id in _generator_specific:
- assert is_generator_specific(id) == True
+ assert is_generator_specific(id)
for id in _non_generator_specific:
- assert is_generator_specific(id) == False
+ assert not is_generator_specific(id)
def test_is_special_particle(PDGIDs):
@@ -284,9 +318,9 @@
)
_non_special_particle = [id for id in PDGIDs if id not in
_special_particle]
for id in _special_particle:
- assert is_special_particle(id) == True
+ assert is_special_particle(id)
for id in _non_special_particle:
- assert is_special_particle(id) == False
+ assert not is_special_particle(id)
def test_is_nucleus(PDGIDs):
@@ -298,146 +332,146 @@
)
_non_nuclei = [id for id in PDGIDs if id not in _nuclei]
for id in _nuclei:
- assert is_nucleus(id) == True
+ assert is_nucleus(id)
for id in _non_nuclei:
- assert is_nucleus(id) == False
+ assert not is_nucleus(id)
def test_is_diquark(PDGIDs):
_diquarks = (PDGIDs.DD1, PDGIDs.SD0)
_non_diquarks = [id for id in PDGIDs if id not in _diquarks]
for id in _diquarks:
- assert is_diquark(id) == True
+ assert is_diquark(id)
for id in _non_diquarks:
- assert is_diquark(id) == False
+ assert not is_diquark(id)
def test_is_Rhadron(PDGIDs):
_Rhadrons = (PDGIDs.RPlus_TTildeDbar, PDGIDs.R0_GTildeG,
PDGIDs.RPlusPlus_GTildeUUU)
_non_Rhadrons = [id for id in PDGIDs if id not in _Rhadrons]
for id in _Rhadrons:
- assert is_Rhadron(id) == True
+ assert is_Rhadron(id)
for id in _non_Rhadrons:
- assert is_Rhadron(id) == False
+ assert not is_Rhadron(id)
def test_is_Qball(PDGIDs):
_Qballs = (PDGIDs.QBall1, PDGIDs.QBall2)
_non_Qballs = [id for id in PDGIDs if id not in _Qballs]
for id in _Qballs:
- assert is_Qball(id) == True
+ assert is_Qball(id)
for id in _non_Qballs:
- assert is_Qball(id) == False
+ assert not is_Qball(id)
def test_is_dyon(PDGIDs):
_dyons = (PDGIDs.DyonSameMagElecChargeSign,
PDGIDs.DyonOppositeMagElecChargeSign)
_non_dyons = [id for id in PDGIDs if id not in _dyons]
for id in _dyons:
- assert is_dyon(id) == True
+ assert is_dyon(id)
for id in _non_dyons:
- assert is_dyon(id) == False
+ assert not is_dyon(id)
def test_is_SUSY(PDGIDs):
_susy = (PDGIDs.Gluino, PDGIDs.Gravitino, PDGIDs.STildeL, PDGIDs.CTildeR)
_non_susy = [id for id in PDGIDs if id not in _susy]
for id in _susy:
- assert is_SUSY(id) == True
+ assert is_SUSY(id)
for id in _non_susy:
- assert is_SUSY(id) == False
+ assert not is_SUSY(id)
def test_is_technicolor(PDGIDs):
_technicolor = (PDGIDs.Pi0TC, PDGIDs.PiMinusTC)
_non_technicolor = [id for id in PDGIDs if id not in _technicolor]
for id in _technicolor:
- assert is_technicolor(id) == True
+ assert is_technicolor(id)
for id in _non_technicolor:
- assert is_technicolor(id) == False
+ assert not is_technicolor(id)
-def test_is_composite_quark_or_lepton(PDGIDs):
- _composite_quark_or_lepton = (PDGIDs.UQuarkStar, PDGIDs.AntiElectronStar)
- _non_composite_quark_or_lepton = [
- id for id in PDGIDs if id not in _composite_quark_or_lepton
+def test_is_excited_quark_or_lepton(PDGIDs):
+ _excited_quark_or_lepton = (PDGIDs.UQuarkStar, PDGIDs.AntiElectronStar)
+ _non_excited_quark_or_lepton = [
+ id for id in PDGIDs if id not in _excited_quark_or_lepton
]
- for id in _composite_quark_or_lepton:
- assert is_composite_quark_or_lepton(id) == True
- for id in _non_composite_quark_or_lepton:
- assert is_composite_quark_or_lepton(id) == False
+ for id in _excited_quark_or_lepton:
+ assert is_excited_quark_or_lepton(id)
+ for id in _non_excited_quark_or_lepton:
+ assert not is_excited_quark_or_lepton(id)
def test_has_down(PDGIDs):
- assert has_down(PDGIDs.Photon) == False
- assert has_down(PDGIDs.Gluon) == False
- assert has_down(PDGIDs.Electron) == False
- assert has_down(PDGIDs.AntiMuon) == False
- assert has_down(PDGIDs.jpsi) == False
- assert has_down(PDGIDs.Upsilon_1S) == False
- assert has_down(PDGIDs.PiPlus) == True
- assert has_down(PDGIDs.KMinus) == False
- assert has_down(PDGIDs.D0) == False
- assert has_down(PDGIDs.DPlus) == True
- assert has_down(PDGIDs.DsPlus) == False
- assert has_down(PDGIDs.B0) == True
- assert has_down(PDGIDs.Bs) == False
- assert has_down(PDGIDs.BcPlus) == False
- assert has_down(PDGIDs.Proton) == True
- assert has_down(PDGIDs.LcPlus) == True
- assert has_down(PDGIDs.Lb) == True
- assert has_down(PDGIDs.DD1) == True
- assert has_down(PDGIDs.SD0) == True
- assert has_down(PDGIDs.Invalid1) == False
- assert has_down(PDGIDs.Invalid2) == False
+ assert not has_down(PDGIDs.Photon)
+ assert not has_down(PDGIDs.Gluon)
+ assert not has_down(PDGIDs.Electron)
+ assert not has_down(PDGIDs.AntiMuon)
+ assert not has_down(PDGIDs.jpsi)
+ assert not has_down(PDGIDs.Upsilon_1S)
+ assert has_down(PDGIDs.PiPlus)
+ assert not has_down(PDGIDs.KMinus)
+ assert not has_down(PDGIDs.D0)
+ assert has_down(PDGIDs.DPlus)
+ assert not has_down(PDGIDs.DsPlus)
+ assert has_down(PDGIDs.B0)
+ assert not has_down(PDGIDs.Bs)
+ assert not has_down(PDGIDs.BcPlus)
+ assert has_down(PDGIDs.Proton)
+ assert has_down(PDGIDs.LcPlus)
+ assert has_down(PDGIDs.Lb)
+ assert has_down(PDGIDs.DD1)
+ assert has_down(PDGIDs.SD0)
+ assert not has_down(PDGIDs.Invalid1)
+ assert not has_down(PDGIDs.Invalid2)
def test_has_up(PDGIDs):
- assert has_up(PDGIDs.Photon) == False
- assert has_up(PDGIDs.Gluon) == False
- assert has_up(PDGIDs.Electron) == False
- assert has_up(PDGIDs.AntiMuon) == False
- assert has_up(PDGIDs.jpsi) == False
- assert has_up(PDGIDs.Upsilon_1S) == False
- assert has_up(PDGIDs.PiPlus) == True
- assert has_up(PDGIDs.KMinus) == True
- assert has_up(PDGIDs.D0) == True
- assert has_up(PDGIDs.DPlus) == False
- assert has_up(PDGIDs.DsPlus) == False
- assert has_up(PDGIDs.B0) == False
- assert has_up(PDGIDs.Bs) == False
- assert has_up(PDGIDs.BcPlus) == False
- assert has_up(PDGIDs.Proton) == True
- assert has_up(PDGIDs.LcPlus) == True
- assert has_up(PDGIDs.Lb) == True
- assert has_up(PDGIDs.DD1) == False
- assert has_up(PDGIDs.SD0) == False
- assert has_up(PDGIDs.Invalid1) == False
- assert has_up(PDGIDs.Invalid2) == False
+ assert not has_up(PDGIDs.Photon)
+ assert not has_up(PDGIDs.Gluon)
+ assert not has_up(PDGIDs.Electron)
+ assert not has_up(PDGIDs.AntiMuon)
+ assert not has_up(PDGIDs.jpsi)
+ assert not has_up(PDGIDs.Upsilon_1S)
+ assert has_up(PDGIDs.PiPlus)
+ assert has_up(PDGIDs.KMinus)
+ assert has_up(PDGIDs.D0)
+ assert not has_up(PDGIDs.DPlus)
+ assert not has_up(PDGIDs.DsPlus)
+ assert not has_up(PDGIDs.B0)
+ assert not has_up(PDGIDs.Bs)
+ assert not has_up(PDGIDs.BcPlus)
+ assert has_up(PDGIDs.Proton)
+ assert has_up(PDGIDs.LcPlus)
+ assert has_up(PDGIDs.Lb)
+ assert not has_up(PDGIDs.DD1)
+ assert not has_up(PDGIDs.SD0)
+ assert not has_up(PDGIDs.Invalid1)
+ assert not has_up(PDGIDs.Invalid2)
def test_has_strange(PDGIDs):
- assert has_strange(PDGIDs.Photon) == False
- assert has_strange(PDGIDs.Gluon) == False
- assert has_strange(PDGIDs.Electron) == False
- assert has_strange(PDGIDs.AntiMuon) == False
- assert has_strange(PDGIDs.jpsi) == False
- assert has_strange(PDGIDs.Upsilon_1S) == False
- assert has_strange(PDGIDs.PiPlus) == False
- assert has_strange(PDGIDs.KMinus) == True
- assert has_strange(PDGIDs.D0) == False
- assert has_strange(PDGIDs.DPlus) == False
- assert has_strange(PDGIDs.DsPlus) == True
- assert has_strange(PDGIDs.B0) == False
- assert has_strange(PDGIDs.Bs) == True
- assert has_strange(PDGIDs.BcPlus) == False
- assert has_strange(PDGIDs.Proton) == False
- assert has_strange(PDGIDs.LcPlus) == False
- assert has_strange(PDGIDs.Lb) == False
- assert has_strange(PDGIDs.DD1) == False
- assert has_strange(PDGIDs.SD0) == True
- assert has_strange(PDGIDs.Invalid1) == False
- assert has_strange(PDGIDs.Invalid2) == False
+ assert not has_strange(PDGIDs.Photon)
+ assert not has_strange(PDGIDs.Gluon)
+ assert not has_strange(PDGIDs.Electron)
+ assert not has_strange(PDGIDs.AntiMuon)
+ assert not has_strange(PDGIDs.jpsi)
+ assert not has_strange(PDGIDs.Upsilon_1S)
+ assert not has_strange(PDGIDs.PiPlus)
+ assert has_strange(PDGIDs.KMinus)
+ assert not has_strange(PDGIDs.D0)
+ assert not has_strange(PDGIDs.DPlus)
+ assert has_strange(PDGIDs.DsPlus)
+ assert not has_strange(PDGIDs.B0)
+ assert has_strange(PDGIDs.Bs)
+ assert not has_strange(PDGIDs.BcPlus)
+ assert not has_strange(PDGIDs.Proton)
+ assert not has_strange(PDGIDs.LcPlus)
+ assert not has_strange(PDGIDs.Lb)
+ assert not has_strange(PDGIDs.DD1)
+ assert has_strange(PDGIDs.SD0)
+ assert not has_strange(PDGIDs.Invalid1)
+ assert not has_strange(PDGIDs.Invalid2)
def test_has_charm(PDGIDs):
@@ -454,9 +488,9 @@
)
_without_charm_content = [id for id in PDGIDs if id not in
_with_charm_content]
for id in _with_charm_content:
- assert has_charm(id) == True
+ assert has_charm(id)
for id in _without_charm_content:
- assert has_charm(id) == False
+ assert not has_charm(id)
def test_has_bottom(PDGIDs):
@@ -471,19 +505,19 @@
)
_without_bottom_content = [id for id in PDGIDs if id not in
_with_bottom_content]
for id in _with_bottom_content:
- assert has_bottom(id) == True
+ assert has_bottom(id)
for id in _without_bottom_content:
- assert has_bottom(id) == False
+ assert not has_bottom(id)
def test_has_top(PDGIDs):
- assert has_top(PDGIDs.T0) == True
- assert has_top(PDGIDs.LtPlus) == True
+ assert has_top(PDGIDs.T0)
+ assert has_top(PDGIDs.LtPlus)
_no_top = [
id for id in PDGIDs if id not in (PDGIDs.T0, PDGIDs.LtPlus)
] # top quark should also return has_top(6)==False !
for id in _no_top:
- assert has_top(id) == False
+ assert not has_top(id)
def test_has_fundamental_anti(PDGIDs):
@@ -514,9 +548,9 @@
)
_nope = [id for id in PDGIDs if id not in _yep]
for id in _yep:
- assert has_fundamental_anti(id) == True
+ assert has_fundamental_anti(id)
for id in _nope:
- assert has_fundamental_anti(id) == False
+ assert not has_fundamental_anti(id)
def mesons_JSL_states_list(PDGIDs, jsl):
@@ -543,18 +577,18 @@
"110": (PDGIDs.rho_770_minus,),
"111": (PDGIDs.K1_1400_0,),
"112": (PDGIDs.rho_1700_0,),
- #'202': (),
+ # '202': (),
"211": (PDGIDs.a2_1320_minus,),
- #'212': (),
- #'213': (),
- #'303': (),
+ # '212': (),
+ # '213': (),
+ # '303': (),
"312": (PDGIDs.omega_3_1670,),
- #'313': (),
- #'314': (),
- #'404': (),
- #'413': (),
- #'414': (),
- #'415': ()
+ # '313': (),
+ # '314': (),
+ # '404': (),
+ # '413': (),
+ # '414': (),
+ # '415': ()
}
return _states[jsl]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/pdgid/test_literals.py
new/tests/pdgid/test_literals.py
--- old/tests/pdgid/test_literals.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/pdgid/test_literals.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,8 +6,6 @@
from __future__ import division
-import pytest
-
from particle.pdgid import literals as lid
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/pdgid/test_pdgid.py
new/tests/pdgid/test_pdgid.py
--- old/tests/pdgid/test_pdgid.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/pdgid/test_pdgid.py 2021-09-11 04:45:58.000000000 +0200
@@ -7,8 +7,8 @@
import pytest
from particle.pdgid import PDGID
-from particle.pdgid.pdgid import _fnames
from particle.pdgid import functions as _functions
+from particle.pdgid.pdgid import _fnames
def test_class_string_representations():
@@ -38,11 +38,11 @@
def test_nonphysical_pdgids():
# The negative PDGID of a self-conjugate meson makes no sense
- assert (
- PDGID(-111).is_meson == False
+ assert not (
+ PDGID(-111).is_meson
) # the "anti-pi0" with opposite PDGID of a pi0 does not exist
- assert (
- PDGID(-443).is_meson == False
+ assert not (
+ PDGID(-443).is_meson
) # the "anti-J/psi" with opposite PDGID of a J/psi does not exist
@@ -65,9 +65,9 @@
is_Rhadron False
is_SUSY False
is_baryon False
-is_composite_quark_or_lepton False
is_diquark False
is_dyon False
+is_excited_quark_or_lepton False
is_gauge_boson_or_higgs True
is_generator_specific False
is_hadron False
@@ -77,6 +77,8 @@
is_pentaquark False
is_quark False
is_sm_gauge_boson_or_higgs True
+is_sm_lepton False
+is_sm_quark False
is_special_particle False
is_technicolor False
is_valid True
@@ -93,6 +95,7 @@
Check that all particle.pdgid functions decorated in the PDGID class
work as expected for all kinds of PDGIDs.
"""
- for m in _fnames:
- for pid in PDGIDs:
- assert getattr(PDGID(pid), m) == getattr(_functions, m)(pid)
+ with pytest.deprecated_call():
+ for m in _fnames:
+ for pid in PDGIDs:
+ assert getattr(PDGID(pid), m) == getattr(_functions, m)(pid)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/tests/pythia/test_pythiaid.py
new/tests/pythia/test_pythiaid.py
--- old/tests/pythia/test_pythiaid.py 2021-06-24 11:03:53.000000000 +0200
+++ new/tests/pythia/test_pythiaid.py 2021-09-11 04:45:58.000000000 +0200
@@ -6,9 +6,9 @@
import pytest
-from particle.pythia import PythiaID
-from particle.pdgid import PDGID
from particle.exceptions import MatchingIDNotFound
+from particle.pdgid import PDGID
+from particle.pythia import PythiaID
def test_class_string_representations():
@@ -33,7 +33,7 @@
assert PythiaID.from_pdgid(PDGID(9010221)) == PythiaID(10221)
with pytest.raises(MatchingIDNotFound):
- pdgid = PythiaID.from_pdgid(9000221)
+ PythiaID.from_pdgid(9000221)
def test_to_pdgid():