xcoll 0.5.12__py3-none-any.whl → 0.6.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 (333) hide show
  1. xcoll/__init__.py +5 -18
  2. xcoll/beam_elements/__init__.py +1 -0
  3. xcoll/beam_elements/absorber.py +12 -2
  4. xcoll/beam_elements/base.py +162 -62
  5. xcoll/beam_elements/blowup.py +1 -0
  6. xcoll/beam_elements/elements_src/black_absorber.h +57 -58
  7. xcoll/beam_elements/elements_src/black_crystal.h +49 -50
  8. xcoll/beam_elements/elements_src/everest_block.h +21 -11
  9. xcoll/beam_elements/elements_src/everest_collimator.h +100 -91
  10. xcoll/beam_elements/elements_src/everest_crystal.h +145 -140
  11. xcoll/beam_elements/elements_src/transparent_collimator.h +126 -0
  12. xcoll/beam_elements/elements_src/transparent_crystal.h +118 -0
  13. xcoll/beam_elements/everest.py +16 -5
  14. xcoll/beam_elements/monitor.py +1 -0
  15. xcoll/beam_elements/transparent.py +83 -0
  16. xcoll/colldb.py +15 -6
  17. xcoll/general.py +1 -1
  18. xcoll/headers/particle_states.py +51 -0
  19. xcoll/initial_distribution.py +121 -91
  20. xcoll/interaction_record/interaction_record.py +2 -1
  21. xcoll/interaction_record/interaction_types.py +2 -2
  22. xcoll/line_tools.py +163 -73
  23. xcoll/lossmap.py +519 -127
  24. xcoll/plot.py +109 -0
  25. xcoll/rf_sweep.py +6 -0
  26. xcoll/scattering_routines/engine.py +414 -217
  27. xcoll/scattering_routines/environment.py +297 -0
  28. xcoll/scattering_routines/everest/amorphous.h +95 -71
  29. xcoll/scattering_routines/everest/{channeling.h → channelling.h} +121 -112
  30. xcoll/scattering_routines/everest/constants.h +1 -1
  31. xcoll/scattering_routines/everest/crystal_parameters.h +9 -9
  32. xcoll/scattering_routines/everest/everest.h +8 -3
  33. xcoll/scattering_routines/everest/everest.py +2 -1
  34. xcoll/scattering_routines/everest/ionisation_loss.h +141 -0
  35. xcoll/scattering_routines/everest/jaw.h +19 -24
  36. xcoll/scattering_routines/everest/materials.py +2 -0
  37. xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
  38. xcoll/scattering_routines/everest/nuclear_interaction.h +35 -19
  39. xcoll/scattering_routines/everest/properties.h +3 -72
  40. xcoll/xaux.py +65 -109
  41. {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/METADATA +5 -5
  42. xcoll-0.6.0.dist-info/RECORD +135 -0
  43. xcoll/_manager.py +0 -22
  44. xcoll/headers/particle_states.h +0 -25
  45. xcoll/install.py +0 -35
  46. xcoll/scattering_routines/geant4/collimasim/.git +0 -1
  47. xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
  48. xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
  49. xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
  50. xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
  51. xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
  52. xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
  53. xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
  54. xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
  55. xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
  56. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
  57. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
  58. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
  59. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
  60. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
  61. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
  62. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
  63. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
  64. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
  65. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
  66. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
  67. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
  68. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
  69. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
  70. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
  71. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
  72. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
  73. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
  74. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
  75. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
  76. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
  77. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
  78. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
  79. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
  80. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
  81. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
  82. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
  83. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
  84. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
  85. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
  86. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
  87. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
  88. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
  89. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
  90. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
  91. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
  92. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
  93. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
  94. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
  95. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
  96. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
  97. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
  98. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
  99. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
  100. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
  101. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
  102. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
  103. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
  104. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
  105. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
  106. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
  107. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
  108. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
  109. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
  110. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
  111. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
  112. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
  113. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
  114. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
  115. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
  116. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
  117. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
  118. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
  119. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
  120. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
  121. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
  122. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
  123. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
  124. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
  125. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
  126. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
  127. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
  128. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
  129. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
  130. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
  131. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
  132. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
  133. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
  134. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
  135. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
  136. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
  137. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
  138. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
  139. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
  140. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
  141. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
  142. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
  143. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
  144. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
  145. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
  146. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
  147. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
  148. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
  149. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
  150. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
  151. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
  152. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
  153. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
  154. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
  155. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
  156. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
  157. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
  158. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
  159. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
  160. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
  161. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
  162. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
  163. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
  164. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
  165. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
  166. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
  167. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
  168. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
  169. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
  170. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
  171. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
  172. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
  173. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
  174. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
  175. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
  176. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
  177. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
  178. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
  179. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
  180. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
  181. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
  182. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
  183. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
  184. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
  185. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
  186. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
  187. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
  188. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
  189. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
  190. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
  191. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
  192. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
  193. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
  194. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
  195. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
  196. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
  197. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
  198. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
  199. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
  200. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
  201. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
  202. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
  203. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
  204. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
  205. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
  206. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
  207. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
  208. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
  209. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
  210. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
  211. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
  212. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
  213. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
  214. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
  215. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
  216. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
  217. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
  218. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
  219. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
  220. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
  221. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
  222. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
  223. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
  224. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
  225. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
  226. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
  227. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
  228. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
  229. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
  230. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
  231. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
  232. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
  233. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
  234. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
  235. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
  236. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
  237. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
  238. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
  239. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
  240. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
  241. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
  242. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
  243. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
  244. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
  245. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
  246. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
  247. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
  248. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
  249. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
  250. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
  251. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
  252. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
  253. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
  254. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
  255. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
  256. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
  257. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
  258. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
  259. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
  260. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
  261. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
  262. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
  263. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
  264. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
  265. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
  266. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
  267. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
  268. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
  269. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
  270. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
  271. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
  272. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
  273. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
  274. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
  275. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
  276. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
  277. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
  278. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
  279. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
  280. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
  281. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
  282. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
  283. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
  284. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
  285. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
  286. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
  287. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
  288. xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
  289. xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
  290. xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
  291. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
  292. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
  293. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -763
  294. xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -118
  295. xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
  296. xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
  297. xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
  298. xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -556
  299. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
  300. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -24
  301. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
  302. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
  303. xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
  304. xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
  305. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +0 -25
  306. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
  307. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
  308. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
  309. xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
  310. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
  311. xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
  312. xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
  313. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
  314. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
  315. xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +0 -5
  316. xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
  317. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
  318. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
  319. xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
  320. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
  321. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
  322. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
  323. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
  324. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +0 -99
  325. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +0 -78
  326. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +0 -88
  327. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
  328. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
  329. xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +0 -96
  330. xcoll-0.5.12.dist-info/RECORD +0 -415
  331. {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/LICENSE +0 -0
  332. {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/NOTICE +0 -0
  333. {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/WHEEL +0 -0
@@ -1,503 +0,0 @@
1
- # CMakeLists.txt -- Build system for the pybind11 test suite
2
- #
3
- # Copyright (c) 2015 Wenzel Jakob <wenzel@inf.ethz.ch>
4
- #
5
- # All rights reserved. Use of this source code is governed by a
6
- # BSD-style license that can be found in the LICENSE file.
7
-
8
- cmake_minimum_required(VERSION 3.4)
9
-
10
- # The `cmake_minimum_required(VERSION 3.4...3.18)` syntax does not work with
11
- # some versions of VS that have a patched CMake 3.11. This forces us to emulate
12
- # the behavior using the following workaround:
13
- if(${CMAKE_VERSION} VERSION_LESS 3.21)
14
- cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
15
- else()
16
- cmake_policy(VERSION 3.21)
17
- endif()
18
-
19
- # Only needed for CMake < 3.5 support
20
- include(CMakeParseArguments)
21
-
22
- # Filter out items; print an optional message if any items filtered
23
- #
24
- # Usage:
25
- # pybind11_filter_tests(LISTNAME file1.cpp file2.cpp ... MESSAGE "")
26
- #
27
- macro(pybind11_filter_tests LISTNAME)
28
- cmake_parse_arguments(ARG "" "MESSAGE" "" ${ARGN})
29
- set(PYBIND11_FILTER_TESTS_FOUND OFF)
30
- foreach(filename IN LISTS ARG_UNPARSED_ARGUMENTS)
31
- list(FIND ${LISTNAME} ${filename} _FILE_FOUND)
32
- if(_FILE_FOUND GREATER -1)
33
- list(REMOVE_AT ${LISTNAME} ${_FILE_FOUND})
34
- set(PYBIND11_FILTER_TESTS_FOUND ON)
35
- endif()
36
- endforeach()
37
- if(PYBIND11_FILTER_TESTS_FOUND AND ARG_MESSAGE)
38
- message(STATUS "${ARG_MESSAGE}")
39
- endif()
40
- endmacro()
41
-
42
- macro(possibly_uninitialized)
43
- foreach(VARNAME ${ARGN})
44
- if(NOT DEFINED "${VARNAME}")
45
- set("${VARNAME}" "")
46
- endif()
47
- endforeach()
48
- endmacro()
49
-
50
- # New Python support
51
- if(DEFINED Python_EXECUTABLE)
52
- set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
53
- set(PYTHON_VERSION "${Python_VERSION}")
54
- endif()
55
-
56
- # There's no harm in including a project in a project
57
- project(pybind11_tests CXX)
58
-
59
- # Access FindCatch and more
60
- list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../tools")
61
-
62
- option(PYBIND11_WERROR "Report all warnings as errors" OFF)
63
- option(DOWNLOAD_EIGEN "Download EIGEN (requires CMake 3.11+)" OFF)
64
- option(PYBIND11_CUDA_TESTS "Enable building CUDA tests (requires CMake 3.12+)" OFF)
65
- set(PYBIND11_TEST_OVERRIDE
66
- ""
67
- CACHE STRING "Tests from ;-separated list of *.cpp files will be built instead of all tests")
68
- set(PYBIND11_TEST_FILTER
69
- ""
70
- CACHE STRING "Tests from ;-separated list of *.cpp files will be removed from all tests")
71
-
72
- if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
73
- # We're being loaded directly, i.e. not via add_subdirectory, so make this
74
- # work as its own project and load the pybind11Config to get the tools we need
75
- find_package(pybind11 REQUIRED CONFIG)
76
- endif()
77
-
78
- if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
79
- message(STATUS "Setting tests build type to MinSizeRel as none was specified")
80
- set(CMAKE_BUILD_TYPE
81
- MinSizeRel
82
- CACHE STRING "Choose the type of build." FORCE)
83
- set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel"
84
- "RelWithDebInfo")
85
- endif()
86
-
87
- if(PYBIND11_CUDA_TESTS)
88
- enable_language(CUDA)
89
- if(DEFINED CMAKE_CXX_STANDARD)
90
- set(CMAKE_CUDA_STANDARD ${CMAKE_CXX_STANDARD})
91
- endif()
92
- set(CMAKE_CUDA_STANDARD_REQUIRED ON)
93
- endif()
94
-
95
- # Full set of test files (you can override these; see below)
96
- set(PYBIND11_TEST_FILES
97
- test_async.cpp
98
- test_buffers.cpp
99
- test_builtin_casters.cpp
100
- test_call_policies.cpp
101
- test_callbacks.cpp
102
- test_chrono.cpp
103
- test_class.cpp
104
- test_constants_and_functions.cpp
105
- test_copy_move.cpp
106
- test_custom_type_casters.cpp
107
- test_custom_type_setup.cpp
108
- test_docstring_options.cpp
109
- test_eigen.cpp
110
- test_enum.cpp
111
- test_eval.cpp
112
- test_exceptions.cpp
113
- test_factory_constructors.cpp
114
- test_gil_scoped.cpp
115
- test_iostream.cpp
116
- test_kwargs_and_defaults.cpp
117
- test_local_bindings.cpp
118
- test_methods_and_attributes.cpp
119
- test_modules.cpp
120
- test_multiple_inheritance.cpp
121
- test_numpy_array.cpp
122
- test_numpy_dtypes.cpp
123
- test_numpy_vectorize.cpp
124
- test_opaque_types.cpp
125
- test_operator_overloading.cpp
126
- test_pickling.cpp
127
- test_pytypes.cpp
128
- test_sequences_and_iterators.cpp
129
- test_smart_ptr.cpp
130
- test_stl.cpp
131
- test_stl_binders.cpp
132
- test_tagbased_polymorphic.cpp
133
- test_thread.cpp
134
- test_union.cpp
135
- test_virtual_functions.cpp)
136
-
137
- # Invoking cmake with something like:
138
- # cmake -DPYBIND11_TEST_OVERRIDE="test_callbacks.cpp;test_pickling.cpp" ..
139
- # lets you override the tests that get compiled and run. You can restore to all tests with:
140
- # cmake -DPYBIND11_TEST_OVERRIDE= ..
141
- if(PYBIND11_TEST_OVERRIDE)
142
- set(PYBIND11_TEST_FILES ${PYBIND11_TEST_OVERRIDE})
143
- endif()
144
-
145
- # You can also filter tests:
146
- if(PYBIND11_TEST_FILTER)
147
- pybind11_filter_tests(PYBIND11_TEST_FILES ${PYBIND11_TEST_FILTER})
148
- endif()
149
-
150
- if(PYTHON_VERSION VERSION_LESS 3.5)
151
- pybind11_filter_tests(PYBIND11_TEST_FILES test_async.cpp MESSAGE
152
- "Skipping test_async on Python 2")
153
- endif()
154
-
155
- # Skip tests for CUDA check:
156
- # /pybind11/tests/test_constants_and_functions.cpp(125):
157
- # error: incompatible exception specifications
158
- if(PYBIND11_CUDA_TESTS)
159
- pybind11_filter_tests(
160
- PYBIND11_TEST_FILES test_constants_and_functions.cpp MESSAGE
161
- "Skipping test_constants_and_functions due to incompatible exception specifications")
162
- endif()
163
-
164
- string(REPLACE ".cpp" ".py" PYBIND11_PYTEST_FILES "${PYBIND11_TEST_FILES}")
165
-
166
- # Contains the set of test files that require pybind11_cross_module_tests to be
167
- # built; if none of these are built (i.e. because TEST_OVERRIDE is used and
168
- # doesn't include them) the second module doesn't get built.
169
- set(PYBIND11_CROSS_MODULE_TESTS test_exceptions.py test_local_bindings.py test_stl.py
170
- test_stl_binders.py)
171
-
172
- set(PYBIND11_CROSS_MODULE_GIL_TESTS test_gil_scoped.py)
173
-
174
- set(PYBIND11_EIGEN_REPO
175
- "https://gitlab.com/libeigen/eigen.git"
176
- CACHE STRING "Eigen repository to use for tests")
177
- # This hash is for 3.4.0, using a hash for security reasons
178
- set(PYBIND11_EIGEN_VERSION
179
- "929bc0e191d0927b1735b9a1ddc0e8b77e3a25ec"
180
- CACHE STRING "Eigen version to use for tests")
181
-
182
- # Check if Eigen is available; if not, remove from PYBIND11_TEST_FILES (but
183
- # keep it in PYBIND11_PYTEST_FILES, so that we get the "eigen is not installed"
184
- # skip message).
185
- list(FIND PYBIND11_TEST_FILES test_eigen.cpp PYBIND11_TEST_FILES_EIGEN_I)
186
- if(PYBIND11_TEST_FILES_EIGEN_I GREATER -1)
187
- # Try loading via newer Eigen's Eigen3Config first (bypassing tools/FindEigen3.cmake).
188
- # Eigen 3.3.1+ exports a cmake 3.0+ target for handling dependency requirements, but also
189
- # produces a fatal error if loaded from a pre-3.0 cmake.
190
- if(DOWNLOAD_EIGEN)
191
- if(CMAKE_VERSION VERSION_LESS 3.11)
192
- message(FATAL_ERROR "CMake 3.11+ required when using DOWNLOAD_EIGEN")
193
- endif()
194
-
195
- include(FetchContent)
196
- FetchContent_Declare(
197
- eigen
198
- GIT_REPOSITORY "${PYBIND11_EIGEN_REPO}"
199
- GIT_TAG "${PYBIND11_EIGEN_VERSION}")
200
-
201
- FetchContent_GetProperties(eigen)
202
- if(NOT eigen_POPULATED)
203
- message(STATUS "Downloading Eigen")
204
- FetchContent_Populate(eigen)
205
- endif()
206
-
207
- set(EIGEN3_INCLUDE_DIR ${eigen_SOURCE_DIR})
208
- set(EIGEN3_FOUND TRUE)
209
-
210
- else()
211
- find_package(Eigen3 3.2.7 QUIET CONFIG)
212
-
213
- if(NOT EIGEN3_FOUND)
214
- # Couldn't load via target, so fall back to allowing module mode finding, which will pick up
215
- # tools/FindEigen3.cmake
216
- find_package(Eigen3 3.2.7 QUIET)
217
- endif()
218
- endif()
219
-
220
- if(EIGEN3_FOUND)
221
- if(NOT TARGET Eigen3::Eigen)
222
- add_library(Eigen3::Eigen IMPORTED INTERFACE)
223
- set_property(TARGET Eigen3::Eigen PROPERTY INTERFACE_INCLUDE_DIRECTORIES
224
- "${EIGEN3_INCLUDE_DIR}")
225
- endif()
226
-
227
- # Eigen 3.3.1+ cmake sets EIGEN3_VERSION_STRING (and hard codes the version when installed
228
- # rather than looking it up in the cmake script); older versions, and the
229
- # tools/FindEigen3.cmake, set EIGEN3_VERSION instead.
230
- if(NOT EIGEN3_VERSION AND EIGEN3_VERSION_STRING)
231
- set(EIGEN3_VERSION ${EIGEN3_VERSION_STRING})
232
- endif()
233
- message(STATUS "Building tests with Eigen v${EIGEN3_VERSION}")
234
- else()
235
- list(REMOVE_AT PYBIND11_TEST_FILES ${PYBIND11_TEST_FILES_EIGEN_I})
236
- message(
237
- STATUS "Building tests WITHOUT Eigen, use -DDOWNLOAD_EIGEN=ON on CMake 3.11+ to download")
238
- endif()
239
- endif()
240
-
241
- # Optional dependency for some tests (boost::variant is only supported with version >= 1.56)
242
- find_package(Boost 1.56)
243
-
244
- if(Boost_FOUND)
245
- if(NOT TARGET Boost::headers)
246
- add_library(Boost::headers IMPORTED INTERFACE)
247
- if(TARGET Boost::boost)
248
- # Classic FindBoost
249
- set_property(TARGET Boost::boost PROPERTY INTERFACE_LINK_LIBRARIES Boost::boost)
250
- else()
251
- # Very old FindBoost, or newer Boost than CMake in older CMakes
252
- set_property(TARGET Boost::headers PROPERTY INTERFACE_INCLUDE_DIRECTORIES
253
- ${Boost_INCLUDE_DIRS})
254
- endif()
255
- endif()
256
- endif()
257
-
258
- # Check if we need to add -lstdc++fs or -lc++fs or nothing
259
- if(MSVC)
260
- set(STD_FS_NO_LIB_NEEDED TRUE)
261
- else()
262
- file(
263
- WRITE ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
264
- "#include <filesystem>\nint main(int argc, char ** argv) {\n std::filesystem::path p(argv[0]);\n return p.string().length();\n}"
265
- )
266
- try_compile(
267
- STD_FS_NO_LIB_NEEDED ${CMAKE_CURRENT_BINARY_DIR}
268
- SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
269
- COMPILE_DEFINITIONS -std=c++17)
270
- try_compile(
271
- STD_FS_NEEDS_STDCXXFS ${CMAKE_CURRENT_BINARY_DIR}
272
- SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
273
- COMPILE_DEFINITIONS -std=c++17
274
- LINK_LIBRARIES stdc++fs)
275
- try_compile(
276
- STD_FS_NEEDS_CXXFS ${CMAKE_CURRENT_BINARY_DIR}
277
- SOURCES ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
278
- COMPILE_DEFINITIONS -std=c++17
279
- LINK_LIBRARIES c++fs)
280
- endif()
281
-
282
- if(${STD_FS_NEEDS_STDCXXFS})
283
- set(STD_FS_LIB stdc++fs)
284
- elseif(${STD_FS_NEEDS_CXXFS})
285
- set(STD_FS_LIB c++fs)
286
- elseif(${STD_FS_NO_LIB_NEEDED})
287
- set(STD_FS_LIB "")
288
- else()
289
- message(WARNING "Unknown compiler - not passing -lstdc++fs")
290
- set(STD_FS_LIB "")
291
- endif()
292
-
293
- # Compile with compiler warnings turned on
294
- function(pybind11_enable_warnings target_name)
295
- if(MSVC)
296
- target_compile_options(${target_name} PRIVATE /W4)
297
- elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Intel|Clang)" AND NOT PYBIND11_CUDA_TESTS)
298
- target_compile_options(
299
- ${target_name}
300
- PRIVATE -Wall
301
- -Wextra
302
- -Wconversion
303
- -Wcast-qual
304
- -Wdeprecated
305
- -Wundef
306
- -Wnon-virtual-dtor)
307
- endif()
308
-
309
- if(PYBIND11_WERROR)
310
- if(MSVC)
311
- target_compile_options(${target_name} PRIVATE /WX)
312
- elseif(PYBIND11_CUDA_TESTS)
313
- target_compile_options(${target_name} PRIVATE "SHELL:-Werror all-warnings")
314
- elseif(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang|IntelLLVM)")
315
- target_compile_options(${target_name} PRIVATE -Werror)
316
- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
317
- target_compile_options(
318
- ${target_name}
319
- PRIVATE
320
- -Werror-all
321
- # "Inlining inhibited by limit max-size", "Inlining inhibited by limit max-total-size"
322
- -diag-disable 11074,11076)
323
- endif()
324
- endif()
325
-
326
- # Needs to be re-added since the ordering requires these to be after the ones above
327
- if(CMAKE_CXX_STANDARD
328
- AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"
329
- AND PYTHON_VERSION VERSION_LESS 3.0)
330
- if(CMAKE_CXX_STANDARD LESS 17)
331
- target_compile_options(${target_name} PUBLIC -Wno-deprecated-register)
332
- else()
333
- target_compile_options(${target_name} PUBLIC -Wno-register)
334
- endif()
335
- endif()
336
- endfunction()
337
-
338
- set(test_targets pybind11_tests)
339
-
340
- # Build pybind11_cross_module_tests if any test_whatever.py are being built that require it
341
- foreach(t ${PYBIND11_CROSS_MODULE_TESTS})
342
- list(FIND PYBIND11_PYTEST_FILES ${t} i)
343
- if(i GREATER -1)
344
- list(APPEND test_targets pybind11_cross_module_tests)
345
- break()
346
- endif()
347
- endforeach()
348
-
349
- foreach(t ${PYBIND11_CROSS_MODULE_GIL_TESTS})
350
- list(FIND PYBIND11_PYTEST_FILES ${t} i)
351
- if(i GREATER -1)
352
- list(APPEND test_targets cross_module_gil_utils)
353
- break()
354
- endif()
355
- endforeach()
356
-
357
- # Support CUDA testing by forcing the target file to compile with NVCC
358
- if(PYBIND11_CUDA_TESTS)
359
- set_property(SOURCE ${PYBIND11_TEST_FILES} PROPERTY LANGUAGE CUDA)
360
- endif()
361
-
362
- foreach(target ${test_targets})
363
- set(test_files ${PYBIND11_TEST_FILES})
364
- if(NOT "${target}" STREQUAL "pybind11_tests")
365
- set(test_files "")
366
- endif()
367
-
368
- # Support CUDA testing by forcing the target file to compile with NVCC
369
- if(PYBIND11_CUDA_TESTS)
370
- set_property(SOURCE ${target}.cpp PROPERTY LANGUAGE CUDA)
371
- endif()
372
-
373
- # Create the binding library
374
- pybind11_add_module(${target} THIN_LTO ${target}.cpp ${test_files} ${PYBIND11_HEADERS})
375
- pybind11_enable_warnings(${target})
376
-
377
- if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
378
- get_property(
379
- suffix
380
- TARGET ${target}
381
- PROPERTY SUFFIX)
382
- set(source_output "${CMAKE_CURRENT_SOURCE_DIR}/${target}${suffix}")
383
- if(suffix AND EXISTS "${source_output}")
384
- message(WARNING "Output file also in source directory; "
385
- "please remove to avoid confusion: ${source_output}")
386
- endif()
387
- endif()
388
-
389
- if(MSVC)
390
- target_compile_options(${target} PRIVATE /utf-8)
391
- endif()
392
-
393
- if(EIGEN3_FOUND)
394
- target_link_libraries(${target} PRIVATE Eigen3::Eigen)
395
- target_compile_definitions(${target} PRIVATE -DPYBIND11_TEST_EIGEN)
396
- endif()
397
-
398
- if(Boost_FOUND)
399
- target_link_libraries(${target} PRIVATE Boost::headers)
400
- target_compile_definitions(${target} PRIVATE -DPYBIND11_TEST_BOOST)
401
- endif()
402
-
403
- target_link_libraries(${target} PRIVATE ${STD_FS_LIB})
404
-
405
- # Always write the output file directly into the 'tests' directory (even on MSVC)
406
- if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
407
- set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY
408
- "${CMAKE_CURRENT_BINARY_DIR}")
409
-
410
- if(DEFINED CMAKE_CONFIGURATION_TYPES)
411
- foreach(config ${CMAKE_CONFIGURATION_TYPES})
412
- string(TOUPPER ${config} config)
413
- set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${config}
414
- "${CMAKE_CURRENT_BINARY_DIR}")
415
- endforeach()
416
- endif()
417
- endif()
418
- endforeach()
419
-
420
- # Make sure pytest is found or produce a warning
421
- pybind11_find_import(pytest VERSION 3.1)
422
-
423
- if(NOT CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR)
424
- # This is not used later in the build, so it's okay to regenerate each time.
425
- configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pytest.ini" "${CMAKE_CURRENT_BINARY_DIR}/pytest.ini"
426
- COPYONLY)
427
- file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pytest.ini"
428
- "\ntestpaths = \"${CMAKE_CURRENT_SOURCE_DIR}\"")
429
-
430
- endif()
431
-
432
- # cmake 3.12 added list(transform <list> prepend
433
- # but we can't use it yet
434
- string(REPLACE "test_" "${CMAKE_CURRENT_SOURCE_DIR}/test_" PYBIND11_ABS_PYTEST_FILES
435
- "${PYBIND11_PYTEST_FILES}")
436
-
437
- set(PYBIND11_TEST_PREFIX_COMMAND
438
- ""
439
- CACHE STRING "Put this before pytest, use for checkers and such")
440
-
441
- # A single command to compile and run the tests
442
- add_custom_target(
443
- pytest
444
- COMMAND ${PYBIND11_TEST_PREFIX_COMMAND} ${PYTHON_EXECUTABLE} -m pytest
445
- ${PYBIND11_ABS_PYTEST_FILES}
446
- DEPENDS ${test_targets}
447
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
448
- USES_TERMINAL)
449
-
450
- if(PYBIND11_TEST_OVERRIDE)
451
- add_custom_command(
452
- TARGET pytest
453
- POST_BUILD
454
- COMMAND ${CMAKE_COMMAND} -E echo
455
- "Note: not all tests run: -DPYBIND11_TEST_OVERRIDE is in effect")
456
- endif()
457
-
458
- # cmake-format: off
459
- add_custom_target(
460
- memcheck
461
- COMMAND
462
- PYTHONMALLOC=malloc
463
- valgrind
464
- --leak-check=full
465
- --show-leak-kinds=definite,indirect
466
- --errors-for-leak-kinds=definite,indirect
467
- --error-exitcode=1
468
- --read-var-info=yes
469
- --track-origins=yes
470
- --suppressions="${CMAKE_CURRENT_SOURCE_DIR}/valgrind-python.supp"
471
- --suppressions="${CMAKE_CURRENT_SOURCE_DIR}/valgrind-numpy-scipy.supp"
472
- --gen-suppressions=all
473
- ${PYTHON_EXECUTABLE} -m pytest ${PYBIND11_ABS_PYTEST_FILES}
474
- DEPENDS ${test_targets}
475
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
476
- USES_TERMINAL)
477
- # cmake-format: on
478
-
479
- # Add a check target to run all the tests, starting with pytest (we add dependencies to this below)
480
- add_custom_target(check DEPENDS pytest)
481
-
482
- # The remaining tests only apply when being built as part of the pybind11 project, but not if the
483
- # tests are being built independently.
484
- if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
485
- return()
486
- endif()
487
-
488
- # Add a post-build comment to show the primary test suite .so size and, if a previous size, compare it:
489
- add_custom_command(
490
- TARGET pybind11_tests
491
- POST_BUILD
492
- COMMAND
493
- ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../tools/libsize.py
494
- $<TARGET_FILE:pybind11_tests>
495
- ${CMAKE_CURRENT_BINARY_DIR}/sosize-$<TARGET_FILE_NAME:pybind11_tests>.txt)
496
-
497
- if(NOT PYBIND11_CUDA_TESTS)
498
- # Test embedding the interpreter. Provides the `cpptest` target.
499
- add_subdirectory(test_embed)
500
-
501
- # Test CMake build using functions and targets from subdirectory or installed location
502
- add_subdirectory(test_cmake_build)
503
- endif()
@@ -1,208 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- """pytest configuration
3
-
4
- Extends output capture as needed by pybind11: ignore constructors, optional unordered lines.
5
- Adds docstring and exceptions message sanitizers: ignore Python 2 vs 3 differences.
6
- """
7
-
8
- import contextlib
9
- import difflib
10
- import gc
11
- import re
12
- import textwrap
13
-
14
- import pytest
15
-
16
- import env
17
-
18
- # Early diagnostic for failed imports
19
- import pybind11_tests # noqa: F401
20
-
21
- _unicode_marker = re.compile(r"u(\'[^\']*\')")
22
- _long_marker = re.compile(r"([0-9])L")
23
- _hexadecimal = re.compile(r"0x[0-9a-fA-F]+")
24
-
25
- # Avoid collecting Python3 only files
26
- collect_ignore = []
27
- if env.PY2:
28
- collect_ignore.append("test_async.py")
29
-
30
-
31
- def _strip_and_dedent(s):
32
- """For triple-quote strings"""
33
- return textwrap.dedent(s.lstrip("\n").rstrip())
34
-
35
-
36
- def _split_and_sort(s):
37
- """For output which does not require specific line order"""
38
- return sorted(_strip_and_dedent(s).splitlines())
39
-
40
-
41
- def _make_explanation(a, b):
42
- """Explanation for a failed assert -- the a and b arguments are List[str]"""
43
- return ["--- actual / +++ expected"] + [
44
- line.strip("\n") for line in difflib.ndiff(a, b)
45
- ]
46
-
47
-
48
- class Output(object):
49
- """Basic output post-processing and comparison"""
50
-
51
- def __init__(self, string):
52
- self.string = string
53
- self.explanation = []
54
-
55
- def __str__(self):
56
- return self.string
57
-
58
- def __eq__(self, other):
59
- # Ignore constructor/destructor output which is prefixed with "###"
60
- a = [
61
- line
62
- for line in self.string.strip().splitlines()
63
- if not line.startswith("###")
64
- ]
65
- b = _strip_and_dedent(other).splitlines()
66
- if a == b:
67
- return True
68
- else:
69
- self.explanation = _make_explanation(a, b)
70
- return False
71
-
72
-
73
- class Unordered(Output):
74
- """Custom comparison for output without strict line ordering"""
75
-
76
- def __eq__(self, other):
77
- a = _split_and_sort(self.string)
78
- b = _split_and_sort(other)
79
- if a == b:
80
- return True
81
- else:
82
- self.explanation = _make_explanation(a, b)
83
- return False
84
-
85
-
86
- class Capture(object):
87
- def __init__(self, capfd):
88
- self.capfd = capfd
89
- self.out = ""
90
- self.err = ""
91
-
92
- def __enter__(self):
93
- self.capfd.readouterr()
94
- return self
95
-
96
- def __exit__(self, *args):
97
- self.out, self.err = self.capfd.readouterr()
98
-
99
- def __eq__(self, other):
100
- a = Output(self.out)
101
- b = other
102
- if a == b:
103
- return True
104
- else:
105
- self.explanation = a.explanation
106
- return False
107
-
108
- def __str__(self):
109
- return self.out
110
-
111
- def __contains__(self, item):
112
- return item in self.out
113
-
114
- @property
115
- def unordered(self):
116
- return Unordered(self.out)
117
-
118
- @property
119
- def stderr(self):
120
- return Output(self.err)
121
-
122
-
123
- @pytest.fixture
124
- def capture(capsys):
125
- """Extended `capsys` with context manager and custom equality operators"""
126
- return Capture(capsys)
127
-
128
-
129
- class SanitizedString(object):
130
- def __init__(self, sanitizer):
131
- self.sanitizer = sanitizer
132
- self.string = ""
133
- self.explanation = []
134
-
135
- def __call__(self, thing):
136
- self.string = self.sanitizer(thing)
137
- return self
138
-
139
- def __eq__(self, other):
140
- a = self.string
141
- b = _strip_and_dedent(other)
142
- if a == b:
143
- return True
144
- else:
145
- self.explanation = _make_explanation(a.splitlines(), b.splitlines())
146
- return False
147
-
148
-
149
- def _sanitize_general(s):
150
- s = s.strip()
151
- s = s.replace("pybind11_tests.", "m.")
152
- s = s.replace("unicode", "str")
153
- s = _long_marker.sub(r"\1", s)
154
- s = _unicode_marker.sub(r"\1", s)
155
- return s
156
-
157
-
158
- def _sanitize_docstring(thing):
159
- s = thing.__doc__
160
- s = _sanitize_general(s)
161
- return s
162
-
163
-
164
- @pytest.fixture
165
- def doc():
166
- """Sanitize docstrings and add custom failure explanation"""
167
- return SanitizedString(_sanitize_docstring)
168
-
169
-
170
- def _sanitize_message(thing):
171
- s = str(thing)
172
- s = _sanitize_general(s)
173
- s = _hexadecimal.sub("0", s)
174
- return s
175
-
176
-
177
- @pytest.fixture
178
- def msg():
179
- """Sanitize messages and add custom failure explanation"""
180
- return SanitizedString(_sanitize_message)
181
-
182
-
183
- # noinspection PyUnusedLocal
184
- def pytest_assertrepr_compare(op, left, right):
185
- """Hook to insert custom failure explanation"""
186
- if hasattr(left, "explanation"):
187
- return left.explanation
188
-
189
-
190
- @contextlib.contextmanager
191
- def suppress(exception):
192
- """Suppress the desired exception"""
193
- try:
194
- yield
195
- except exception:
196
- pass
197
-
198
-
199
- def gc_collect():
200
- """Run the garbage collector twice (needed when running
201
- reference counting tests with PyPy)"""
202
- gc.collect()
203
- gc.collect()
204
-
205
-
206
- def pytest_configure():
207
- pytest.suppress = suppress
208
- pytest.gc_collect = gc_collect