xcoll 0.4.0__py3-none-any.whl → 0.5.1__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 (324) hide show
  1. xcoll/__init__.py +2 -1
  2. xcoll/beam_elements/__init__.py +9 -2
  3. xcoll/beam_elements/absorber.py +2 -2
  4. xcoll/beam_elements/base.py +105 -67
  5. xcoll/beam_elements/blowup.py +198 -0
  6. xcoll/beam_elements/{collimators_src → elements_src}/black_absorber.h +21 -3
  7. xcoll/beam_elements/{collimators_src → elements_src}/black_crystal.h +20 -2
  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 +19 -2
  11. xcoll/beam_elements/{collimators_src → elements_src}/everest_collimator.h +19 -3
  12. xcoll/beam_elements/{collimators_src → elements_src}/everest_crystal.h +30 -9
  13. xcoll/beam_elements/everest.py +5 -6
  14. xcoll/beam_elements/monitor.py +428 -0
  15. xcoll/colldb.py +103 -74
  16. xcoll/general.py +4 -4
  17. xcoll/initial_distribution.py +18 -6
  18. xcoll/install.py +3 -1
  19. xcoll/interaction_record/interaction_record.py +127 -81
  20. xcoll/interaction_record/interaction_record_src/interaction_record.h +43 -43
  21. xcoll/line_tools.py +8 -9
  22. xcoll/lossmap.py +48 -38
  23. xcoll/scattering_routines/everest/amorphous.h +4 -11
  24. xcoll/scattering_routines/everest/channeling.h +3 -8
  25. xcoll/scattering_routines/everest/everest.h +4 -1
  26. xcoll/scattering_routines/everest/jaw.h +4 -3
  27. xcoll/scattering_routines/everest/materials.py +35 -15
  28. xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
  29. xcoll/scattering_routines/everest/nuclear_interaction.h +1 -1
  30. xcoll/scattering_routines/everest/properties.h +6 -1
  31. xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
  32. xcoll/scattering_routines/geant4/collimasim/.git +1 -0
  33. xcoll/scattering_routines/geant4/collimasim/.gitignore +12 -0
  34. xcoll/scattering_routines/geant4/collimasim/.gitmodules +3 -0
  35. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +26 -0
  36. xcoll/scattering_routines/geant4/collimasim/README.md +21 -0
  37. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +20 -0
  38. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +35 -0
  39. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +10 -0
  40. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +59 -0
  41. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +26 -0
  42. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +37 -0
  43. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +19 -0
  44. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +65 -0
  45. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +73 -0
  46. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +1 -0
  47. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +9 -0
  48. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +386 -0
  49. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +45 -0
  50. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
  51. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +16 -0
  52. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +8 -0
  53. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +3 -0
  54. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +19 -0
  55. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +969 -0
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +84 -0
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +48 -0
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +16 -0
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +103 -0
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +45 -0
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +151 -0
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +3 -0
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +297 -0
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +29 -0
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +6 -0
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +180 -0
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +23 -0
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +192 -0
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +11 -0
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +81 -0
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +93 -0
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +310 -0
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +109 -0
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +43 -0
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +171 -0
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +251 -0
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +305 -0
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +1297 -0
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +262 -0
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +396 -0
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +568 -0
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +337 -0
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +13 -0
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +463 -0
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +286 -0
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +174 -0
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +308 -0
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +91 -0
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +95 -0
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +2050 -0
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +542 -0
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +8 -0
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +648 -0
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +381 -0
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +343 -0
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +48 -0
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +105 -0
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +72 -0
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +427 -0
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +427 -0
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +130 -0
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +96 -0
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +8 -0
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +548 -0
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +605 -0
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +144 -0
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +1432 -0
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +213 -0
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +2 -0
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +65 -0
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +709 -0
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +1021 -0
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +104 -0
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +346 -0
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +467 -0
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +978 -0
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +55 -0
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +606 -0
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +284 -0
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +163 -0
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +121 -0
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +193 -0
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +275 -0
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +1741 -0
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +163 -0
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +65 -0
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +2497 -0
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +1879 -0
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +103 -0
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +375 -0
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +747 -0
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +88 -0
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +11 -0
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +52 -0
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +12 -0
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +6 -0
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +21 -0
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +482 -0
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +63 -0
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +41 -0
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +56 -0
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +155 -0
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +503 -0
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +208 -0
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +275 -0
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +73 -0
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +33 -0
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +279 -0
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +143 -0
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +85 -0
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +179 -0
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +151 -0
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +91 -0
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +85 -0
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +19 -0
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +12 -0
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +26 -0
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +25 -0
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +216 -0
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +163 -0
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +286 -0
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +536 -0
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +107 -0
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +248 -0
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +227 -0
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +202 -0
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +84 -0
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +210 -0
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +550 -0
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +473 -0
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +84 -0
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +21 -0
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +6 -0
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +41 -0
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +35 -0
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +41 -0
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +10 -0
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +165 -0
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +53 -0
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +238 -0
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +126 -0
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +141 -0
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +117 -0
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +41 -0
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +50 -0
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +69 -0
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +42 -0
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +348 -0
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +771 -0
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +47 -0
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +22 -0
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +23 -0
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +326 -0
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +15 -0
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +148 -0
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +272 -0
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +119 -0
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +51 -0
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +5 -0
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +285 -0
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +12 -0
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +265 -0
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +397 -0
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +520 -0
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +49 -0
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +94 -0
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +125 -0
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +331 -0
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +153 -0
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +284 -0
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +107 -0
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +257 -0
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +412 -0
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +517 -0
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +102 -0
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +92 -0
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +233 -0
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +360 -0
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +472 -0
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +593 -0
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +524 -0
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +441 -0
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +103 -0
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +267 -0
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +73 -0
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +59 -0
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +235 -0
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +146 -0
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +189 -0
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +82 -0
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +560 -0
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +651 -0
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +500 -0
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +253 -0
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +452 -0
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +318 -0
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +342 -0
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +291 -0
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +131 -0
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +318 -0
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +144 -0
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +29 -0
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +66 -0
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +44 -0
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +22 -0
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +9 -0
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +510 -0
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +408 -0
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +117 -0
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +70 -0
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +86 -0
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +257 -0
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +44 -0
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +23 -0
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +39 -0
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +64 -0
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +402 -0
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +233 -0
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +276 -0
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +214 -0
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +3 -0
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +65 -0
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +41 -0
  275. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +8 -0
  276. xcoll/scattering_routines/geant4/collimasim/setup.py +144 -0
  277. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +403 -0
  278. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +100 -0
  279. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +763 -0
  280. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +118 -0
  281. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +8 -0
  282. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +63 -0
  283. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +142 -0
  284. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +556 -0
  285. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +6 -0
  286. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +24 -0
  287. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +1 -0
  288. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +1 -0
  289. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +1 -0
  290. xcoll/scattering_routines/geant4/collimasim/tests/README.md +25 -0
  291. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +25 -0
  292. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +18 -0
  293. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +68 -0
  294. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +15 -0
  295. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +110 -0
  296. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +7 -0
  297. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +3 -0
  298. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +54 -0
  299. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +3 -0
  300. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +3 -0
  301. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +5 -0
  302. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +51 -0
  303. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +65 -0
  304. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +59 -0
  305. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +102 -0
  306. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +75 -0
  307. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +74 -0
  308. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +84 -0
  309. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +159 -0
  310. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +99 -0
  311. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +78 -0
  312. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +88 -0
  313. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +80 -0
  314. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +97 -0
  315. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +96 -0
  316. xcoll/scattering_routines/geometry/collimator_geometry.h +9 -10
  317. xcoll/scattering_routines/geometry/crystal_geometry.h +9 -6
  318. {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/METADATA +1 -1
  319. xcoll-0.5.1.dist-info/RECORD +413 -0
  320. xcoll/scattering_routines/fluka/build_fluka_input.py +0 -58
  321. xcoll-0.4.0.dist-info/RECORD +0 -126
  322. {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/LICENSE +0 -0
  323. {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/NOTICE +0 -0
  324. {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,386 @@
1
+ Thank you for your interest in this project! Please refer to the following
2
+ sections on how to contribute code and bug reports.
3
+
4
+ ### Reporting bugs
5
+
6
+ Before submitting a question or bug report, please take a moment of your time
7
+ and ensure that your issue isn't already discussed in the project documentation
8
+ provided at [pybind11.readthedocs.org][] or in the [issue tracker][]. You can
9
+ also check [gitter][] to see if it came up before.
10
+
11
+ Assuming that you have identified a previously unknown problem or an important
12
+ question, it's essential that you submit a self-contained and minimal piece of
13
+ code that reproduces the problem. In other words: no external dependencies,
14
+ isolate the function(s) that cause breakage, submit matched and complete C++
15
+ and Python snippets that can be easily compiled and run in isolation; or
16
+ ideally make a small PR with a failing test case that can be used as a starting
17
+ point.
18
+
19
+ ## Pull requests
20
+
21
+ Contributions are submitted, reviewed, and accepted using GitHub pull requests.
22
+ Please refer to [this article][using pull requests] for details and adhere to
23
+ the following rules to make the process as smooth as possible:
24
+
25
+ * Make a new branch for every feature you're working on.
26
+ * Make small and clean pull requests that are easy to review but make sure they
27
+ do add value by themselves.
28
+ * Add tests for any new functionality and run the test suite (`cmake --build
29
+ build --target pytest`) to ensure that no existing features break.
30
+ * Please run [`pre-commit`][pre-commit] to check your code matches the
31
+ project style. (Note that `gawk` is required.) Use `pre-commit run
32
+ --all-files` before committing (or use installed-mode, check pre-commit docs)
33
+ to verify your code passes before pushing to save time.
34
+ * This project has a strong focus on providing general solutions using a
35
+ minimal amount of code, thus small pull requests are greatly preferred.
36
+
37
+ ### Licensing of contributions
38
+
39
+ pybind11 is provided under a BSD-style license that can be found in the
40
+ ``LICENSE`` file. By using, distributing, or contributing to this project, you
41
+ agree to the terms and conditions of this license.
42
+
43
+ You are under no obligation whatsoever to provide any bug fixes, patches, or
44
+ upgrades to the features, functionality or performance of the source code
45
+ ("Enhancements") to anyone; however, if you choose to make your Enhancements
46
+ available either publicly, or directly to the author of this software, without
47
+ imposing a separate written license agreement for such Enhancements, then you
48
+ hereby grant the following license: a non-exclusive, royalty-free perpetual
49
+ license to install, use, modify, prepare derivative works, incorporate into
50
+ other computer software, distribute, and sublicense such enhancements or
51
+ derivative works thereof, in binary and source code form.
52
+
53
+
54
+ ## Development of pybind11
55
+
56
+ ### Quick setup
57
+
58
+ To setup a quick development environment, use [`nox`](https://nox.thea.codes).
59
+ This will allow you to do some common tasks with minimal setup effort, but will
60
+ take more time to run and be less flexible than a full development environment.
61
+ If you use [`pipx run nox`](https://pipx.pypa.io), you don't even need to
62
+ install `nox`. Examples:
63
+
64
+ ```bash
65
+ # List all available sessions
66
+ nox -l
67
+
68
+ # Run linters
69
+ nox -s lint
70
+
71
+ # Run tests on Python 3.9
72
+ nox -s tests-3.9
73
+
74
+ # Build and preview docs
75
+ nox -s docs -- serve
76
+
77
+ # Build SDists and wheels
78
+ nox -s build
79
+ ```
80
+
81
+ ### Full setup
82
+
83
+ To setup an ideal development environment, run the following commands on a
84
+ system with CMake 3.14+:
85
+
86
+ ```bash
87
+ python3 -m venv venv
88
+ source venv/bin/activate
89
+ pip install -r tests/requirements.txt
90
+ cmake -S . -B build -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON
91
+ cmake --build build -j4
92
+ ```
93
+
94
+ Tips:
95
+
96
+ * You can use `virtualenv` (from PyPI) instead of `venv` (which is Python 3
97
+ only).
98
+ * You can select any name for your environment folder; if it contains "env" it
99
+ will be ignored by git.
100
+ * If you don’t have CMake 3.14+, just add “cmake” to the pip install command.
101
+ * You can use `-DPYBIND11_FINDPYTHON=ON` to use FindPython on CMake 3.12+
102
+ * In classic mode, you may need to set `-DPYTHON_EXECUTABLE=/path/to/python`.
103
+ FindPython uses `-DPython_ROOT_DIR=/path/to` or
104
+ `-DPython_EXECUTABLE=/path/to/python`.
105
+
106
+ ### Configuration options
107
+
108
+ In CMake, configuration options are given with “-D”. Options are stored in the
109
+ build directory, in the `CMakeCache.txt` file, so they are remembered for each
110
+ build directory. Two selections are special - the generator, given with `-G`,
111
+ and the compiler, which is selected based on environment variables `CXX` and
112
+ similar, or `-DCMAKE_CXX_COMPILER=`. Unlike the others, these cannot be changed
113
+ after the initial run.
114
+
115
+ The valid options are:
116
+
117
+ * `-DCMAKE_BUILD_TYPE`: Release, Debug, MinSizeRel, RelWithDebInfo
118
+ * `-DPYBIND11_FINDPYTHON=ON`: Use CMake 3.12+’s FindPython instead of the
119
+ classic, deprecated, custom FindPythonLibs
120
+ * `-DPYBIND11_NOPYTHON=ON`: Disable all Python searching (disables tests)
121
+ * `-DBUILD_TESTING=ON`: Enable the tests
122
+ * `-DDOWNLOAD_CATCH=ON`: Download catch to build the C++ tests
123
+ * `-DOWNLOAD_EIGEN=ON`: Download Eigen for the NumPy tests
124
+ * `-DPYBIND11_INSTALL=ON/OFF`: Enable the install target (on by default for the
125
+ master project)
126
+ * `-DUSE_PYTHON_INSTALL_DIR=ON`: Try to install into the python dir
127
+
128
+
129
+ <details><summary>A few standard CMake tricks: (click to expand)</summary><p>
130
+
131
+ * Use `cmake --build build -v` to see the commands used to build the files.
132
+ * Use `cmake build -LH` to list the CMake options with help.
133
+ * Use `ccmake` if available to see a curses (terminal) gui, or `cmake-gui` for
134
+ a completely graphical interface (not present in the PyPI package).
135
+ * Use `cmake --build build -j12` to build with 12 cores (for example).
136
+ * Use `-G` and the name of a generator to use something different. `cmake
137
+ --help` lists the generators available.
138
+ - On Unix, setting `CMAKE_GENERATER=Ninja` in your environment will give
139
+ you automatic mulithreading on all your CMake projects!
140
+ * Open the `CMakeLists.txt` with QtCreator to generate for that IDE.
141
+ * You can use `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` to generate the `.json` file
142
+ that some tools expect.
143
+
144
+ </p></details>
145
+
146
+
147
+ To run the tests, you can "build" the check target:
148
+
149
+ ```bash
150
+ cmake --build build --target check
151
+ ```
152
+
153
+ `--target` can be spelled `-t` in CMake 3.15+. You can also run individual
154
+ tests with these targets:
155
+
156
+ * `pytest`: Python tests only, using the
157
+ [pytest](https://docs.pytest.org/en/stable/) framework
158
+ * `cpptest`: C++ tests only
159
+ * `test_cmake_build`: Install / subdirectory tests
160
+
161
+ If you want to build just a subset of tests, use
162
+ `-DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp"`. If this is
163
+ empty, all tests will be built.
164
+
165
+ You may also pass flags to the `pytest` target by editing `tests/pytest.ini` or
166
+ by using the `PYTEST_ADDOPTS` environment variable
167
+ (see [`pytest` docs](https://docs.pytest.org/en/2.7.3/customize.html#adding-default-options)). As an example:
168
+
169
+ ```bash
170
+ env PYTEST_ADDOPTS="--capture=no --exitfirst" \
171
+ cmake --build build --target pytest
172
+ # Or using abbreviated flags
173
+ env PYTEST_ADDOPTS="-s -x" cmake --build build --target pytest
174
+ ```
175
+
176
+ ### Formatting
177
+
178
+ All formatting is handled by pre-commit.
179
+
180
+ Install with brew (macOS) or pip (any OS):
181
+
182
+ ```bash
183
+ # Any OS
184
+ python3 -m pip install pre-commit
185
+
186
+ # OR macOS with homebrew:
187
+ brew install pre-commit
188
+ ```
189
+
190
+ Then, you can run it on the items you've added to your staging area, or all
191
+ files:
192
+
193
+ ```bash
194
+ pre-commit run
195
+ # OR
196
+ pre-commit run --all-files
197
+ ```
198
+
199
+ And, if you want to always use it, you can install it as a git hook (hence the
200
+ name, pre-commit):
201
+
202
+ ```bash
203
+ pre-commit install
204
+ ```
205
+
206
+ ### Clang-Format
207
+
208
+ As of v2.6.2, pybind11 ships with a [`clang-format`][clang-format]
209
+ configuration file at the top level of the repo (the filename is
210
+ `.clang-format`). Currently, formatting is NOT applied automatically, but
211
+ manually using `clang-format` for newly developed files is highly encouraged.
212
+ To check if a file needs formatting:
213
+
214
+ ```bash
215
+ clang-format -style=file --dry-run some.cpp
216
+ ```
217
+
218
+ The output will show things to be fixed, if any. To actually format the file:
219
+
220
+ ```bash
221
+ clang-format -style=file -i some.cpp
222
+ ```
223
+
224
+ Note that the `-style-file` option searches the parent directories for the
225
+ `.clang-format` file, i.e. the commands above can be run in any subdirectory
226
+ of the pybind11 repo.
227
+
228
+ ### Clang-Tidy
229
+
230
+ [`clang-tidy`][clang-tidy] performs deeper static code analyses and is
231
+ more complex to run, compared to `clang-format`, but support for `clang-tidy`
232
+ is built into the pybind11 CMake configuration. To run `clang-tidy`, the
233
+ following recipe should work. Run the `docker` command from the top-level
234
+ directory inside your pybind11 git clone. Files will be modified in place,
235
+ so you can use git to monitor the changes.
236
+
237
+ ```bash
238
+ docker run --rm -v $PWD:/mounted_pybind11 -it silkeh/clang:12
239
+ apt-get update && apt-get install -y python3-dev python3-pytest
240
+ cmake -S /mounted_pybind11/ -B build -DCMAKE_CXX_CLANG_TIDY="$(which clang-tidy);-fix" -DDOWNLOAD_EIGEN=ON -DDOWNLOAD_CATCH=ON -DCMAKE_CXX_STANDARD=17
241
+ cmake --build build -j 2 -- --keep-going
242
+ ```
243
+
244
+ ### Include what you use
245
+
246
+ To run include what you use, install (`brew install include-what-you-use` on
247
+ macOS), then run:
248
+
249
+ ```bash
250
+ cmake -S . -B build-iwyu -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE=$(which include-what-you-use)
251
+ cmake --build build
252
+ ```
253
+
254
+ The report is sent to stderr; you can pipe it into a file if you wish.
255
+
256
+ ### Build recipes
257
+
258
+ This builds with the Intel compiler (assuming it is in your path, along with a
259
+ recent CMake and Python 3):
260
+
261
+ ```bash
262
+ python3 -m venv venv
263
+ . venv/bin/activate
264
+ pip install pytest
265
+ cmake -S . -B build-intel -DCMAKE_CXX_COMPILER=$(which icpc) -DDOWNLOAD_CATCH=ON -DDOWNLOAD_EIGEN=ON -DPYBIND11_WERROR=ON
266
+ ```
267
+
268
+ This will test the PGI compilers:
269
+
270
+ ```bash
271
+ docker run --rm -it -v $PWD:/pybind11 nvcr.io/hpc/pgi-compilers:ce
272
+ apt-get update && apt-get install -y python3-dev python3-pip python3-pytest
273
+ wget -qO- "https://cmake.org/files/v3.18/cmake-3.18.2-Linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
274
+ cmake -S pybind11/ -B build
275
+ cmake --build build
276
+ ```
277
+
278
+ ### Explanation of the SDist/wheel building design
279
+
280
+ > These details below are _only_ for packaging the Python sources from git. The
281
+ > SDists and wheels created do not have any extra requirements at all and are
282
+ > completely normal.
283
+
284
+ The main objective of the packaging system is to create SDists (Python's source
285
+ distribution packages) and wheels (Python's binary distribution packages) that
286
+ include everything that is needed to work with pybind11, and which can be
287
+ installed without any additional dependencies. This is more complex than it
288
+ appears: in order to support CMake as a first class language even when using
289
+ the PyPI package, they must include the _generated_ CMake files (so as not to
290
+ require CMake when installing the `pybind11` package itself). They should also
291
+ provide the option to install to the "standard" location
292
+ (`<ENVROOT>/include/pybind11` and `<ENVROOT>/share/cmake/pybind11`) so they are
293
+ easy to find with CMake, but this can cause problems if you are not an
294
+ environment or using ``pyproject.toml`` requirements. This was solved by having
295
+ two packages; the "nice" pybind11 package that stores the includes and CMake
296
+ files inside the package, that you get access to via functions in the package,
297
+ and a `pybind11-global` package that can be included via `pybind11[global]` if
298
+ you want the more invasive but discoverable file locations.
299
+
300
+ If you want to install or package the GitHub source, it is best to have Pip 10
301
+ or newer on Windows, macOS, or Linux (manylinux1 compatible, includes most
302
+ distributions). You can then build the SDists, or run any procedure that makes
303
+ SDists internally, like making wheels or installing.
304
+
305
+
306
+ ```bash
307
+ # Editable development install example
308
+ python3 -m pip install -e .
309
+ ```
310
+
311
+ Since Pip itself does not have an `sdist` command (it does have `wheel` and
312
+ `install`), you may want to use the upcoming `build` package:
313
+
314
+ ```bash
315
+ python3 -m pip install build
316
+
317
+ # Normal package
318
+ python3 -m build -s .
319
+
320
+ # Global extra
321
+ PYBIND11_GLOBAL_SDIST=1 python3 -m build -s .
322
+ ```
323
+
324
+ If you want to use the classic "direct" usage of `python setup.py`, you will
325
+ need CMake 3.15+ and either `make` or `ninja` preinstalled (possibly via `pip
326
+ install cmake ninja`), since directly running Python on `setup.py` cannot pick
327
+ up and install `pyproject.toml` requirements. As long as you have those two
328
+ things, though, everything works the way you would expect:
329
+
330
+ ```bash
331
+ # Normal package
332
+ python3 setup.py sdist
333
+
334
+ # Global extra
335
+ PYBIND11_GLOBAL_SDIST=1 python3 setup.py sdist
336
+ ```
337
+
338
+ A detailed explanation of the build procedure design for developers wanting to
339
+ work on or maintain the packaging system is as follows:
340
+
341
+ #### 1. Building from the source directory
342
+
343
+ When you invoke any `setup.py` command from the source directory, including
344
+ `pip wheel .` and `pip install .`, you will activate a full source build. This
345
+ is made of the following steps:
346
+
347
+ 1. If the tool is PEP 518 compliant, like Pip 10+, it will create a temporary
348
+ virtual environment and install the build requirements (mostly CMake) into
349
+ it. (if you are not on Windows, macOS, or a manylinux compliant system, you
350
+ can disable this with `--no-build-isolation` as long as you have CMake 3.15+
351
+ installed)
352
+ 2. The environment variable `PYBIND11_GLOBAL_SDIST` is checked - if it is set
353
+ and truthy, this will be make the accessory `pybind11-global` package,
354
+ instead of the normal `pybind11` package. This package is used for
355
+ installing the files directly to your environment root directory, using
356
+ `pybind11[global]`.
357
+ 2. `setup.py` reads the version from `pybind11/_version.py` and verifies it
358
+ matches `includes/pybind11/detail/common.h`.
359
+ 3. CMake is run with `-DCMAKE_INSTALL_PREIFX=pybind11`. Since the CMake install
360
+ procedure uses only relative paths and is identical on all platforms, these
361
+ files are valid as long as they stay in the correct relative position to the
362
+ includes. `pybind11/share/cmake/pybind11` has the CMake files, and
363
+ `pybind11/include` has the includes. The build directory is discarded.
364
+ 4. Simpler files are placed in the SDist: `tools/setup_*.py.in`,
365
+ `tools/pyproject.toml` (`main` or `global`)
366
+ 5. The package is created by running the setup function in the
367
+ `tools/setup_*.py`. `setup_main.py` fills in Python packages, and
368
+ `setup_global.py` fills in only the data/header slots.
369
+ 6. A context manager cleans up the temporary CMake install directory (even if
370
+ an error is thrown).
371
+
372
+ ### 2. Building from SDist
373
+
374
+ Since the SDist has the rendered template files in `tools` along with the
375
+ includes and CMake files in the correct locations, the builds are completely
376
+ trivial and simple. No extra requirements are required. You can even use Pip 9
377
+ if you really want to.
378
+
379
+
380
+ [pre-commit]: https://pre-commit.com
381
+ [clang-format]: https://clang.llvm.org/docs/ClangFormat.html
382
+ [clang-tidy]: https://clang.llvm.org/extra/clang-tidy/
383
+ [pybind11.readthedocs.org]: http://pybind11.readthedocs.org/en/latest
384
+ [issue tracker]: https://github.com/pybind/pybind11/issues
385
+ [gitter]: https://gitter.im/pybind/Lobby
386
+ [using pull requests]: https://help.github.com/articles/using-pull-requests
@@ -0,0 +1,45 @@
1
+ name: Bug Report
2
+ description: File an issue about a bug
3
+ title: "[BUG]: "
4
+ labels: [triage]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Maintainers will only make a best effort to triage PRs. Please do your best to make the issue as easy to act on as possible, and only open if clearly a problem with pybind11 (ask first if unsure).
10
+ - type: checkboxes
11
+ id: steps
12
+ attributes:
13
+ label: Required prerequisites
14
+ description: Make sure you've completed the following steps before submitting your issue -- thank you!
15
+ options:
16
+ - label: Make sure you've read the [documentation](https://pybind11.readthedocs.io). Your issue may be addressed there.
17
+ required: true
18
+ - label: Search the [issue tracker](https://github.com/pybind/pybind11/issues) and [Discussions](https:/pybind/pybind11/discussions) to verify that this hasn't already been reported. +1 or comment there if it has.
19
+ required: true
20
+ - label: Consider asking first in the [Gitter chat room](https://gitter.im/pybind/Lobby) or in a [Discussion](https:/pybind/pybind11/discussions/new).
21
+ required: false
22
+
23
+ - type: textarea
24
+ id: description
25
+ attributes:
26
+ label: Problem description
27
+ placeholder: >-
28
+ Provide a short description, state the expected behavior and what
29
+ actually happens. Include relevant information like what version of
30
+ pybind11 you are using, what system you are on, and any useful commands
31
+ / output.
32
+ validations:
33
+ required: true
34
+
35
+ - type: textarea
36
+ id: code
37
+ attributes:
38
+ label: Reproducible example code
39
+ placeholder: >-
40
+ The code should be minimal, have no external dependencies, isolate the
41
+ function(s) that cause breakage. Submit matched and complete C++ and
42
+ Python snippets that can be easily compiled and run to diagnose the
43
+ issue. If possible, make a PR with a new, failing test to give us a
44
+ starting point to work on!
45
+ render: text
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Ask a question
4
+ url: https://github.com/pybind/pybind11/discussions/new
5
+ about: Please ask and answer questions here, or propose new ideas.
6
+ - name: Gitter room
7
+ url: https://gitter.im/pybind/Lobby
8
+ about: A room for discussing pybind11 with an active community
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ # Maintain dependencies for GitHub Actions
4
+ - package-ecosystem: "github-actions"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "daily"
8
+ ignore:
9
+ # Official actions have moving tags like v1
10
+ # that are used, so they don't need updates here
11
+ - dependency-name: "actions/checkout"
12
+ - dependency-name: "actions/setup-python"
13
+ - dependency-name: "actions/cache"
14
+ - dependency-name: "actions/upload-artifact"
15
+ - dependency-name: "actions/download-artifact"
16
+ - dependency-name: "actions/labeler"
@@ -0,0 +1,8 @@
1
+ docs:
2
+ - any:
3
+ - 'docs/**/*.rst'
4
+ - '!docs/changelog.rst'
5
+ - '!docs/upgrade.rst'
6
+
7
+ ci:
8
+ - '.github/workflows/*.yml'
@@ -0,0 +1,3 @@
1
+ needs changelog:
2
+ - all:
3
+ - '!docs/changelog.rst'
@@ -0,0 +1,19 @@
1
+ <!--
2
+ Title (above): please place [branch_name] at the beginning if you are targeting a branch other than master. *Do not target stable*.
3
+ It is recommended to use conventional commit format, see conventionalcommits.org, but not required.
4
+ -->
5
+ ## Description
6
+
7
+ <!-- Include relevant issues or PRs here, describe what changed and why -->
8
+
9
+
10
+ ## Suggested changelog entry:
11
+
12
+ <!-- Fill in the below block with the expected RestructuredText entry. Delete if no entry needed;
13
+ but do not delete header or rst block if an entry is needed! Will be collected via a script. -->
14
+
15
+ ```rst
16
+
17
+ ```
18
+
19
+ <!-- If the upgrade guide needs updating, note that here too -->