xcoll 0.3.6__py3-none-any.whl → 0.5.0__py3-none-any.whl

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.

Potentially problematic release.


This version of xcoll might be problematic. Click here for more details.

Files changed (350) hide show
  1. xcoll/__init__.py +13 -4
  2. xcoll/beam_elements/__init__.py +14 -6
  3. xcoll/beam_elements/absorber.py +41 -7
  4. xcoll/beam_elements/base.py +1202 -247
  5. xcoll/beam_elements/blowup.py +198 -0
  6. xcoll/beam_elements/elements_src/black_absorber.h +136 -0
  7. xcoll/beam_elements/elements_src/black_crystal.h +129 -0
  8. xcoll/beam_elements/elements_src/blowup.h +42 -0
  9. xcoll/beam_elements/elements_src/emittance_monitor.h +109 -0
  10. xcoll/beam_elements/{collimators_src → elements_src}/everest_block.h +59 -30
  11. xcoll/beam_elements/elements_src/everest_collimator.h +237 -0
  12. xcoll/beam_elements/elements_src/everest_crystal.h +280 -0
  13. xcoll/beam_elements/everest.py +65 -119
  14. xcoll/beam_elements/monitor.py +428 -0
  15. xcoll/colldb.py +276 -747
  16. xcoll/general.py +5 -5
  17. xcoll/headers/checks.h +1 -1
  18. xcoll/headers/particle_states.h +2 -2
  19. xcoll/initial_distribution.py +207 -0
  20. xcoll/install.py +179 -0
  21. xcoll/interaction_record/__init__.py +1 -0
  22. xcoll/interaction_record/interaction_record.py +298 -0
  23. xcoll/interaction_record/interaction_record_src/interaction_record.h +98 -0
  24. xcoll/{impacts → interaction_record}/interaction_types.py +11 -4
  25. xcoll/line_tools.py +82 -0
  26. xcoll/lossmap.py +219 -0
  27. xcoll/manager.py +2 -937
  28. xcoll/rf_sweep.py +1 -1
  29. xcoll/scattering_routines/everest/amorphous.h +232 -0
  30. xcoll/scattering_routines/everest/channeling.h +240 -0
  31. xcoll/scattering_routines/everest/crystal_parameters.h +137 -0
  32. xcoll/scattering_routines/everest/everest.h +11 -30
  33. xcoll/scattering_routines/everest/everest.py +13 -10
  34. xcoll/scattering_routines/everest/jaw.h +28 -197
  35. xcoll/scattering_routines/everest/materials.py +37 -15
  36. xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +31 -10
  37. xcoll/scattering_routines/everest/nuclear_interaction.h +86 -0
  38. xcoll/scattering_routines/everest/properties.h +6 -1
  39. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  40. xcoll/scattering_routines/geant4/collimasim/.git +1 -0
  41. xcoll/scattering_routines/geant4/collimasim/.gitignore +12 -0
  42. xcoll/scattering_routines/geant4/collimasim/.gitmodules +3 -0
  43. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +26 -0
  44. xcoll/scattering_routines/geant4/collimasim/README.md +21 -0
  45. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +20 -0
  46. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +35 -0
  47. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +10 -0
  48. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +59 -0
  49. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +26 -0
  50. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +37 -0
  51. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +19 -0
  52. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +65 -0
  53. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +73 -0
  54. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +1 -0
  55. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +9 -0
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +386 -0
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +45 -0
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +16 -0
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +8 -0
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +3 -0
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +19 -0
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +969 -0
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +84 -0
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +48 -0
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +16 -0
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +103 -0
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +45 -0
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +151 -0
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +3 -0
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +297 -0
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +29 -0
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +6 -0
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +180 -0
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +23 -0
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +192 -0
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +11 -0
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +81 -0
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +93 -0
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +310 -0
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +109 -0
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +43 -0
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +171 -0
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +251 -0
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +305 -0
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +1297 -0
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +262 -0
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +396 -0
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +568 -0
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +337 -0
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +13 -0
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +463 -0
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +286 -0
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +174 -0
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +308 -0
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +91 -0
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +95 -0
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +2050 -0
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +542 -0
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +8 -0
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +648 -0
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +381 -0
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +343 -0
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +48 -0
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +105 -0
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +72 -0
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +130 -0
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +96 -0
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +8 -0
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +548 -0
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +605 -0
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +144 -0
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +1432 -0
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +213 -0
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +2 -0
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +65 -0
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +709 -0
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +1021 -0
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +104 -0
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +346 -0
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +467 -0
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +978 -0
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +55 -0
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +606 -0
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +284 -0
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +163 -0
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +121 -0
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +193 -0
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +275 -0
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +1741 -0
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +163 -0
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +65 -0
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +2497 -0
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +1879 -0
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +103 -0
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +375 -0
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +747 -0
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +88 -0
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +11 -0
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +52 -0
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +12 -0
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +6 -0
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +21 -0
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +482 -0
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +63 -0
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +41 -0
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +56 -0
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +155 -0
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +503 -0
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +208 -0
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +275 -0
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +73 -0
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +33 -0
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +279 -0
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +143 -0
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +85 -0
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +179 -0
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +151 -0
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +91 -0
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +85 -0
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +19 -0
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +12 -0
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +26 -0
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +25 -0
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +216 -0
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +163 -0
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +286 -0
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +536 -0
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +107 -0
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +248 -0
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +227 -0
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +202 -0
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +84 -0
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +210 -0
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +550 -0
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +473 -0
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +84 -0
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +21 -0
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +6 -0
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +41 -0
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +35 -0
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +41 -0
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +10 -0
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +165 -0
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +53 -0
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +238 -0
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +126 -0
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +141 -0
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +117 -0
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +41 -0
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +50 -0
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +69 -0
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +42 -0
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +348 -0
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +771 -0
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +47 -0
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +22 -0
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +23 -0
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +326 -0
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +15 -0
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +148 -0
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +272 -0
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +119 -0
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +51 -0
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +5 -0
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +285 -0
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +12 -0
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +265 -0
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +397 -0
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +520 -0
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +49 -0
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +94 -0
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +125 -0
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +331 -0
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +153 -0
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +284 -0
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +107 -0
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +257 -0
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +412 -0
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +517 -0
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +102 -0
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +92 -0
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +233 -0
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +360 -0
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +472 -0
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +593 -0
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +524 -0
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +441 -0
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +103 -0
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +267 -0
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +73 -0
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +59 -0
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +235 -0
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +146 -0
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +189 -0
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +82 -0
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +560 -0
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +651 -0
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +500 -0
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +253 -0
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +452 -0
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +318 -0
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +342 -0
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +291 -0
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +131 -0
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +318 -0
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +144 -0
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +29 -0
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +66 -0
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +44 -0
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +22 -0
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +9 -0
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +510 -0
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +408 -0
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +117 -0
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +70 -0
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +86 -0
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +257 -0
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +44 -0
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +23 -0
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +39 -0
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +64 -0
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +402 -0
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +233 -0
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +276 -0
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +214 -0
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +3 -0
  281. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +65 -0
  282. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +41 -0
  283. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +8 -0
  284. xcoll/scattering_routines/geant4/collimasim/setup.py +144 -0
  285. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +403 -0
  286. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +100 -0
  287. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +763 -0
  288. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +118 -0
  289. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +8 -0
  290. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +63 -0
  291. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +142 -0
  292. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +556 -0
  293. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +6 -0
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +24 -0
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +1 -0
  296. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +1 -0
  297. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +1 -0
  298. xcoll/scattering_routines/geant4/collimasim/tests/README.md +25 -0
  299. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +25 -0
  300. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +18 -0
  301. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +68 -0
  302. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +15 -0
  303. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +110 -0
  304. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +7 -0
  305. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +3 -0
  306. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +54 -0
  307. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +3 -0
  308. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +3 -0
  309. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +5 -0
  310. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +51 -0
  311. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +65 -0
  312. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +59 -0
  313. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +102 -0
  314. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +75 -0
  315. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +74 -0
  316. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +84 -0
  317. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +159 -0
  318. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +99 -0
  319. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +78 -0
  320. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +88 -0
  321. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +80 -0
  322. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +97 -0
  323. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +96 -0
  324. xcoll/scattering_routines/geometry/__init__.py +6 -0
  325. xcoll/scattering_routines/geometry/collimator_geometry.h +218 -0
  326. xcoll/scattering_routines/geometry/crystal_geometry.h +153 -0
  327. xcoll/scattering_routines/geometry/geometry.py +26 -0
  328. xcoll/scattering_routines/geometry/get_s.h +92 -0
  329. xcoll/scattering_routines/geometry/methods.h +111 -0
  330. xcoll/scattering_routines/geometry/objects.h +154 -0
  331. xcoll/scattering_routines/geometry/rotation.h +23 -0
  332. xcoll/scattering_routines/geometry/segments.h +226 -0
  333. xcoll/scattering_routines/geometry/sort.h +184 -0
  334. {xcoll-0.3.6.dist-info → xcoll-0.5.0.dist-info}/METADATA +1 -1
  335. xcoll-0.5.0.dist-info/RECORD +413 -0
  336. xcoll/beam_elements/collimators_src/absorber.h +0 -141
  337. xcoll/beam_elements/collimators_src/everest_collimator.h +0 -142
  338. xcoll/beam_elements/collimators_src/everest_crystal.h +0 -115
  339. xcoll/collimator_settings.py +0 -457
  340. xcoll/impacts/__init__.py +0 -1
  341. xcoll/impacts/impacts.py +0 -102
  342. xcoll/impacts/impacts_src/impacts.h +0 -99
  343. xcoll/scattering_routines/everest/crystal.h +0 -1302
  344. xcoll/scattering_routines/everest/scatter.h +0 -169
  345. xcoll/scattering_routines/everest/scatter_crystal.h +0 -260
  346. xcoll/scattering_routines/fluka/build_fluka_input.py +0 -58
  347. xcoll-0.3.6.dist-info/RECORD +0 -111
  348. {xcoll-0.3.6.dist-info → xcoll-0.5.0.dist-info}/LICENSE +0 -0
  349. {xcoll-0.3.6.dist-info → xcoll-0.5.0.dist-info}/NOTICE +0 -0
  350. {xcoll-0.3.6.dist-info → xcoll-0.5.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,70 @@
1
+ # - Find the Catch test framework or download it (single header)
2
+ #
3
+ # This is a quick module for internal use. It assumes that Catch is
4
+ # REQUIRED and that a minimum version is provided (not EXACT). If
5
+ # a suitable version isn't found locally, the single header file
6
+ # will be downloaded and placed in the build dir: PROJECT_BINARY_DIR.
7
+ #
8
+ # This code sets the following variables:
9
+ # CATCH_INCLUDE_DIR - path to catch.hpp
10
+ # CATCH_VERSION - version number
11
+
12
+ if(NOT Catch_FIND_VERSION)
13
+ message(FATAL_ERROR "A version number must be specified.")
14
+ elseif(Catch_FIND_REQUIRED)
15
+ message(FATAL_ERROR "This module assumes Catch is not required.")
16
+ elseif(Catch_FIND_VERSION_EXACT)
17
+ message(FATAL_ERROR "Exact version numbers are not supported, only minimum.")
18
+ endif()
19
+
20
+ # Extract the version number from catch.hpp
21
+ function(_get_catch_version)
22
+ file(
23
+ STRINGS "${CATCH_INCLUDE_DIR}/catch.hpp" version_line
24
+ REGEX "Catch v.*"
25
+ LIMIT_COUNT 1)
26
+ if(version_line MATCHES "Catch v([0-9]+)\\.([0-9]+)\\.([0-9]+)")
27
+ set(CATCH_VERSION
28
+ "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}"
29
+ PARENT_SCOPE)
30
+ endif()
31
+ endfunction()
32
+
33
+ # Download the single-header version of Catch
34
+ function(_download_catch version destination_dir)
35
+ message(STATUS "Downloading catch v${version}...")
36
+ set(url https://github.com/philsquared/Catch/releases/download/v${version}/catch.hpp)
37
+ file(DOWNLOAD ${url} "${destination_dir}/catch.hpp" STATUS status)
38
+ list(GET status 0 error)
39
+ if(error)
40
+ message(FATAL_ERROR "Could not download ${url}")
41
+ endif()
42
+ set(CATCH_INCLUDE_DIR
43
+ "${destination_dir}"
44
+ CACHE INTERNAL "")
45
+ endfunction()
46
+
47
+ # Look for catch locally
48
+ find_path(
49
+ CATCH_INCLUDE_DIR
50
+ NAMES catch.hpp
51
+ PATH_SUFFIXES catch2)
52
+ if(CATCH_INCLUDE_DIR)
53
+ _get_catch_version()
54
+ endif()
55
+
56
+ # Download the header if it wasn't found or if it's outdated
57
+ if(NOT CATCH_VERSION OR CATCH_VERSION VERSION_LESS ${Catch_FIND_VERSION})
58
+ if(DOWNLOAD_CATCH)
59
+ _download_catch(${Catch_FIND_VERSION} "${PROJECT_BINARY_DIR}/catch/")
60
+ _get_catch_version()
61
+ else()
62
+ set(CATCH_FOUND FALSE)
63
+ return()
64
+ endif()
65
+ endif()
66
+
67
+ add_library(Catch2::Catch2 IMPORTED INTERFACE)
68
+ set_property(TARGET Catch2::Catch2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CATCH_INCLUDE_DIR}")
69
+
70
+ set(CATCH_FOUND TRUE)
@@ -0,0 +1,86 @@
1
+ # - Try to find Eigen3 lib
2
+ #
3
+ # This module supports requiring a minimum version, e.g. you can do
4
+ # find_package(Eigen3 3.1.2)
5
+ # to require version 3.1.2 or newer of Eigen3.
6
+ #
7
+ # Once done this will define
8
+ #
9
+ # EIGEN3_FOUND - system has eigen lib with correct version
10
+ # EIGEN3_INCLUDE_DIR - the eigen include directory
11
+ # EIGEN3_VERSION - eigen version
12
+
13
+ # Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
14
+ # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
15
+ # Copyright (c) 2009 Benoit Jacob <jacob.benoit.1@gmail.com>
16
+ # Redistribution and use is allowed according to the terms of the 2-clause BSD license.
17
+
18
+ if(NOT Eigen3_FIND_VERSION)
19
+ if(NOT Eigen3_FIND_VERSION_MAJOR)
20
+ set(Eigen3_FIND_VERSION_MAJOR 2)
21
+ endif(NOT Eigen3_FIND_VERSION_MAJOR)
22
+ if(NOT Eigen3_FIND_VERSION_MINOR)
23
+ set(Eigen3_FIND_VERSION_MINOR 91)
24
+ endif(NOT Eigen3_FIND_VERSION_MINOR)
25
+ if(NOT Eigen3_FIND_VERSION_PATCH)
26
+ set(Eigen3_FIND_VERSION_PATCH 0)
27
+ endif(NOT Eigen3_FIND_VERSION_PATCH)
28
+
29
+ set(Eigen3_FIND_VERSION
30
+ "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}")
31
+ endif(NOT Eigen3_FIND_VERSION)
32
+
33
+ macro(_eigen3_check_version)
34
+ file(READ "${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
35
+
36
+ string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match
37
+ "${_eigen3_version_header}")
38
+ set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}")
39
+ string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match
40
+ "${_eigen3_version_header}")
41
+ set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}")
42
+ string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match
43
+ "${_eigen3_version_header}")
44
+ set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}")
45
+
46
+ set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION})
47
+ if(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
48
+ set(EIGEN3_VERSION_OK FALSE)
49
+ else(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
50
+ set(EIGEN3_VERSION_OK TRUE)
51
+ endif(${EIGEN3_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION})
52
+
53
+ if(NOT EIGEN3_VERSION_OK)
54
+
55
+ message(STATUS "Eigen3 version ${EIGEN3_VERSION} found in ${EIGEN3_INCLUDE_DIR}, "
56
+ "but at least version ${Eigen3_FIND_VERSION} is required")
57
+ endif(NOT EIGEN3_VERSION_OK)
58
+ endmacro(_eigen3_check_version)
59
+
60
+ if(EIGEN3_INCLUDE_DIR)
61
+
62
+ # in cache already
63
+ _eigen3_check_version()
64
+ set(EIGEN3_FOUND ${EIGEN3_VERSION_OK})
65
+
66
+ else(EIGEN3_INCLUDE_DIR)
67
+ if(NOT DEFINED KDE4_INCLUDE_DIR)
68
+ set(KDE4_INCLUDE_DIR "")
69
+ endif()
70
+
71
+ find_path(
72
+ EIGEN3_INCLUDE_DIR
73
+ NAMES signature_of_eigen3_matrix_library
74
+ PATHS ${CMAKE_INSTALL_PREFIX}/include ${KDE4_INCLUDE_DIR}
75
+ PATH_SUFFIXES eigen3 eigen)
76
+
77
+ if(EIGEN3_INCLUDE_DIR)
78
+ _eigen3_check_version()
79
+ endif(EIGEN3_INCLUDE_DIR)
80
+
81
+ include(FindPackageHandleStandardArgs)
82
+ find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR EIGEN3_VERSION_OK)
83
+
84
+ mark_as_advanced(EIGEN3_INCLUDE_DIR)
85
+
86
+ endif(EIGEN3_INCLUDE_DIR)
@@ -0,0 +1,257 @@
1
+ # - Find python libraries
2
+ # This module finds the libraries corresponding to the Python interpreter
3
+ # FindPythonInterp provides.
4
+ # This code sets the following variables:
5
+ #
6
+ # PYTHONLIBS_FOUND - have the Python libs been found
7
+ # PYTHON_PREFIX - path to the Python installation
8
+ # PYTHON_LIBRARIES - path to the python library
9
+ # PYTHON_INCLUDE_DIRS - path to where Python.h is found
10
+ # PYTHON_MODULE_EXTENSION - lib extension, e.g. '.so' or '.pyd'
11
+ # PYTHON_MODULE_PREFIX - lib name prefix: usually an empty string
12
+ # PYTHON_SITE_PACKAGES - path to installation site-packages
13
+ # PYTHON_IS_DEBUG - whether the Python interpreter is a debug build
14
+ #
15
+ # Thanks to talljimbo for the patch adding the 'LDVERSION' config
16
+ # variable usage.
17
+
18
+ #=============================================================================
19
+ # Copyright 2001-2009 Kitware, Inc.
20
+ # Copyright 2012 Continuum Analytics, Inc.
21
+ #
22
+ # All rights reserved.
23
+ #
24
+ # Redistribution and use in source and binary forms, with or without
25
+ # modification, are permitted provided that the following conditions
26
+ # are met:
27
+ #
28
+ # * Redistributions of source code must retain the above copyright
29
+ # notice, this list of conditions and the following disclaimer.
30
+ #
31
+ # * Redistributions in binary form must reproduce the above copyright
32
+ # notice, this list of conditions and the following disclaimer in the
33
+ # documentation and/or other materials provided with the distribution.
34
+ #
35
+ # * Neither the names of Kitware, Inc., the Insight Software Consortium,
36
+ # nor the names of their contributors may be used to endorse or promote
37
+ # products derived from this software without specific prior written
38
+ # permission.
39
+ #
40
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43
+ # # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44
+ # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51
+ #=============================================================================
52
+
53
+ # Checking for the extension makes sure that `LibsNew` was found and not just `Libs`.
54
+ if(PYTHONLIBS_FOUND AND PYTHON_MODULE_EXTENSION)
55
+ return()
56
+ endif()
57
+
58
+ if(PythonLibsNew_FIND_QUIETLY)
59
+ set(_pythonlibs_quiet QUIET)
60
+ else()
61
+ set(_pythonlibs_quiet "")
62
+ endif()
63
+
64
+ if(PythonLibsNew_FIND_REQUIRED)
65
+ set(_pythonlibs_required REQUIRED)
66
+ endif()
67
+
68
+ # Check to see if the `python` command is present and from a virtual
69
+ # environment, conda, or GHA activation - if it is, try to use that.
70
+
71
+ if(NOT DEFINED PYTHON_EXECUTABLE)
72
+ if(DEFINED ENV{VIRTUAL_ENV})
73
+ find_program(
74
+ PYTHON_EXECUTABLE python
75
+ PATHS "$ENV{VIRTUAL_ENV}" "$ENV{VIRTUAL_ENV}/bin"
76
+ NO_DEFAULT_PATH)
77
+ elseif(DEFINED ENV{CONDA_PREFIX})
78
+ find_program(
79
+ PYTHON_EXECUTABLE python
80
+ PATHS "$ENV{CONDA_PREFIX}" "$ENV{CONDA_PREFIX}/bin"
81
+ NO_DEFAULT_PATH)
82
+ elseif(DEFINED ENV{pythonLocation})
83
+ find_program(
84
+ PYTHON_EXECUTABLE python
85
+ PATHS "$ENV{pythonLocation}" "$ENV{pythonLocation}/bin"
86
+ NO_DEFAULT_PATH)
87
+ endif()
88
+ if(NOT PYTHON_EXECUTABLE)
89
+ unset(PYTHON_EXECUTABLE)
90
+ endif()
91
+ endif()
92
+
93
+ # Use the Python interpreter to find the libs.
94
+ if(NOT PythonLibsNew_FIND_VERSION)
95
+ set(PythonLibsNew_FIND_VERSION "")
96
+ endif()
97
+
98
+ find_package(PythonInterp ${PythonLibsNew_FIND_VERSION} ${_pythonlibs_required}
99
+ ${_pythonlibs_quiet})
100
+
101
+ if(NOT PYTHONINTERP_FOUND)
102
+ set(PYTHONLIBS_FOUND FALSE)
103
+ set(PythonLibsNew_FOUND FALSE)
104
+ return()
105
+ endif()
106
+
107
+ # According to https://stackoverflow.com/questions/646518/python-how-to-detect-debug-interpreter
108
+ # testing whether sys has the gettotalrefcount function is a reliable, cross-platform
109
+ # way to detect a CPython debug interpreter.
110
+ #
111
+ # The library suffix is from the config var LDVERSION sometimes, otherwise
112
+ # VERSION. VERSION will typically be like "2.7" on unix, and "27" on windows.
113
+ execute_process(
114
+ COMMAND
115
+ "${PYTHON_EXECUTABLE}" "-c" "from distutils import sysconfig as s;import sys;import struct;
116
+ print('.'.join(str(v) for v in sys.version_info));
117
+ print(sys.prefix);
118
+ print(s.get_python_inc(plat_specific=True));
119
+ print(s.get_python_lib(plat_specific=True));
120
+ print(s.get_config_var('EXT_SUFFIX') or s.get_config_var('SO'));
121
+ print(hasattr(sys, 'gettotalrefcount')+0);
122
+ print(struct.calcsize('@P'));
123
+ print(s.get_config_var('LDVERSION') or s.get_config_var('VERSION'));
124
+ print(s.get_config_var('LIBDIR') or '');
125
+ print(s.get_config_var('MULTIARCH') or '');
126
+ "
127
+ RESULT_VARIABLE _PYTHON_SUCCESS
128
+ OUTPUT_VARIABLE _PYTHON_VALUES
129
+ ERROR_VARIABLE _PYTHON_ERROR_VALUE)
130
+
131
+ if(NOT _PYTHON_SUCCESS MATCHES 0)
132
+ if(PythonLibsNew_FIND_REQUIRED)
133
+ message(FATAL_ERROR "Python config failure:\n${_PYTHON_ERROR_VALUE}")
134
+ endif()
135
+ set(PYTHONLIBS_FOUND FALSE)
136
+ set(PythonLibsNew_FOUND FALSE)
137
+ return()
138
+ endif()
139
+
140
+ # Convert the process output into a list
141
+ if(WIN32)
142
+ string(REGEX REPLACE "\\\\" "/" _PYTHON_VALUES ${_PYTHON_VALUES})
143
+ endif()
144
+ string(REGEX REPLACE ";" "\\\\;" _PYTHON_VALUES ${_PYTHON_VALUES})
145
+ string(REGEX REPLACE "\n" ";" _PYTHON_VALUES ${_PYTHON_VALUES})
146
+ list(GET _PYTHON_VALUES 0 _PYTHON_VERSION_LIST)
147
+ list(GET _PYTHON_VALUES 1 PYTHON_PREFIX)
148
+ list(GET _PYTHON_VALUES 2 PYTHON_INCLUDE_DIR)
149
+ list(GET _PYTHON_VALUES 3 PYTHON_SITE_PACKAGES)
150
+ list(GET _PYTHON_VALUES 4 PYTHON_MODULE_EXTENSION)
151
+ list(GET _PYTHON_VALUES 5 PYTHON_IS_DEBUG)
152
+ list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)
153
+ list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)
154
+ list(GET _PYTHON_VALUES 8 PYTHON_LIBDIR)
155
+ list(GET _PYTHON_VALUES 9 PYTHON_MULTIARCH)
156
+
157
+ # Make sure the Python has the same pointer-size as the chosen compiler
158
+ # Skip if CMAKE_SIZEOF_VOID_P is not defined
159
+ if(CMAKE_SIZEOF_VOID_P AND (NOT "${PYTHON_SIZEOF_VOID_P}" STREQUAL "${CMAKE_SIZEOF_VOID_P}"))
160
+ if(PythonLibsNew_FIND_REQUIRED)
161
+ math(EXPR _PYTHON_BITS "${PYTHON_SIZEOF_VOID_P} * 8")
162
+ math(EXPR _CMAKE_BITS "${CMAKE_SIZEOF_VOID_P} * 8")
163
+ message(FATAL_ERROR "Python config failure: Python is ${_PYTHON_BITS}-bit, "
164
+ "chosen compiler is ${_CMAKE_BITS}-bit")
165
+ endif()
166
+ set(PYTHONLIBS_FOUND FALSE)
167
+ set(PythonLibsNew_FOUND FALSE)
168
+ return()
169
+ endif()
170
+
171
+ # The built-in FindPython didn't always give the version numbers
172
+ string(REGEX REPLACE "\\." ";" _PYTHON_VERSION_LIST ${_PYTHON_VERSION_LIST})
173
+ list(GET _PYTHON_VERSION_LIST 0 PYTHON_VERSION_MAJOR)
174
+ list(GET _PYTHON_VERSION_LIST 1 PYTHON_VERSION_MINOR)
175
+ list(GET _PYTHON_VERSION_LIST 2 PYTHON_VERSION_PATCH)
176
+ set(PYTHON_VERSION "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.${PYTHON_VERSION_PATCH}")
177
+
178
+ # Make sure all directory separators are '/'
179
+ string(REGEX REPLACE "\\\\" "/" PYTHON_PREFIX "${PYTHON_PREFIX}")
180
+ string(REGEX REPLACE "\\\\" "/" PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR}")
181
+ string(REGEX REPLACE "\\\\" "/" PYTHON_SITE_PACKAGES "${PYTHON_SITE_PACKAGES}")
182
+
183
+ if(CMAKE_HOST_WIN32)
184
+ set(PYTHON_LIBRARY "${PYTHON_PREFIX}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib")
185
+
186
+ # when run in a venv, PYTHON_PREFIX points to it. But the libraries remain in the
187
+ # original python installation. They may be found relative to PYTHON_INCLUDE_DIR.
188
+ if(NOT EXISTS "${PYTHON_LIBRARY}")
189
+ get_filename_component(_PYTHON_ROOT ${PYTHON_INCLUDE_DIR} DIRECTORY)
190
+ set(PYTHON_LIBRARY "${_PYTHON_ROOT}/libs/python${PYTHON_LIBRARY_SUFFIX}.lib")
191
+ endif()
192
+
193
+ # if we are in MSYS & MINGW, and we didn't find windows python lib, look for system python lib
194
+ if(DEFINED ENV{MSYSTEM}
195
+ AND MINGW
196
+ AND NOT EXISTS "${PYTHON_LIBRARY}")
197
+ if(PYTHON_MULTIARCH)
198
+ set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}" "${PYTHON_LIBDIR}")
199
+ else()
200
+ set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}")
201
+ endif()
202
+ unset(PYTHON_LIBRARY)
203
+ find_library(
204
+ PYTHON_LIBRARY
205
+ NAMES "python${PYTHON_LIBRARY_SUFFIX}"
206
+ PATHS ${_PYTHON_LIBS_SEARCH}
207
+ NO_DEFAULT_PATH)
208
+ endif()
209
+
210
+ # raise an error if the python libs are still not found.
211
+ if(NOT EXISTS "${PYTHON_LIBRARY}")
212
+ message(FATAL_ERROR "Python libraries not found")
213
+ endif()
214
+
215
+ else()
216
+ if(PYTHON_MULTIARCH)
217
+ set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}/${PYTHON_MULTIARCH}" "${PYTHON_LIBDIR}")
218
+ else()
219
+ set(_PYTHON_LIBS_SEARCH "${PYTHON_LIBDIR}")
220
+ endif()
221
+ #message(STATUS "Searching for Python libs in ${_PYTHON_LIBS_SEARCH}")
222
+ # Probably this needs to be more involved. It would be nice if the config
223
+ # information the python interpreter itself gave us were more complete.
224
+ find_library(
225
+ PYTHON_LIBRARY
226
+ NAMES "python${PYTHON_LIBRARY_SUFFIX}"
227
+ PATHS ${_PYTHON_LIBS_SEARCH}
228
+ NO_DEFAULT_PATH)
229
+
230
+ # If all else fails, just set the name/version and let the linker figure out the path.
231
+ if(NOT PYTHON_LIBRARY)
232
+ set(PYTHON_LIBRARY python${PYTHON_LIBRARY_SUFFIX})
233
+ endif()
234
+ endif()
235
+
236
+ mark_as_advanced(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
237
+
238
+ # We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
239
+ # cache entries because they are meant to specify the location of a single
240
+ # library. We now set the variables listed by the documentation for this
241
+ # module.
242
+ set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
243
+ set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
244
+ if(NOT PYTHON_DEBUG_LIBRARY)
245
+ set(PYTHON_DEBUG_LIBRARY "")
246
+ endif()
247
+ set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
248
+
249
+ find_package_message(PYTHON "Found PythonLibs: ${PYTHON_LIBRARY}"
250
+ "${PYTHON_EXECUTABLE}${PYTHON_VERSION_STRING}")
251
+
252
+ set(PYTHONLIBS_FOUND TRUE)
253
+ set(PythonLibsNew_FOUND TRUE)
254
+
255
+ if(NOT PYTHON_MODULE_PREFIX)
256
+ set(PYTHON_MODULE_PREFIX "")
257
+ endif()
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+ #
3
+ # Script to check include/test code for common pybind11 code style errors.
4
+ #
5
+ # This script currently checks for
6
+ #
7
+ # 1. missing space between keyword and parenthesis, e.g.: for(, if(, while(
8
+ # 2. Missing space between right parenthesis and brace, e.g. 'for (...){'
9
+ # 3. opening brace on its own line. It should always be on the same line as the
10
+ # if/while/for/do statement.
11
+ #
12
+ # Invoke as: tools/check-style.sh <filenames>
13
+ #
14
+
15
+ check_style_errors=0
16
+ IFS=$'\n'
17
+
18
+
19
+ found="$(grep '\<\(if\|for\|while\|catch\)(\|){' "$@" -rn --color=always)"
20
+ if [ -n "$found" ]; then
21
+ echo -e '\033[31;01mError: found the following coding style problems:\033[0m'
22
+ check_style_errors=1
23
+ echo "${found//^/ /}"
24
+ fi
25
+
26
+ found="$(awk '
27
+ function prefix(filename, lineno) {
28
+ return " \033[35m" filename "\033[36m:\033[32m" lineno "\033[36m:\033[0m"
29
+ }
30
+ function mark(pattern, string) { sub(pattern, "\033[01;31m&\033[0m", string); return string }
31
+ last && /^\s*{/ {
32
+ print prefix(FILENAME, FNR-1) mark("\\)\\s*$", last)
33
+ print prefix(FILENAME, FNR) mark("^\\s*{", $0)
34
+ last=""
35
+ }
36
+ { last = /(if|for|while|catch|switch)\s*\(.*\)\s*$/ ? $0 : "" }
37
+ ' "$(find include -type f)" "$@")"
38
+ if [ -n "$found" ]; then
39
+ check_style_errors=1
40
+ echo -e '\033[31;01mError: braces should occur on the same line as the if/while/.. statement. Found issues in the following files:\033[0m'
41
+ echo "$found"
42
+ fi
43
+
44
+ exit $check_style_errors
@@ -0,0 +1,23 @@
1
+ # Source: https://gitlab.kitware.com/cmake/community/-/wikis/FAQ#can-i-do-make-uninstall-with-cmake
2
+
3
+ if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
4
+ message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt")
5
+ endif()
6
+
7
+ file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
8
+ string(REGEX REPLACE "\n" ";" files "${files}")
9
+ foreach(file ${files})
10
+ message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
11
+ if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
12
+ exec_program(
13
+ "@CMAKE_COMMAND@" ARGS
14
+ "-E remove \"$ENV{DESTDIR}${file}\""
15
+ OUTPUT_VARIABLE rm_out
16
+ RETURN_VALUE rm_retval)
17
+ if(NOT "${rm_retval}" STREQUAL 0)
18
+ message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
19
+ endif()
20
+ else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
21
+ message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
22
+ endif()
23
+ endforeach()
@@ -0,0 +1,39 @@
1
+ # -*- coding: utf-8 -*-
2
+ from __future__ import division, print_function
3
+
4
+ import os
5
+ import sys
6
+
7
+ # Internal build script for generating debugging test .so size.
8
+ # Usage:
9
+ # python libsize.py file.so save.txt -- displays the size of file.so and, if save.txt exists, compares it to the
10
+ # size in it, then overwrites save.txt with the new size for future runs.
11
+
12
+ if len(sys.argv) != 3:
13
+ sys.exit("Invalid arguments: usage: python libsize.py file.so save.txt")
14
+
15
+ lib = sys.argv[1]
16
+ save = sys.argv[2]
17
+
18
+ if not os.path.exists(lib):
19
+ sys.exit("Error: requested file ({}) does not exist".format(lib))
20
+
21
+ libsize = os.path.getsize(lib)
22
+
23
+ print("------", os.path.basename(lib), "file size:", libsize, end="")
24
+
25
+ if os.path.exists(save):
26
+ with open(save) as sf:
27
+ oldsize = int(sf.readline())
28
+
29
+ if oldsize > 0:
30
+ change = libsize - oldsize
31
+ if change == 0:
32
+ print(" (no change)")
33
+ else:
34
+ print(" (change of {:+} bytes = {:+.2%})".format(change, change / oldsize))
35
+ else:
36
+ print()
37
+
38
+ with open(save, "w") as sf:
39
+ sf.write(str(libsize))
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env python3
2
+ # -*- coding: utf-8 -*-
3
+
4
+ import re
5
+
6
+ import ghapi.all
7
+ from rich import print
8
+ from rich.syntax import Syntax
9
+
10
+ ENTRY = re.compile(
11
+ r"""
12
+ Suggested \s changelog \s entry:
13
+ .*
14
+ ```rst
15
+ \s*
16
+ (.*?)
17
+ \s*
18
+ ```
19
+ """,
20
+ re.DOTALL | re.VERBOSE,
21
+ )
22
+
23
+ print()
24
+
25
+
26
+ api = ghapi.all.GhApi(owner="pybind", repo="pybind11")
27
+
28
+ issues_pages = ghapi.page.paged(
29
+ api.issues.list_for_repo, labels="needs changelog", state="closed"
30
+ )
31
+ issues = (issue for page in issues_pages for issue in page)
32
+ missing = []
33
+
34
+ for issue in issues:
35
+ changelog = ENTRY.findall(issue.body)
36
+ if changelog:
37
+ (msg,) = changelog
38
+ if not msg.startswith("* "):
39
+ msg = "* " + msg
40
+ if not msg.endswith("."):
41
+ msg += "."
42
+
43
+ msg += f"\n `#{issue.number} <{issue.html_url}>`_"
44
+
45
+ print(Syntax(msg, "rst", theme="ansi_light", word_wrap=True))
46
+ print()
47
+
48
+ else:
49
+ missing.append(issue)
50
+
51
+ if missing:
52
+ print()
53
+ print("[blue]" + "-" * 30)
54
+ print()
55
+
56
+ for issue in missing:
57
+ print(f"[red bold]Missing:[/red bold][red] {issue.title}")
58
+ print(f"[red] {issue.html_url}\n")
59
+
60
+ print("[bold]Template:\n")
61
+ msg = "## Suggested changelog entry:\n\n```rst\n\n```"
62
+ print(Syntax(msg, "md", theme="ansi_light"))
63
+
64
+ print()