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,192 +0,0 @@
1
- # Makefile for Sphinx documentation
2
- #
3
-
4
- # You can set these variables from the command line.
5
- SPHINXOPTS =
6
- SPHINXBUILD = sphinx-build
7
- PAPER =
8
- BUILDDIR = .build
9
-
10
- # User-friendly check for sphinx-build
11
- ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12
- $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13
- endif
14
-
15
- # Internal variables.
16
- PAPEROPT_a4 = -D latex_paper_size=a4
17
- PAPEROPT_letter = -D latex_paper_size=letter
18
- ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
19
- # the i18n builder cannot share the environment and doctrees with the others
20
- I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
21
-
22
- .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
23
-
24
- help:
25
- @echo "Please use \`make <target>' where <target> is one of"
26
- @echo " html to make standalone HTML files"
27
- @echo " dirhtml to make HTML files named index.html in directories"
28
- @echo " singlehtml to make a single large HTML file"
29
- @echo " pickle to make pickle files"
30
- @echo " json to make JSON files"
31
- @echo " htmlhelp to make HTML files and a HTML help project"
32
- @echo " qthelp to make HTML files and a qthelp project"
33
- @echo " applehelp to make an Apple Help Book"
34
- @echo " devhelp to make HTML files and a Devhelp project"
35
- @echo " epub to make an epub"
36
- @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
37
- @echo " latexpdf to make LaTeX files and run them through pdflatex"
38
- @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
39
- @echo " text to make text files"
40
- @echo " man to make manual pages"
41
- @echo " texinfo to make Texinfo files"
42
- @echo " info to make Texinfo files and run them through makeinfo"
43
- @echo " gettext to make PO message catalogs"
44
- @echo " changes to make an overview of all changed/added/deprecated items"
45
- @echo " xml to make Docutils-native XML files"
46
- @echo " pseudoxml to make pseudoxml-XML files for display purposes"
47
- @echo " linkcheck to check all external links for integrity"
48
- @echo " doctest to run all doctests embedded in the documentation (if enabled)"
49
- @echo " coverage to run coverage check of the documentation (if enabled)"
50
-
51
- clean:
52
- rm -rf $(BUILDDIR)/*
53
-
54
- html:
55
- $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
56
- @echo
57
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
58
-
59
- dirhtml:
60
- $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
61
- @echo
62
- @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
63
-
64
- singlehtml:
65
- $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
66
- @echo
67
- @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
68
-
69
- pickle:
70
- $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
71
- @echo
72
- @echo "Build finished; now you can process the pickle files."
73
-
74
- json:
75
- $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
76
- @echo
77
- @echo "Build finished; now you can process the JSON files."
78
-
79
- htmlhelp:
80
- $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
81
- @echo
82
- @echo "Build finished; now you can run HTML Help Workshop with the" \
83
- ".hhp project file in $(BUILDDIR)/htmlhelp."
84
-
85
- qthelp:
86
- $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
87
- @echo
88
- @echo "Build finished; now you can run "qcollectiongenerator" with the" \
89
- ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
90
- @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/pybind11.qhcp"
91
- @echo "To view the help file:"
92
- @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/pybind11.qhc"
93
-
94
- applehelp:
95
- $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
96
- @echo
97
- @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
98
- @echo "N.B. You won't be able to view it unless you put it in" \
99
- "~/Library/Documentation/Help or install it in your application" \
100
- "bundle."
101
-
102
- devhelp:
103
- $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
104
- @echo
105
- @echo "Build finished."
106
- @echo "To view the help file:"
107
- @echo "# mkdir -p $$HOME/.local/share/devhelp/pybind11"
108
- @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pybind11"
109
- @echo "# devhelp"
110
-
111
- epub:
112
- $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
113
- @echo
114
- @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
115
-
116
- latex:
117
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
118
- @echo
119
- @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
120
- @echo "Run \`make' in that directory to run these through (pdf)latex" \
121
- "(use \`make latexpdf' here to do that automatically)."
122
-
123
- latexpdf:
124
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
125
- @echo "Running LaTeX files through pdflatex..."
126
- $(MAKE) -C $(BUILDDIR)/latex all-pdf
127
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
128
-
129
- latexpdfja:
130
- $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
131
- @echo "Running LaTeX files through platex and dvipdfmx..."
132
- $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
133
- @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
134
-
135
- text:
136
- $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
137
- @echo
138
- @echo "Build finished. The text files are in $(BUILDDIR)/text."
139
-
140
- man:
141
- $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
142
- @echo
143
- @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
144
-
145
- texinfo:
146
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
147
- @echo
148
- @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
149
- @echo "Run \`make' in that directory to run these through makeinfo" \
150
- "(use \`make info' here to do that automatically)."
151
-
152
- info:
153
- $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
154
- @echo "Running Texinfo files through makeinfo..."
155
- make -C $(BUILDDIR)/texinfo info
156
- @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
157
-
158
- gettext:
159
- $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
160
- @echo
161
- @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
162
-
163
- changes:
164
- $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
165
- @echo
166
- @echo "The overview file is in $(BUILDDIR)/changes."
167
-
168
- linkcheck:
169
- $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
170
- @echo
171
- @echo "Link check complete; look for any errors in the above output " \
172
- "or in $(BUILDDIR)/linkcheck/output.txt."
173
-
174
- doctest:
175
- $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
176
- @echo "Testing of doctests in the sources finished, look at the " \
177
- "results in $(BUILDDIR)/doctest/output.txt."
178
-
179
- coverage:
180
- $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
181
- @echo "Testing of coverage in the sources finished, look at the " \
182
- "results in $(BUILDDIR)/coverage/python.txt."
183
-
184
- xml:
185
- $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
186
- @echo
187
- @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
188
-
189
- pseudoxml:
190
- $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
191
- @echo
192
- @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
@@ -1,11 +0,0 @@
1
- .wy-table-responsive table td,
2
- .wy-table-responsive table th {
3
- white-space: initial !important;
4
- }
5
- .rst-content table.docutils td {
6
- vertical-align: top !important;
7
- }
8
- div[class^='highlight'] pre {
9
- white-space: pre;
10
- white-space: pre-wrap;
11
- }
@@ -1,81 +0,0 @@
1
- Chrono
2
- ======
3
-
4
- When including the additional header file :file:`pybind11/chrono.h` conversions
5
- from C++11 chrono datatypes to python datetime objects are automatically enabled.
6
- This header also enables conversions of python floats (often from sources such
7
- as ``time.monotonic()``, ``time.perf_counter()`` and ``time.process_time()``)
8
- into durations.
9
-
10
- An overview of clocks in C++11
11
- ------------------------------
12
-
13
- A point of confusion when using these conversions is the differences between
14
- clocks provided in C++11. There are three clock types defined by the C++11
15
- standard and users can define their own if needed. Each of these clocks have
16
- different properties and when converting to and from python will give different
17
- results.
18
-
19
- The first clock defined by the standard is ``std::chrono::system_clock``. This
20
- clock measures the current date and time. However, this clock changes with to
21
- updates to the operating system time. For example, if your time is synchronised
22
- with a time server this clock will change. This makes this clock a poor choice
23
- for timing purposes but good for measuring the wall time.
24
-
25
- The second clock defined in the standard is ``std::chrono::steady_clock``.
26
- This clock ticks at a steady rate and is never adjusted. This makes it excellent
27
- for timing purposes, however the value in this clock does not correspond to the
28
- current date and time. Often this clock will be the amount of time your system
29
- has been on, although it does not have to be. This clock will never be the same
30
- clock as the system clock as the system clock can change but steady clocks
31
- cannot.
32
-
33
- The third clock defined in the standard is ``std::chrono::high_resolution_clock``.
34
- This clock is the clock that has the highest resolution out of the clocks in the
35
- system. It is normally a typedef to either the system clock or the steady clock
36
- but can be its own independent clock. This is important as when using these
37
- conversions as the types you get in python for this clock might be different
38
- depending on the system.
39
- If it is a typedef of the system clock, python will get datetime objects, but if
40
- it is a different clock they will be timedelta objects.
41
-
42
- Provided conversions
43
- --------------------
44
-
45
- .. rubric:: C++ to Python
46
-
47
- - ``std::chrono::system_clock::time_point`` → ``datetime.datetime``
48
- System clock times are converted to python datetime instances. They are
49
- in the local timezone, but do not have any timezone information attached
50
- to them (they are naive datetime objects).
51
-
52
- - ``std::chrono::duration`` → ``datetime.timedelta``
53
- Durations are converted to timedeltas, any precision in the duration
54
- greater than microseconds is lost by rounding towards zero.
55
-
56
- - ``std::chrono::[other_clocks]::time_point`` → ``datetime.timedelta``
57
- Any clock time that is not the system clock is converted to a time delta.
58
- This timedelta measures the time from the clocks epoch to now.
59
-
60
- .. rubric:: Python to C++
61
-
62
- - ``datetime.datetime`` or ``datetime.date`` or ``datetime.time`` → ``std::chrono::system_clock::time_point``
63
- Date/time objects are converted into system clock timepoints. Any
64
- timezone information is ignored and the type is treated as a naive
65
- object.
66
-
67
- - ``datetime.timedelta`` → ``std::chrono::duration``
68
- Time delta are converted into durations with microsecond precision.
69
-
70
- - ``datetime.timedelta`` → ``std::chrono::[other_clocks]::time_point``
71
- Time deltas that are converted into clock timepoints are treated as
72
- the amount of time from the start of the clocks epoch.
73
-
74
- - ``float`` → ``std::chrono::duration``
75
- Floats that are passed to C++ as durations be interpreted as a number of
76
- seconds. These will be converted to the duration using ``duration_cast``
77
- from the float.
78
-
79
- - ``float`` → ``std::chrono::[other_clocks]::time_point``
80
- Floats that are passed to C++ as time points will be interpreted as the
81
- number of seconds from the start of the clocks epoch.
@@ -1,93 +0,0 @@
1
- Custom type casters
2
- ===================
3
-
4
- In very rare cases, applications may require custom type casters that cannot be
5
- expressed using the abstractions provided by pybind11, thus requiring raw
6
- Python C API calls. This is fairly advanced usage and should only be pursued by
7
- experts who are familiar with the intricacies of Python reference counting.
8
-
9
- The following snippets demonstrate how this works for a very simple ``inty``
10
- type that that should be convertible from Python types that provide a
11
- ``__int__(self)`` method.
12
-
13
- .. code-block:: cpp
14
-
15
- struct inty { long long_value; };
16
-
17
- void print(inty s) {
18
- std::cout << s.long_value << std::endl;
19
- }
20
-
21
- The following Python snippet demonstrates the intended usage from the Python side:
22
-
23
- .. code-block:: python
24
-
25
- class A:
26
- def __int__(self):
27
- return 123
28
-
29
-
30
- from example import print
31
-
32
- print(A())
33
-
34
- To register the necessary conversion routines, it is necessary to add an
35
- instantiation of the ``pybind11::detail::type_caster<T>`` template.
36
- Although this is an implementation detail, adding an instantiation of this
37
- type is explicitly allowed.
38
-
39
- .. code-block:: cpp
40
-
41
- namespace pybind11 { namespace detail {
42
- template <> struct type_caster<inty> {
43
- public:
44
- /**
45
- * This macro establishes the name 'inty' in
46
- * function signatures and declares a local variable
47
- * 'value' of type inty
48
- */
49
- PYBIND11_TYPE_CASTER(inty, _("inty"));
50
-
51
- /**
52
- * Conversion part 1 (Python->C++): convert a PyObject into a inty
53
- * instance or return false upon failure. The second argument
54
- * indicates whether implicit conversions should be applied.
55
- */
56
- bool load(handle src, bool) {
57
- /* Extract PyObject from handle */
58
- PyObject *source = src.ptr();
59
- /* Try converting into a Python integer value */
60
- PyObject *tmp = PyNumber_Long(source);
61
- if (!tmp)
62
- return false;
63
- /* Now try to convert into a C++ int */
64
- value.long_value = PyLong_AsLong(tmp);
65
- Py_DECREF(tmp);
66
- /* Ensure return code was OK (to avoid out-of-range errors etc) */
67
- return !(value.long_value == -1 && !PyErr_Occurred());
68
- }
69
-
70
- /**
71
- * Conversion part 2 (C++ -> Python): convert an inty instance into
72
- * a Python object. The second and third arguments are used to
73
- * indicate the return value policy and parent object (for
74
- * ``return_value_policy::reference_internal``) and are generally
75
- * ignored by implicit casters.
76
- */
77
- static handle cast(inty src, return_value_policy /* policy */, handle /* parent */) {
78
- return PyLong_FromLong(src.long_value);
79
- }
80
- };
81
- }} // namespace pybind11::detail
82
-
83
- .. note::
84
-
85
- A ``type_caster<T>`` defined with ``PYBIND11_TYPE_CASTER(T, ...)`` requires
86
- that ``T`` is default-constructible (``value`` is first default constructed
87
- and then ``load()`` assigns to it).
88
-
89
- .. warning::
90
-
91
- When using custom type casters, it's important to declare them consistently
92
- in every compilation unit of the Python extension module. Otherwise,
93
- undefined behavior can ensue.
@@ -1,310 +0,0 @@
1
- Eigen
2
- #####
3
-
4
- `Eigen <http://eigen.tuxfamily.org>`_ is C++ header-based library for dense and
5
- sparse linear algebra. Due to its popularity and widespread adoption, pybind11
6
- provides transparent conversion and limited mapping support between Eigen and
7
- Scientific Python linear algebra data types.
8
-
9
- To enable the built-in Eigen support you must include the optional header file
10
- :file:`pybind11/eigen.h`.
11
-
12
- Pass-by-value
13
- =============
14
-
15
- When binding a function with ordinary Eigen dense object arguments (for
16
- example, ``Eigen::MatrixXd``), pybind11 will accept any input value that is
17
- already (or convertible to) a ``numpy.ndarray`` with dimensions compatible with
18
- the Eigen type, copy its values into a temporary Eigen variable of the
19
- appropriate type, then call the function with this temporary variable.
20
-
21
- Sparse matrices are similarly copied to or from
22
- ``scipy.sparse.csr_matrix``/``scipy.sparse.csc_matrix`` objects.
23
-
24
- Pass-by-reference
25
- =================
26
-
27
- One major limitation of the above is that every data conversion implicitly
28
- involves a copy, which can be both expensive (for large matrices) and disallows
29
- binding functions that change their (Matrix) arguments. Pybind11 allows you to
30
- work around this by using Eigen's ``Eigen::Ref<MatrixType>`` class much as you
31
- would when writing a function taking a generic type in Eigen itself (subject to
32
- some limitations discussed below).
33
-
34
- When calling a bound function accepting a ``Eigen::Ref<const MatrixType>``
35
- type, pybind11 will attempt to avoid copying by using an ``Eigen::Map`` object
36
- that maps into the source ``numpy.ndarray`` data: this requires both that the
37
- data types are the same (e.g. ``dtype='float64'`` and ``MatrixType::Scalar`` is
38
- ``double``); and that the storage is layout compatible. The latter limitation
39
- is discussed in detail in the section below, and requires careful
40
- consideration: by default, numpy matrices and Eigen matrices are *not* storage
41
- compatible.
42
-
43
- If the numpy matrix cannot be used as is (either because its types differ, e.g.
44
- passing an array of integers to an Eigen parameter requiring doubles, or
45
- because the storage is incompatible), pybind11 makes a temporary copy and
46
- passes the copy instead.
47
-
48
- When a bound function parameter is instead ``Eigen::Ref<MatrixType>`` (note the
49
- lack of ``const``), pybind11 will only allow the function to be called if it
50
- can be mapped *and* if the numpy array is writeable (that is
51
- ``a.flags.writeable`` is true). Any access (including modification) made to
52
- the passed variable will be transparently carried out directly on the
53
- ``numpy.ndarray``.
54
-
55
- This means you can can write code such as the following and have it work as
56
- expected:
57
-
58
- .. code-block:: cpp
59
-
60
- void scale_by_2(Eigen::Ref<Eigen::VectorXd> v) {
61
- v *= 2;
62
- }
63
-
64
- Note, however, that you will likely run into limitations due to numpy and
65
- Eigen's difference default storage order for data; see the below section on
66
- :ref:`storage_orders` for details on how to bind code that won't run into such
67
- limitations.
68
-
69
- .. note::
70
-
71
- Passing by reference is not supported for sparse types.
72
-
73
- Returning values to Python
74
- ==========================
75
-
76
- When returning an ordinary dense Eigen matrix type to numpy (e.g.
77
- ``Eigen::MatrixXd`` or ``Eigen::RowVectorXf``) pybind11 keeps the matrix and
78
- returns a numpy array that directly references the Eigen matrix: no copy of the
79
- data is performed. The numpy array will have ``array.flags.owndata`` set to
80
- ``False`` to indicate that it does not own the data, and the lifetime of the
81
- stored Eigen matrix will be tied to the returned ``array``.
82
-
83
- If you bind a function with a non-reference, ``const`` return type (e.g.
84
- ``const Eigen::MatrixXd``), the same thing happens except that pybind11 also
85
- sets the numpy array's ``writeable`` flag to false.
86
-
87
- If you return an lvalue reference or pointer, the usual pybind11 rules apply,
88
- as dictated by the binding function's return value policy (see the
89
- documentation on :ref:`return_value_policies` for full details). That means,
90
- without an explicit return value policy, lvalue references will be copied and
91
- pointers will be managed by pybind11. In order to avoid copying, you should
92
- explicitly specify an appropriate return value policy, as in the following
93
- example:
94
-
95
- .. code-block:: cpp
96
-
97
- class MyClass {
98
- Eigen::MatrixXd big_mat = Eigen::MatrixXd::Zero(10000, 10000);
99
- public:
100
- Eigen::MatrixXd &getMatrix() { return big_mat; }
101
- const Eigen::MatrixXd &viewMatrix() { return big_mat; }
102
- };
103
-
104
- // Later, in binding code:
105
- py::class_<MyClass>(m, "MyClass")
106
- .def(py::init<>())
107
- .def("copy_matrix", &MyClass::getMatrix) // Makes a copy!
108
- .def("get_matrix", &MyClass::getMatrix, py::return_value_policy::reference_internal)
109
- .def("view_matrix", &MyClass::viewMatrix, py::return_value_policy::reference_internal)
110
- ;
111
-
112
- .. code-block:: python
113
-
114
- a = MyClass()
115
- m = a.get_matrix() # flags.writeable = True, flags.owndata = False
116
- v = a.view_matrix() # flags.writeable = False, flags.owndata = False
117
- c = a.copy_matrix() # flags.writeable = True, flags.owndata = True
118
- # m[5,6] and v[5,6] refer to the same element, c[5,6] does not.
119
-
120
- Note in this example that ``py::return_value_policy::reference_internal`` is
121
- used to tie the life of the MyClass object to the life of the returned arrays.
122
-
123
- You may also return an ``Eigen::Ref``, ``Eigen::Map`` or other map-like Eigen
124
- object (for example, the return value of ``matrix.block()`` and related
125
- methods) that map into a dense Eigen type. When doing so, the default
126
- behaviour of pybind11 is to simply reference the returned data: you must take
127
- care to ensure that this data remains valid! You may ask pybind11 to
128
- explicitly *copy* such a return value by using the
129
- ``py::return_value_policy::copy`` policy when binding the function. You may
130
- also use ``py::return_value_policy::reference_internal`` or a
131
- ``py::keep_alive`` to ensure the data stays valid as long as the returned numpy
132
- array does.
133
-
134
- When returning such a reference of map, pybind11 additionally respects the
135
- readonly-status of the returned value, marking the numpy array as non-writeable
136
- if the reference or map was itself read-only.
137
-
138
- .. note::
139
-
140
- Sparse types are always copied when returned.
141
-
142
- .. _storage_orders:
143
-
144
- Storage orders
145
- ==============
146
-
147
- Passing arguments via ``Eigen::Ref`` has some limitations that you must be
148
- aware of in order to effectively pass matrices by reference. First and
149
- foremost is that the default ``Eigen::Ref<MatrixType>`` class requires
150
- contiguous storage along columns (for column-major types, the default in Eigen)
151
- or rows if ``MatrixType`` is specifically an ``Eigen::RowMajor`` storage type.
152
- The former, Eigen's default, is incompatible with ``numpy``'s default row-major
153
- storage, and so you will not be able to pass numpy arrays to Eigen by reference
154
- without making one of two changes.
155
-
156
- (Note that this does not apply to vectors (or column or row matrices): for such
157
- types the "row-major" and "column-major" distinction is meaningless).
158
-
159
- The first approach is to change the use of ``Eigen::Ref<MatrixType>`` to the
160
- more general ``Eigen::Ref<MatrixType, 0, Eigen::Stride<Eigen::Dynamic,
161
- Eigen::Dynamic>>`` (or similar type with a fully dynamic stride type in the
162
- third template argument). Since this is a rather cumbersome type, pybind11
163
- provides a ``py::EigenDRef<MatrixType>`` type alias for your convenience (along
164
- with EigenDMap for the equivalent Map, and EigenDStride for just the stride
165
- type).
166
-
167
- This type allows Eigen to map into any arbitrary storage order. This is not
168
- the default in Eigen for performance reasons: contiguous storage allows
169
- vectorization that cannot be done when storage is not known to be contiguous at
170
- compile time. The default ``Eigen::Ref`` stride type allows non-contiguous
171
- storage along the outer dimension (that is, the rows of a column-major matrix
172
- or columns of a row-major matrix), but not along the inner dimension.
173
-
174
- This type, however, has the added benefit of also being able to map numpy array
175
- slices. For example, the following (contrived) example uses Eigen with a numpy
176
- slice to multiply by 2 all coefficients that are both on even rows (0, 2, 4,
177
- ...) and in columns 2, 5, or 8:
178
-
179
- .. code-block:: cpp
180
-
181
- m.def("scale", [](py::EigenDRef<Eigen::MatrixXd> m, double c) { m *= c; });
182
-
183
- .. code-block:: python
184
-
185
- # a = np.array(...)
186
- scale_by_2(myarray[0::2, 2:9:3])
187
-
188
- The second approach to avoid copying is more intrusive: rearranging the
189
- underlying data types to not run into the non-contiguous storage problem in the
190
- first place. In particular, that means using matrices with ``Eigen::RowMajor``
191
- storage, where appropriate, such as:
192
-
193
- .. code-block:: cpp
194
-
195
- using RowMatrixXd = Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
196
- // Use RowMatrixXd instead of MatrixXd
197
-
198
- Now bound functions accepting ``Eigen::Ref<RowMatrixXd>`` arguments will be
199
- callable with numpy's (default) arrays without involving a copying.
200
-
201
- You can, alternatively, change the storage order that numpy arrays use by
202
- adding the ``order='F'`` option when creating an array:
203
-
204
- .. code-block:: python
205
-
206
- myarray = np.array(source, order="F")
207
-
208
- Such an object will be passable to a bound function accepting an
209
- ``Eigen::Ref<MatrixXd>`` (or similar column-major Eigen type).
210
-
211
- One major caveat with this approach, however, is that it is not entirely as
212
- easy as simply flipping all Eigen or numpy usage from one to the other: some
213
- operations may alter the storage order of a numpy array. For example, ``a2 =
214
- array.transpose()`` results in ``a2`` being a view of ``array`` that references
215
- the same data, but in the opposite storage order!
216
-
217
- While this approach allows fully optimized vectorized calculations in Eigen, it
218
- cannot be used with array slices, unlike the first approach.
219
-
220
- When *returning* a matrix to Python (either a regular matrix, a reference via
221
- ``Eigen::Ref<>``, or a map/block into a matrix), no special storage
222
- consideration is required: the created numpy array will have the required
223
- stride that allows numpy to properly interpret the array, whatever its storage
224
- order.
225
-
226
- Failing rather than copying
227
- ===========================
228
-
229
- The default behaviour when binding ``Eigen::Ref<const MatrixType>`` Eigen
230
- references is to copy matrix values when passed a numpy array that does not
231
- conform to the element type of ``MatrixType`` or does not have a compatible
232
- stride layout. If you want to explicitly avoid copying in such a case, you
233
- should bind arguments using the ``py::arg().noconvert()`` annotation (as
234
- described in the :ref:`nonconverting_arguments` documentation).
235
-
236
- The following example shows an example of arguments that don't allow data
237
- copying to take place:
238
-
239
- .. code-block:: cpp
240
-
241
- // The method and function to be bound:
242
- class MyClass {
243
- // ...
244
- double some_method(const Eigen::Ref<const MatrixXd> &matrix) { /* ... */ }
245
- };
246
- float some_function(const Eigen::Ref<const MatrixXf> &big,
247
- const Eigen::Ref<const MatrixXf> &small) {
248
- // ...
249
- }
250
-
251
- // The associated binding code:
252
- using namespace pybind11::literals; // for "arg"_a
253
- py::class_<MyClass>(m, "MyClass")
254
- // ... other class definitions
255
- .def("some_method", &MyClass::some_method, py::arg().noconvert());
256
-
257
- m.def("some_function", &some_function,
258
- "big"_a.noconvert(), // <- Don't allow copying for this arg
259
- "small"_a // <- This one can be copied if needed
260
- );
261
-
262
- With the above binding code, attempting to call the the ``some_method(m)``
263
- method on a ``MyClass`` object, or attempting to call ``some_function(m, m2)``
264
- will raise a ``RuntimeError`` rather than making a temporary copy of the array.
265
- It will, however, allow the ``m2`` argument to be copied into a temporary if
266
- necessary.
267
-
268
- Note that explicitly specifying ``.noconvert()`` is not required for *mutable*
269
- Eigen references (e.g. ``Eigen::Ref<MatrixXd>`` without ``const`` on the
270
- ``MatrixXd``): mutable references will never be called with a temporary copy.
271
-
272
- Vectors versus column/row matrices
273
- ==================================
274
-
275
- Eigen and numpy have fundamentally different notions of a vector. In Eigen, a
276
- vector is simply a matrix with the number of columns or rows set to 1 at
277
- compile time (for a column vector or row vector, respectively). NumPy, in
278
- contrast, has comparable 2-dimensional 1xN and Nx1 arrays, but *also* has
279
- 1-dimensional arrays of size N.
280
-
281
- When passing a 2-dimensional 1xN or Nx1 array to Eigen, the Eigen type must
282
- have matching dimensions: That is, you cannot pass a 2-dimensional Nx1 numpy
283
- array to an Eigen value expecting a row vector, or a 1xN numpy array as a
284
- column vector argument.
285
-
286
- On the other hand, pybind11 allows you to pass 1-dimensional arrays of length N
287
- as Eigen parameters. If the Eigen type can hold a column vector of length N it
288
- will be passed as such a column vector. If not, but the Eigen type constraints
289
- will accept a row vector, it will be passed as a row vector. (The column
290
- vector takes precedence when both are supported, for example, when passing a
291
- 1D numpy array to a MatrixXd argument). Note that the type need not be
292
- explicitly a vector: it is permitted to pass a 1D numpy array of size 5 to an
293
- Eigen ``Matrix<double, Dynamic, 5>``: you would end up with a 1x5 Eigen matrix.
294
- Passing the same to an ``Eigen::MatrixXd`` would result in a 5x1 Eigen matrix.
295
-
296
- When returning an Eigen vector to numpy, the conversion is ambiguous: a row
297
- vector of length 4 could be returned as either a 1D array of length 4, or as a
298
- 2D array of size 1x4. When encountering such a situation, pybind11 compromises
299
- by considering the returned Eigen type: if it is a compile-time vector--that
300
- is, the type has either the number of rows or columns set to 1 at compile
301
- time--pybind11 converts to a 1D numpy array when returning the value. For
302
- instances that are a vector only at run-time (e.g. ``MatrixXd``,
303
- ``Matrix<float, Dynamic, 4>``), pybind11 returns the vector as a 2D array to
304
- numpy. If this isn't want you want, you can use ``array.reshape(...)`` to get
305
- a view of the same data in the desired dimensions.
306
-
307
- .. seealso::
308
-
309
- The file :file:`tests/test_eigen.cpp` contains a complete example that
310
- shows how to pass Eigen sparse and dense data types in more detail.