sphysics 2.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. sphysics-2.0.3/.git_archival.txt +4 -0
  2. sphysics-2.0.3/.gitattributes +1 -0
  3. sphysics-2.0.3/.gitignore +158 -0
  4. sphysics-2.0.3/.gitlab-ci.yml +260 -0
  5. sphysics-2.0.3/.pre-commit-config.yaml +91 -0
  6. sphysics-2.0.3/.readthedocs.yaml +16 -0
  7. sphysics-2.0.3/AUTHORS.md +30 -0
  8. sphysics-2.0.3/CITATION.cff +42 -0
  9. sphysics-2.0.3/CMakeLists.txt +503 -0
  10. sphysics-2.0.3/LICENSE +674 -0
  11. sphysics-2.0.3/Makefile +15 -0
  12. sphysics-2.0.3/PKG-INFO +101 -0
  13. sphysics-2.0.3/README.md +42 -0
  14. sphysics-2.0.3/ci/Dockerfile +30 -0
  15. sphysics-2.0.3/ci/readthedocs.py +216 -0
  16. sphysics-2.0.3/cmakeModules/CommonMacros.cmake +325 -0
  17. sphysics-2.0.3/cmakeModules/FindPYLINT.cmake +88 -0
  18. sphysics-2.0.3/cmakeModules/FindROOT.cmake +624 -0
  19. sphysics-2.0.3/cmakeModules/FindTensorflow.cmake +152 -0
  20. sphysics-2.0.3/data/amplitudes/K0K0barspinnolam.csv +223 -0
  21. sphysics-2.0.3/data/amplitudes/KplusKminusspinnolam.csv +223 -0
  22. sphysics-2.0.3/data/amplitudes/kpiS_Pelaez-Rodas_2010.11222.csv +53647 -0
  23. sphysics-2.0.3/data/particleDatatable/particleDataTable2016.txt +331 -0
  24. sphysics-2.0.3/data/particleDatatable/particleDataTable2022.txt +332 -0
  25. sphysics-2.0.3/docs/Makefile +20 -0
  26. sphysics-2.0.3/docs/conf.py +65 -0
  27. sphysics-2.0.3/docs/constants.rst +7 -0
  28. sphysics-2.0.3/docs/contributing.rst +69 -0
  29. sphysics-2.0.3/docs/conventions.rst +22 -0
  30. sphysics-2.0.3/docs/environment.rst +9 -0
  31. sphysics-2.0.3/docs/gettingstarted.rst +105 -0
  32. sphysics-2.0.3/docs/index.rst +62 -0
  33. sphysics-2.0.3/docs/sphysics.amplitudes.rst +20 -0
  34. sphysics-2.0.3/docs/sphysics.dirac.rst +9 -0
  35. sphysics-2.0.3/docs/sphysics.eventselection.rst +27 -0
  36. sphysics-2.0.3/docs/sphysics.generators.rst +10 -0
  37. sphysics-2.0.3/docs/sphysics.kinematics.rst +19 -0
  38. sphysics-2.0.3/docs/sphysics.lorentz.rst +10 -0
  39. sphysics-2.0.3/docs/sphysics.math.rst +12 -0
  40. sphysics-2.0.3/docs/sphysics.pwa.barrierFactors.rst +10 -0
  41. sphysics-2.0.3/docs/sphysics.pwa.fit.rst +10 -0
  42. sphysics-2.0.3/docs/sphysics.pwa.polarimeter.rst +15 -0
  43. sphysics-2.0.3/docs/sphysics.pwa.polarimeter.taupair.rst +10 -0
  44. sphysics-2.0.3/docs/sphysics.pwa.rst +20 -0
  45. sphysics-2.0.3/docs/sphysics.pwa.threebody.dalitz.rst +10 -0
  46. sphysics-2.0.3/docs/sphysics.pwa.threebody.rst +19 -0
  47. sphysics-2.0.3/docs/sphysics.pwa.threebody.tau.rst +10 -0
  48. sphysics-2.0.3/docs/sphysics.pwa.twobody.rst +15 -0
  49. sphysics-2.0.3/docs/sphysics.pwa.twobody.tau.rst +10 -0
  50. sphysics-2.0.3/docs/sphysics.pwa.utils.rst +10 -0
  51. sphysics-2.0.3/docs/sphysics.random.rst +10 -0
  52. sphysics-2.0.3/docs/sphysics.rst +32 -0
  53. sphysics-2.0.3/docs/sphysics.torch.hadronID.rst +10 -0
  54. sphysics-2.0.3/docs/sphysics.torch.lightning.rst +21 -0
  55. sphysics-2.0.3/docs/sphysics.torch.metrics.rst +10 -0
  56. sphysics-2.0.3/docs/sphysics.torch.rst +20 -0
  57. sphysics-2.0.3/docs/sphysics.utils.rst +10 -0
  58. sphysics-2.0.3/noxfile.py +117 -0
  59. sphysics-2.0.3/pyproject.toml +185 -0
  60. sphysics-2.0.3/scripts/CMakeLists.txt +89 -0
  61. sphysics-2.0.3/scripts/benchmark.py +641 -0
  62. sphysics-2.0.3/scripts/convertVariablesHdf5ToParquet +51 -0
  63. sphysics-2.0.3/scripts/release.sh +161 -0
  64. sphysics-2.0.3/scripts/thisSphysics.sh.in +40 -0
  65. sphysics-2.0.3/src/cppLib/constants/CMakeLists.txt +65 -0
  66. sphysics-2.0.3/src/cppLib/constants/amplitudes.h +73 -0
  67. sphysics-2.0.3/src/cppLib/constants/specialConstants.cpp +7 -0
  68. sphysics-2.0.3/src/cppLib/constants/specialConstants.h +262 -0
  69. sphysics-2.0.3/src/cppLib/particleData/CMakeLists.txt +69 -0
  70. sphysics-2.0.3/src/cppLib/particleData/particleDataTable.cc +337 -0
  71. sphysics-2.0.3/src/cppLib/particleData/particleDataTable.h +143 -0
  72. sphysics-2.0.3/src/cppLib/particleData/particleProperties.cc +594 -0
  73. sphysics-2.0.3/src/cppLib/particleData/particleProperties.h +469 -0
  74. sphysics-2.0.3/src/cppLib/pwa/CMakeLists.txt +67 -0
  75. sphysics-2.0.3/src/cppLib/pwa/fitresult.cpp +819 -0
  76. sphysics-2.0.3/src/cppLib/pwa/fitresult.h +400 -0
  77. sphysics-2.0.3/src/cppLib/pyBindings/CMakeLists.txt +118 -0
  78. sphysics-2.0.3/src/cppLib/pyBindings/constants/constants_py.cc +105 -0
  79. sphysics-2.0.3/src/cppLib/pyBindings/constants/particleDataTable_py.cc +129 -0
  80. sphysics-2.0.3/src/cppLib/pyBindings/constants/particleProperties_py.cc +148 -0
  81. sphysics-2.0.3/src/cppLib/pyBindings/pwa/fitresult_py.cc +420 -0
  82. sphysics-2.0.3/src/cppLib/pyBindings/sphysicsPy.cc +51 -0
  83. sphysics-2.0.3/src/cppLib/pyBindings/utilities/numpy.hpp +92 -0
  84. sphysics-2.0.3/src/cppLib/pyBindings/utilities/pyhelper.hpp +37 -0
  85. sphysics-2.0.3/src/cppLib/pyBindings/utilities/utilities_py.cc +55 -0
  86. sphysics-2.0.3/src/cppLib/tfLib/CMakeLists.txt +72 -0
  87. sphysics-2.0.3/src/cppLib/tfLib/test.cpp +49 -0
  88. sphysics-2.0.3/src/cppLib/utilities/CMakeLists.txt +90 -0
  89. sphysics-2.0.3/src/cppLib/utilities/environment.cmake +67 -0
  90. sphysics-2.0.3/src/cppLib/utilities/environment.cpp +75 -0
  91. sphysics-2.0.3/src/cppLib/utilities/environment.h +58 -0
  92. sphysics-2.0.3/src/cppLib/utilities/environmentStatus.h.in +68 -0
  93. sphysics-2.0.3/src/main.cpp +28 -0
  94. sphysics-2.0.3/src/sphysics/CMakeLists.txt +130 -0
  95. sphysics-2.0.3/src/sphysics/__init__.py +22 -0
  96. sphysics-2.0.3/src/sphysics/_constants/__init__.py +11 -0
  97. sphysics-2.0.3/src/sphysics/_constants/_constants.py +40 -0
  98. sphysics-2.0.3/src/sphysics/_constants/_constantsClass.py +223 -0
  99. sphysics-2.0.3/src/sphysics/_constants/_pdg.py +34 -0
  100. sphysics-2.0.3/src/sphysics/_constants/_pdgcodes.py +622 -0
  101. sphysics-2.0.3/src/sphysics/_constants/_specialConstants.py +203 -0
  102. sphysics-2.0.3/src/sphysics/_exceptions.py +8 -0
  103. sphysics-2.0.3/src/sphysics/_init_cpplibs.py +44 -0
  104. sphysics-2.0.3/src/sphysics/_root_path.py +10 -0
  105. sphysics-2.0.3/src/sphysics/_setup.py +46 -0
  106. sphysics-2.0.3/src/sphysics/_version.py +24 -0
  107. sphysics-2.0.3/src/sphysics/amplitudes/__init__.py +13 -0
  108. sphysics-2.0.3/src/sphysics/amplitudes/_a1_1420_triangle1pAmplitude.py +75 -0
  109. sphysics-2.0.3/src/sphysics/amplitudes/_kMatrixFormalism.py +550 -0
  110. sphysics-2.0.3/src/sphysics/amplitudes/_resonance.py +480 -0
  111. sphysics-2.0.3/src/sphysics/amplitudes/_swaveAmplitudeAuMorganPennington.py +223 -0
  112. sphysics-2.0.3/src/sphysics/amplitudes/_swaveAmplitudeFlatte.py +89 -0
  113. sphysics-2.0.3/src/sphysics/amplitudes/_swaveAmplitudePalanoPennington.py +146 -0
  114. sphysics-2.0.3/src/sphysics/amplitudes/_swaveAmplitudes.py +154 -0
  115. sphysics-2.0.3/src/sphysics/amplitudes/_utils.py +91 -0
  116. sphysics-2.0.3/src/sphysics/amplitudes/resonance.py +21 -0
  117. sphysics-2.0.3/src/sphysics/dirac/__init__.py +12 -0
  118. sphysics-2.0.3/src/sphysics/dirac/_dirac.py +273 -0
  119. sphysics-2.0.3/src/sphysics/eventselection/__init__.py +19 -0
  120. sphysics-2.0.3/src/sphysics/eventselection/_plotting.py +448 -0
  121. sphysics-2.0.3/src/sphysics/eventselection/_utils.py +268 -0
  122. sphysics-2.0.3/src/sphysics/eventselection/_variables.py +1158 -0
  123. sphysics-2.0.3/src/sphysics/eventselection/hist.py +55 -0
  124. sphysics-2.0.3/src/sphysics/eventselection/utils.py +12 -0
  125. sphysics-2.0.3/src/sphysics/generators/__init__.py +12 -0
  126. sphysics-2.0.3/src/sphysics/generators/_phaseSpace.py +226 -0
  127. sphysics-2.0.3/src/sphysics/generators/_tau.py +69 -0
  128. sphysics-2.0.3/src/sphysics/kinematics/__init__.py +19 -0
  129. sphysics-2.0.3/src/sphysics/kinematics/_kinematics.py +216 -0
  130. sphysics-2.0.3/src/sphysics/kinematics/geometry.py +75 -0
  131. sphysics-2.0.3/src/sphysics/lorentz.py +166 -0
  132. sphysics-2.0.3/src/sphysics/math/__init__.py +20 -0
  133. sphysics-2.0.3/src/sphysics/math/_math.py +137 -0
  134. sphysics-2.0.3/src/sphysics/math/_tfnp.py +696 -0
  135. sphysics-2.0.3/src/sphysics/pwa/__init__.py +13 -0
  136. sphysics-2.0.3/src/sphysics/pwa/_model.py +49 -0
  137. sphysics-2.0.3/src/sphysics/pwa/barrierFactors/__init__.py +14 -0
  138. sphysics-2.0.3/src/sphysics/pwa/barrierFactors/_bfQuiggHippel.py +140 -0
  139. sphysics-2.0.3/src/sphysics/pwa/barrierFactors/_cfZemach.py +178 -0
  140. sphysics-2.0.3/src/sphysics/pwa/fit/__init__.py +12 -0
  141. sphysics-2.0.3/src/sphysics/pwa/fit/_fitresult.py +319 -0
  142. sphysics-2.0.3/src/sphysics/pwa/fit/_fitter.py +382 -0
  143. sphysics-2.0.3/src/sphysics/pwa/fit/_startparameterGenrators.py +61 -0
  144. sphysics-2.0.3/src/sphysics/pwa/polarimeter/__init__.py +9 -0
  145. sphysics-2.0.3/src/sphysics/pwa/polarimeter/taupair/__init__.py +12 -0
  146. sphysics-2.0.3/src/sphysics/pwa/polarimeter/taupair/_fanoProjection.py +87 -0
  147. sphysics-2.0.3/src/sphysics/pwa/polarimeter/taupair/_polarimeter.py +158 -0
  148. sphysics-2.0.3/src/sphysics/pwa/polarimeter/taupair/_utils.py +45 -0
  149. sphysics-2.0.3/src/sphysics/pwa/threebody/__init__.py +16 -0
  150. sphysics-2.0.3/src/sphysics/pwa/threebody/_dalitzAmplitudes.py +92 -0
  151. sphysics-2.0.3/src/sphysics/pwa/threebody/_hadronicTensors.py +277 -0
  152. sphysics-2.0.3/src/sphysics/pwa/threebody/_kinematics.py +404 -0
  153. sphysics-2.0.3/src/sphysics/pwa/threebody/dalitz/__init__.py +13 -0
  154. sphysics-2.0.3/src/sphysics/pwa/threebody/dalitz/_generatorWeights.py +113 -0
  155. sphysics-2.0.3/src/sphysics/pwa/threebody/dalitz/_model.py +286 -0
  156. sphysics-2.0.3/src/sphysics/pwa/threebody/dalitz/_utils.py +193 -0
  157. sphysics-2.0.3/src/sphysics/pwa/threebody/tau/__init__.py +15 -0
  158. sphysics-2.0.3/src/sphysics/pwa/threebody/tau/_kinematics.py +433 -0
  159. sphysics-2.0.3/src/sphysics/pwa/threebody/tau/_model.py +331 -0
  160. sphysics-2.0.3/src/sphysics/pwa/threebody/tau/_utils.py +357 -0
  161. sphysics-2.0.3/src/sphysics/pwa/twobody/__init__.py +13 -0
  162. sphysics-2.0.3/src/sphysics/pwa/twobody/_hadronicTensor.py +113 -0
  163. sphysics-2.0.3/src/sphysics/pwa/twobody/_kinematics.py +130 -0
  164. sphysics-2.0.3/src/sphysics/pwa/twobody/tau/__init__.py +12 -0
  165. sphysics-2.0.3/src/sphysics/pwa/twobody/tau/_kinematics.py +20 -0
  166. sphysics-2.0.3/src/sphysics/pwa/twobody/tau/_model.py +191 -0
  167. sphysics-2.0.3/src/sphysics/pwa/utils/__init__.py +10 -0
  168. sphysics-2.0.3/src/sphysics/pwa/utils/_binning.py +481 -0
  169. sphysics-2.0.3/src/sphysics/pwa/utils/_kinematics.py +344 -0
  170. sphysics-2.0.3/src/sphysics/pwa/utils/_utils.py +727 -0
  171. sphysics-2.0.3/src/sphysics/pwa/utils/_waveset.py +258 -0
  172. sphysics-2.0.3/src/sphysics/pylintrc +327 -0
  173. sphysics-2.0.3/src/sphysics/random/__init__.py +11 -0
  174. sphysics-2.0.3/src/sphysics/random/_generators.py +155 -0
  175. sphysics-2.0.3/src/sphysics/tf.py +18 -0
  176. sphysics-2.0.3/src/sphysics/torch/__init__.py +17 -0
  177. sphysics-2.0.3/src/sphysics/torch/_plottingUtils.py +55 -0
  178. sphysics-2.0.3/src/sphysics/torch/_training.py +351 -0
  179. sphysics-2.0.3/src/sphysics/torch/hadronID/__init__.py +14 -0
  180. sphysics-2.0.3/src/sphysics/torch/hadronID/_network.py +215 -0
  181. sphysics-2.0.3/src/sphysics/torch/hadronID/_viewResults.py +824 -0
  182. sphysics-2.0.3/src/sphysics/torch/lightning/__init__.py +17 -0
  183. sphysics-2.0.3/src/sphysics/torch/lightning/_litmodules.py +303 -0
  184. sphysics-2.0.3/src/sphysics/torch/lightning/_lr_scheduler.py +43 -0
  185. sphysics-2.0.3/src/sphysics/torch/lightning/_plotting.py +117 -0
  186. sphysics-2.0.3/src/sphysics/torch/lightning/lr_schedulder.py +11 -0
  187. sphysics-2.0.3/src/sphysics/torch/metrics/__init__.py +11 -0
  188. sphysics-2.0.3/src/sphysics/torch/metrics/_metrics.py +92 -0
  189. sphysics-2.0.3/src/sphysics/utils/__init__.py +12 -0
  190. sphysics-2.0.3/src/sphysics/utils/_logger.py +384 -0
  191. sphysics-2.0.3/src/sphysics/utils/_timer.py +181 -0
  192. sphysics-2.0.3/src/sphysics/utils/_utils.py +71 -0
  193. sphysics-2.0.3/test/CMakeLists.txt +23 -0
  194. sphysics-2.0.3/test/data.npz +0 -0
  195. sphysics-2.0.3/test/test_KMatrixFormalism.py +338 -0
  196. sphysics-2.0.3/test/test_dirac.py +76 -0
  197. sphysics-2.0.3/test/test_generators.py +75 -0
  198. sphysics-2.0.3/test/test_kinematics.py +58 -0
  199. sphysics-2.0.3/test/test_lorentz.py +122 -0
  200. sphysics-2.0.3/test/test_math.py +232 -0
  201. sphysics-2.0.3/test/test_polarimeter.py +185 -0
  202. sphysics-2.0.3/test/test_tau_pwa.py +112 -0
  203. sphysics-2.0.3/test/test_utils.py +136 -0
  204. sphysics-2.0.3/test/test_variables.py +289 -0
@@ -0,0 +1,4 @@
1
+ node: $Format:%H$
2
+ node-date: $Format:%cI$
3
+ describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
4
+ ref-names: $Format:%D$
@@ -0,0 +1 @@
1
+ .git_archival.txt export-subst
@@ -0,0 +1,158 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
98
+ __pypackages__/
99
+
100
+ # Celery stuff
101
+ celerybeat-schedule
102
+ celerybeat.pid
103
+
104
+ # SageMath parsed files
105
+ *.sage.py
106
+
107
+ # Environments
108
+ .env
109
+ .venv
110
+ env/
111
+ venv/
112
+ ENV/
113
+ env.bak/
114
+ venv.bak/
115
+
116
+ # Spyder project settings
117
+ .spyderproject
118
+ .spyproject
119
+
120
+ # Rope project settings
121
+ .ropeproject
122
+
123
+ # mkdocs documentation
124
+ /site
125
+
126
+ # mypy
127
+ .mypy_cache/
128
+ .dmypy.json
129
+ dmypy.json
130
+
131
+ # Pyre type checker
132
+ .pyre/
133
+
134
+ # pytype static type analyzer
135
+ .pytype/
136
+
137
+ # Cython debug symbols
138
+ cython_debug/
139
+
140
+ # setuptools_scm
141
+ src/*/_version.py
142
+
143
+
144
+ # ruff
145
+ .ruff_cache/
146
+
147
+ # OS specific stuff
148
+ .DS_Store
149
+ .DS_Store?
150
+ ._*
151
+ .Spotlight-V100
152
+ .Trashes
153
+ ehthumbs.db
154
+ Thumbs.db
155
+
156
+ # Common editor files
157
+ *~
158
+ *.swp
@@ -0,0 +1,260 @@
1
+ stages:
2
+ - prepare
3
+ - installable
4
+ - check
5
+ - build
6
+ - release-test
7
+ - deploy
8
+
9
+
10
+ variables:
11
+ # image with all dependencies preinstalled, built from ci/Dockerfile by the ci-image job
12
+ CI_IMAGE: "$CI_REGISTRY_IMAGE/ci"
13
+ PYTHONFAULTHANDLER: "1"
14
+ TF_ENABLE_ONEDNN_OPTS: "0"
15
+ # compiler warnings are errors in the CI builds (off by default, see CMakeLists.txt);
16
+ # scikit-build-core passes this on to CMake as -DWERROR=ON
17
+ SKBUILD_CMAKE_DEFINE: "WERROR=ON"
18
+
19
+ # The build requirements are part of the CI image. Hence, all builds use
20
+ # --no-build-isolation; otherwise pip downloads them again into a temporary
21
+ # build environment for every build. The exception is the
22
+ # install-from-testpypi job, which installs sphysics the way a user does.
23
+
24
+ default:
25
+ image: "$CI_IMAGE:latest"
26
+
27
+ ci-image:
28
+ stage: prepare
29
+ image:
30
+ name: gcr.io/kaniko-project/executor:debug
31
+ entrypoint: [""]
32
+ tags:
33
+ - kubernetes-executor
34
+ rules:
35
+ - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG == null
36
+ changes:
37
+ - ci/Dockerfile
38
+ - pyproject.toml
39
+ # a rule without `if` would also create merge-request pipelines
40
+ - if: $CI_PIPELINE_SOURCE != "merge_request_event"
41
+ when: manual
42
+ allow_failure: true
43
+ script:
44
+ - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
45
+ # the layer cache keeps the digests of unchanged layers, such that runner
46
+ # nodes only download the layers that changed; cached layers expire after
47
+ # 90 days (default: 2 weeks), afterwards unpinned packages get updated
48
+ - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/ci/Dockerfile
49
+ --build-arg=CI_JOB_TOKEN --cache=true --cache-repo=$CI_IMAGE/cache --cache-ttl=2160h
50
+ --destination $CI_IMAGE:$CI_COMMIT_SHORT_SHA --destination $CI_IMAGE:latest
51
+
52
+ installable-static:
53
+ stage: installable
54
+ script:
55
+ - python -m pip wheel --no-build-isolation --no-deps --wheel-dir wheelhouse .
56
+ - python -m pip install wheelhouse/*.whl
57
+ - python -c "import sphysics"
58
+ # the wheel is reused by the jobs of the later stages
59
+ artifacts:
60
+ paths:
61
+ - wheelhouse/
62
+ expire_in: 1 day
63
+
64
+ installable-editable:
65
+ stage: installable
66
+ rules:
67
+ - if: $CI_PIPELINE_SOURCE == "push"
68
+ script:
69
+ - python -m pip install --no-build-isolation --editable .
70
+ - python -c "import sphysics"
71
+
72
+ build_pages:
73
+ stage: build
74
+ script:
75
+ - python -m pip install wheelhouse/*.whl
76
+ - cd docs
77
+ - python -c 'import sphysics'
78
+ - make clean
79
+ - make html
80
+ - mkdir -p ../public
81
+ - cp -r _build/html/* ../public/
82
+ artifacts:
83
+ paths:
84
+ - public
85
+
86
+ pages:
87
+ stage: deploy
88
+ dependencies:
89
+ - build_pages
90
+ script:
91
+ - test -d public
92
+ - ls -la public | head -n 20
93
+ artifacts:
94
+ paths:
95
+ - public
96
+ rules:
97
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
98
+
99
+ readthedocs:
100
+ stage: deploy
101
+ rules:
102
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
103
+ # `needs` replaces the stage ordering, hence the release test is listed as well,
104
+ # such that the documentation is published only if it succeeds; the artifacts
105
+ # themselves are not needed here
106
+ needs:
107
+ - job: build_pages
108
+ artifacts: false
109
+ - job: install-from-testpypi
110
+ artifacts: false
111
+ script:
112
+ # Read the Docs serves the artifacts of build_pages instead of building the documentation
113
+ # itself (see .readthedocs.yaml and ci/readthedocs.py); READTHEDOCS_TOKEN is a masked CI/CD
114
+ # variable of the project (if it is protected, the version tags must be protected tags too,
115
+ # otherwise the variable is not available in tag pipelines)
116
+ - python ci/readthedocs.py trigger
117
+
118
+
119
+ pre-commit:
120
+ stage: check
121
+ variables:
122
+ PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
123
+ rules:
124
+ - if: $CI_PIPELINE_SOURCE == "push"
125
+ script:
126
+ - pre-commit run --hook-stage manual --all-files
127
+ cache:
128
+ key:
129
+ files:
130
+ - .pre-commit-config.yaml
131
+ paths:
132
+ - .cache/pre-commit
133
+
134
+ lint:
135
+ stage: check
136
+ rules:
137
+ - if: $CI_PIPELINE_SOURCE == "push"
138
+ script:
139
+ - pylint --rcfile src/sphysics/pylintrc --reports=n
140
+ --output-format=text,pylint_gitlab.GitlabCodeClimateReporter:codeclimate.json src/sphysics
141
+ artifacts:
142
+ when: always
143
+ reports:
144
+ codequality: codeclimate.json
145
+ paths:
146
+ - codeclimate.json
147
+
148
+ tests:
149
+ stage: check
150
+ rules:
151
+ - if: $CI_PIPELINE_SOURCE == "push"
152
+ script:
153
+ - python -m pip install wheelhouse/*.whl
154
+ - python -m pytest -vv -ra --junitxml=pytest-report.xml
155
+ artifacts:
156
+ when: always
157
+ reports:
158
+ junit: pytest-report.xml
159
+ paths:
160
+ - pytest-report.xml
161
+
162
+ build_package:
163
+ stage: build
164
+ rules:
165
+ - if: $CI_PIPELINE_SOURCE == "push"
166
+ dependencies: []
167
+ script:
168
+ - python -m build --sdist --no-isolation
169
+ - python -m twine check dist/*
170
+ - python -m pip install --no-build-isolation dist/*.tar.gz
171
+ - python -c "import sphysics"
172
+ artifacts:
173
+ paths:
174
+ - dist/
175
+ expire_in: 7 days
176
+
177
+ # The release-test stage runs for release tags only. It uploads the sdist to
178
+ # TestPyPI and then installs it from there the way a user does. The deploy stage
179
+ # (GitLab package registry, PyPI, documentation) starts only if this succeeds.
180
+
181
+ # TESTPYPI_TOKEN is an API token of test.pypi.org stored as masked CI/CD
182
+ # variable of the project (if it is protected, the version tags must be
183
+ # protected tags too, otherwise the variable is not available in tag pipelines)
184
+ publish_testpypi:
185
+ stage: release-test
186
+ rules:
187
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
188
+ dependencies:
189
+ - build_package
190
+ variables:
191
+ TWINE_REPOSITORY_URL: "https://test.pypi.org/legacy/"
192
+ TWINE_USERNAME: "__token__"
193
+ TWINE_PASSWORD: "${TESTPYPI_TOKEN}"
194
+ script:
195
+ # --skip-existing, such that the job can be retried; a version can be uploaded only once
196
+ - python -m twine upload --verbose --skip-existing dist/*
197
+
198
+ # Installs the sdist uploaded to TestPyPI the way a user does with `pip install
199
+ # sphysics`: in a plain Python image with only a compiler, with pip build
200
+ # isolation (i.e. the build requirements come from pyproject.toml and not from
201
+ # the CI image), and with the default compiler flags (no -Werror).
202
+ install-from-testpypi:
203
+ stage: release-test
204
+ image: python:3.11-slim-trixie
205
+ rules:
206
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
207
+ needs:
208
+ - job: publish_testpypi
209
+ artifacts: false
210
+ variables:
211
+ # the repository is not needed
212
+ GIT_STRATEGY: none
213
+ SKBUILD_CMAKE_DEFINE: "WERROR=OFF"
214
+ PIP_NO_CACHE_DIR: "1"
215
+ PIP_DISABLE_PIP_VERSION_CHECK: "1"
216
+ PIP_ROOT_USER_ACTION: "ignore"
217
+ script:
218
+ - apt-get update
219
+ - apt-get install -y --no-install-recommends g++ make
220
+ - cd /tmp
221
+ # Only the sdist of sphysics is taken from TestPyPI, by its URL; the build
222
+ # requirements and dependencies are taken from PyPI. TestPyPI is not used
223
+ # as package index, because anyone can upload packages with the names of
224
+ # the dependencies there. The upload may take a moment to become available.
225
+ - |
226
+ for i in $(seq 1 30); do
227
+ SDIST_URL=$(python -c "import json, urllib.request; r = json.load(urllib.request.urlopen('https://test.pypi.org/pypi/sphysics/${CI_COMMIT_TAG}/json')); print(next(u['url'] for u in r['urls'] if u['packagetype'] == 'sdist'))") && break
228
+ echo "sphysics ${CI_COMMIT_TAG} is not yet available on TestPyPI, trying again in 10 s"
229
+ sleep 10
230
+ done
231
+ - test -n "$SDIST_URL"
232
+ - python -m pip install "$SDIST_URL"
233
+ - python -c "import sphysics; print(sphysics.__file__)"
234
+
235
+ publish_package:
236
+ stage: deploy
237
+ rules:
238
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
239
+ dependencies:
240
+ - build_package
241
+ variables:
242
+ TWINE_REPOSITORY_URL: "https://gitlab.desy.de/api/v4/projects/${CI_PROJECT_ID}/packages/pypi"
243
+ TWINE_USERNAME: "gitlab-ci-token"
244
+ TWINE_PASSWORD: "${CI_JOB_TOKEN}"
245
+ script:
246
+ - python -m twine upload --verbose dist/*
247
+
248
+ # PYPI_TOKEN is an API token of pypi.org stored as masked CI/CD variable of the
249
+ # project (see the comment on TESTPYPI_TOKEN)
250
+ publish_pypi:
251
+ stage: deploy
252
+ rules:
253
+ - if: $CI_COMMIT_TAG =~ /^\d+\.\d+\.\d+$/
254
+ dependencies:
255
+ - build_package
256
+ variables:
257
+ TWINE_USERNAME: "__token__"
258
+ TWINE_PASSWORD: "${PYPI_TOKEN}"
259
+ script:
260
+ - python -m twine upload --verbose dist/*
@@ -0,0 +1,91 @@
1
+ ci:
2
+ autoupdate_commit_msg: "chore: update pre-commit hooks"
3
+ autofix_commit_msg: "style: pre-commit fixes"
4
+
5
+ exclude: ^src/cppLib/|^data/|README.md|LICENSE|.gitlab-ci.yml
6
+
7
+ repos:
8
+ - repo: https://github.com/adamchainz/blacken-docs
9
+ rev: "1.16.0"
10
+ hooks:
11
+ - id: blacken-docs
12
+ additional_dependencies: [black==23.*]
13
+
14
+ - repo: https://github.com/pre-commit/pre-commit-hooks
15
+ rev: "v4.5.0"
16
+ hooks:
17
+ - id: check-added-large-files
18
+ - id: check-case-conflict
19
+ - id: check-merge-conflict
20
+ - id: check-symlinks
21
+ - id: check-yaml
22
+ - id: debug-statements
23
+ - id: end-of-file-fixer
24
+ - id: mixed-line-ending
25
+ - id: name-tests-test
26
+ args: ["--pytest-test-first"]
27
+ - id: requirements-txt-fixer
28
+ - id: trailing-whitespace
29
+
30
+ - repo: https://github.com/pre-commit/pygrep-hooks
31
+ rev: "v1.10.0"
32
+ hooks:
33
+ - id: rst-backticks
34
+ - id: rst-directive-colons
35
+ - id: rst-inline-touching-normal
36
+
37
+ - repo: https://github.com/pre-commit/mirrors-prettier
38
+ rev: "v3.1.0"
39
+ hooks:
40
+ - id: prettier
41
+ types_or: [yaml, markdown, html, css, scss, javascript, json]
42
+ args: [--prose-wrap=always]
43
+
44
+ - repo: https://github.com/pre-commit/mirrors-clang-format
45
+ rev: "v17.0.6"
46
+ hooks:
47
+ - id: clang-format
48
+ types_or: [c++, c, cuda]
49
+
50
+ - repo: https://github.com/codespell-project/codespell
51
+ rev: "v2.2.6"
52
+ hooks:
53
+ - id: codespell
54
+ additional_dependencies:
55
+ - tomli
56
+
57
+ - repo: https://github.com/shellcheck-py/shellcheck-py
58
+ rev: "v0.9.0.6"
59
+ hooks:
60
+ - id: shellcheck
61
+
62
+ # - repo: local
63
+ # hooks:
64
+ # - id: disallow-caps
65
+ # name: Disallow improper capitalization
66
+ # language: pygrep
67
+ # entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
68
+ # exclude: .pre-commit-config.yaml
69
+
70
+ - repo: https://github.com/cheshirekow/cmake-format-precommit
71
+ rev: "v0.6.13"
72
+ hooks:
73
+ - id: cmake-format
74
+
75
+ - repo: https://github.com/abravalheri/validate-pyproject
76
+ rev: "v0.25"
77
+ hooks:
78
+ - id: validate-pyproject
79
+ additional_dependencies: ["validate-pyproject-schema-store[all]"]
80
+
81
+ - repo: https://github.com/python-jsonschema/check-jsonschema
82
+ rev: "0.27.3"
83
+ hooks:
84
+ - id: check-gitlab-ci
85
+ - id: check-readthedocs
86
+ # - repo: https://github.com/astral-sh/ruff-pre-commit
87
+ # rev: "v0.1.14"
88
+ # hooks:
89
+ # - id: ruff
90
+ # args: ["--fix", "--show-fixes"]
91
+ # - id: ruff-format
@@ -0,0 +1,16 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.com/platform/stable/config-file/v2.html for details
3
+ #
4
+ # Read the Docs does not build the documentation itself. Instead, ci/readthedocs.py downloads
5
+ # the HTML that the build_pages job of the GitLab CI built for the same commit, such that Read
6
+ # the Docs serves exactly the files that the pages job deploys to GitLab Pages. See the script
7
+ # for details and for the required environment variable GITLAB_TOKEN.
8
+
9
+ version: 2
10
+
11
+ build:
12
+ os: ubuntu-22.04
13
+ tools:
14
+ python: "3.12"
15
+ commands:
16
+ - python ci/readthedocs.py fetch
@@ -0,0 +1,30 @@
1
+ # Authors
2
+
3
+ sphysics is developed by Stefan Wallner (main author), with contributions by
4
+ Martin Bartl, Julien Beckers, Yannik Fausch, Godo Kurten, Fabian Krinner,
5
+ Claudia Perez-Orive, Markus Reif, Xavier Simo, Oskar Tittel, and Miriam
6
+ Weiskopf.
7
+
8
+ ## Code from other authors and projects
9
+
10
+ - [ROOTPWA](https://github.com/ROOTPWA-Maintainers/ROOTPWA) (GNU GPL version 3
11
+ or later): the build system (`CMakeLists.txt` files and `cmakeModules/`), the
12
+ particleData library and the particle data tables (`src/cppLib/particleData/`,
13
+ `data/particleDatatable/`), and the Python bindings of the particle data
14
+ (`particleProperties_py.cc` and `particleDataTable_py.cc` in
15
+ `src/cppLib/pyBindings/constants/`), which are based on ROOTPWA's boost.python
16
+ bindings. Their authors are named in the file headers.
17
+ - [basf2](https://github.com/belle2/basf2) (GNU LGPL version 3 or later): the
18
+ particle names and PDG codes in `src/sphysics/_constants/_pdgcodes.py`.
19
+
20
+ ## Data
21
+
22
+ - The particle properties in the particle data tables are taken from the Review
23
+ of Particle Physics of the Particle Data Group.
24
+ - `data/amplitudes/K0K0barspinnolam.csv` and `KplusKminusspinnolam.csv`:
25
+ triangle amplitude of the a1(1420), provided by the COMPASS Collaboration and
26
+ published with permission, see Phys. Rev. Lett. 127, 082501 (2021).
27
+ - `data/amplitudes/kpiS_Pelaez-Rodas_2010.11222.csv`: Kπ S-wave amplitude
28
+ provided by J. R. Peláez and A. Rodas, Phys. Rept. 969 (2022) 1
29
+ (arXiv:2010.11222). Code:
30
+ https://github.com/Hadron-Madrid-HadMad/HadMad.github
@@ -0,0 +1,42 @@
1
+ cff-version: 1.2.0
2
+ message: If you use sphysics, please cite it using the metadata from this file.
3
+ type: software
4
+ title: sphysics
5
+ abstract: Tools for amplitude analysis, event selection, kinematic calculations, machine learning, and more
6
+ authors:
7
+ - family-names: Wallner
8
+ given-names: Stefan
9
+ orcid: https://orcid.org/0000-0002-9105-1625
10
+ - family-names: Bartl
11
+ given-names: Martin
12
+ orcid: https://orcid.org/0009-0002-7835-0855
13
+ - family-names: Beckers
14
+ given-names: Julien
15
+ - family-names: Fausch
16
+ given-names: Yannik
17
+ - family-names: Kurten
18
+ given-names: Godo
19
+ orcid: https://orcid.org/0009-0000-0553-7964
20
+ - family-names: Krinner
21
+ given-names: Fabian
22
+ - family-names: Perez-Orive
23
+ given-names: Claudia
24
+ - family-names: Reif
25
+ given-names: Markus
26
+ orcid: https://orcid.org/0000-0002-0706-0247
27
+ - family-names: Simo
28
+ given-names: Xavier
29
+ - family-names: Tittel
30
+ given-names: Oskar
31
+ orcid: https://orcid.org/0000-0001-9128-6240
32
+ - family-names: Weiskopf
33
+ given-names: Miriam
34
+ doi: 10.5281/zenodo.23214121
35
+ repository-code: https://github.com/sAmplitudes/sphysics
36
+ url: https://sphysics.readthedocs.io
37
+ license: GPL-3.0-or-later
38
+ keywords:
39
+ - amplitude analyses
40
+ - PWA
41
+ - partial-wave analyses
42
+ - particle physics