xcoll 0.5.12__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/__init__.py +5 -18
- xcoll/__init__.py.orig +26 -0
- xcoll/beam_elements/__init__.py +1 -0
- xcoll/beam_elements/absorber.py +12 -2
- xcoll/beam_elements/base.py +162 -62
- xcoll/beam_elements/blowup.py +1 -0
- xcoll/beam_elements/elements_src/black_absorber.h +57 -58
- xcoll/beam_elements/elements_src/black_crystal.h +49 -50
- xcoll/beam_elements/elements_src/everest_block.h +21 -11
- xcoll/beam_elements/elements_src/everest_collimator.h +100 -91
- xcoll/beam_elements/elements_src/everest_crystal.h +145 -140
- xcoll/beam_elements/elements_src/transparent_collimator.h +126 -0
- xcoll/beam_elements/elements_src/transparent_crystal.h +118 -0
- xcoll/beam_elements/everest.py +16 -5
- xcoll/beam_elements/monitor.py +1 -0
- xcoll/beam_elements/transparent.py +83 -0
- xcoll/colldb.py +15 -6
- xcoll/general.py +1 -1
- xcoll/general.py.orig +20 -0
- xcoll/headers/particle_states.py +51 -0
- xcoll/initial_distribution.py +121 -91
- xcoll/initial_distribution.py.orig +256 -0
- xcoll/interaction_record/interaction_record.py +2 -1
- xcoll/interaction_record/interaction_types.py +2 -2
- xcoll/line_tools.py +163 -73
- xcoll/lossmap.py +519 -127
- xcoll/plot.py +109 -0
- xcoll/rf_sweep.py +6 -0
- xcoll/scattering_routines/engine.py +414 -217
- xcoll/scattering_routines/environment.py +297 -0
- xcoll/scattering_routines/everest/amorphous.h +95 -71
- xcoll/scattering_routines/everest/{channeling.h → channelling.h} +121 -112
- xcoll/scattering_routines/everest/constants.h +1 -1
- xcoll/scattering_routines/everest/crystal_parameters.h +9 -9
- xcoll/scattering_routines/everest/everest.h +8 -3
- xcoll/scattering_routines/everest/everest.py +2 -1
- xcoll/scattering_routines/everest/ionisation_loss.h +141 -0
- xcoll/scattering_routines/everest/jaw.h +19 -24
- xcoll/scattering_routines/everest/materials.py +2 -0
- xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
- xcoll/scattering_routines/everest/nuclear_interaction.h +35 -19
- xcoll/scattering_routines/everest/properties.h +3 -72
- xcoll/xaux.py +65 -109
- {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/METADATA +5 -5
- xcoll-0.6.1.dist-info/RECORD +138 -0
- xcoll/_manager.py +0 -22
- xcoll/headers/particle_states.h +0 -25
- xcoll/install.py +0 -35
- xcoll/scattering_routines/geant4/collimasim/.git +0 -1
- xcoll/scattering_routines/geant4/collimasim/.gitignore +0 -12
- xcoll/scattering_routines/geant4/collimasim/.gitmodules +0 -3
- xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +0 -26
- xcoll/scattering_routines/geant4/collimasim/README.md +0 -21
- xcoll/scattering_routines/geant4/collimasim/docs/Makefile +0 -20
- xcoll/scattering_routines/geant4/collimasim/docs/make.bat +0 -35
- xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +0 -10
- xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +0 -59
- xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +0 -26
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +0 -37
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +0 -19
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +0 -65
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +0 -73
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +0 -1
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +0 -9
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +0 -386
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +0 -45
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +0 -8
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +0 -16
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +0 -8
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +0 -3
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +0 -19
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +0 -969
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +0 -84
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +0 -48
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +0 -16
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +0 -103
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +0 -45
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +0 -151
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +0 -3
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +0 -297
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +0 -29
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +0 -6
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +0 -180
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +0 -23
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +0 -192
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +0 -11
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +0 -81
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +0 -93
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +0 -310
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +0 -109
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +0 -43
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +0 -171
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +0 -251
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +0 -305
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +0 -1297
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +0 -262
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +0 -396
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +0 -568
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +0 -337
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +0 -13
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +0 -463
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +0 -286
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +0 -155
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +0 -174
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +0 -308
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +0 -91
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +0 -95
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +0 -2050
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +0 -542
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +0 -8
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +0 -648
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +0 -381
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +0 -343
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +0 -48
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +0 -105
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +0 -72
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11-logo.png +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.png +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python1.svg +0 -427
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.png +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/pybind11_vs_boost_python2.svg +0 -427
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +0 -130
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +0 -96
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +0 -8
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +0 -548
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +0 -605
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +0 -144
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +0 -1432
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +0 -213
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +0 -2
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +0 -65
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +0 -709
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +0 -1021
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +0 -104
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +0 -346
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +0 -467
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +0 -978
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +0 -55
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +0 -606
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +0 -284
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +0 -163
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +0 -121
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +0 -193
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +0 -275
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +0 -1741
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +0 -163
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +0 -65
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +0 -2497
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +0 -1879
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +0 -103
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +0 -375
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +0 -747
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +0 -88
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +0 -11
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +0 -52
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +0 -12
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +0 -6
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +0 -21
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +0 -482
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +0 -63
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +0 -41
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +0 -56
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +0 -155
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +0 -503
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +0 -208
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +0 -275
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +0 -73
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +0 -33
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/pytest.ini +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_python_package/test_files.py +0 -279
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/pytest.ini +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/extra_setuptools/test_setuphelper.py +0 -143
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +0 -85
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +0 -179
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +0 -151
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +0 -91
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +0 -85
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +0 -19
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +0 -12
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +0 -26
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +0 -25
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +0 -216
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +0 -163
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +0 -286
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +0 -536
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +0 -107
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +0 -248
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +0 -227
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +0 -202
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +0 -84
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +0 -210
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +0 -550
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +0 -473
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +0 -84
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +0 -21
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +0 -28
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +0 -39
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +0 -46
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +0 -6
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +0 -41
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +0 -35
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +0 -41
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +0 -10
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +0 -165
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +0 -53
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +0 -238
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +0 -126
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +0 -141
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +0 -117
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +0 -41
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +0 -50
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +0 -69
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +0 -42
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +0 -348
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +0 -771
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +0 -47
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +0 -22
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +0 -23
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +0 -326
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +0 -15
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +0 -148
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +0 -272
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +0 -119
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +0 -51
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +0 -5
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +0 -285
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +0 -12
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +0 -265
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +0 -397
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +0 -520
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +0 -49
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +0 -94
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +0 -125
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +0 -331
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +0 -153
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +0 -284
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +0 -107
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +0 -257
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +0 -412
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +0 -517
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +0 -102
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +0 -92
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +0 -233
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +0 -360
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +0 -472
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +0 -593
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +0 -524
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +0 -441
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +0 -103
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +0 -267
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +0 -73
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +0 -59
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +0 -235
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +0 -146
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +0 -189
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +0 -82
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +0 -560
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +0 -651
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +0 -500
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +0 -253
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +0 -452
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +0 -318
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +0 -342
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +0 -291
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +0 -131
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +0 -318
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +0 -144
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +0 -29
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +0 -66
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +0 -44
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +0 -22
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +0 -9
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +0 -510
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +0 -408
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +0 -140
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +0 -117
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +0 -70
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +0 -86
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +0 -257
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +0 -44
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +0 -23
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +0 -39
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +0 -64
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +0 -402
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +0 -233
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +0 -276
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +0 -214
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +0 -3
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +0 -65
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +0 -41
- xcoll/scattering_routines/geant4/collimasim/pyproject.toml +0 -8
- xcoll/scattering_routines/geant4/collimasim/setup.py +0 -144
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +0 -403
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +0 -100
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +0 -763
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +0 -118
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +0 -8
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +0 -63
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +0 -142
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +0 -556
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +0 -6
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +0 -24
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +0 -1
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +0 -1
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +0 -1
- xcoll/scattering_routines/geant4/collimasim/tests/README.md +0 -25
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +0 -25
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +0 -18
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +0 -68
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +0 -15
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +0 -110
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +0 -7
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +0 -3
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +0 -54
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +0 -3
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +0 -3
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +0 -5
- xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +0 -51
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +0 -65
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +0 -59
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +0 -102
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +0 -75
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +0 -74
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +0 -84
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +0 -159
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +0 -99
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +0 -78
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +0 -88
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +0 -80
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +0 -97
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +0 -96
- xcoll-0.5.12.dist-info/RECORD +0 -415
- {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/LICENSE +0 -0
- {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/NOTICE +0 -0
- {xcoll-0.5.12.dist-info → xcoll-0.6.1.dist-info}/WHEEL +0 -0
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
pybind11/chrono.h: Transparent conversion between std::chrono and python's datetime
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2016 Trent Houliston <trent@houliston.me> and
|
|
5
|
-
Wenzel Jakob <wenzel.jakob@epfl.ch>
|
|
6
|
-
|
|
7
|
-
All rights reserved. Use of this source code is governed by a
|
|
8
|
-
BSD-style license that can be found in the LICENSE file.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
#pragma once
|
|
12
|
-
|
|
13
|
-
#include "pybind11.h"
|
|
14
|
-
|
|
15
|
-
#include <chrono>
|
|
16
|
-
#include <cmath>
|
|
17
|
-
#include <ctime>
|
|
18
|
-
#include <mutex>
|
|
19
|
-
|
|
20
|
-
#include <time.h>
|
|
21
|
-
|
|
22
|
-
#include <datetime.h>
|
|
23
|
-
|
|
24
|
-
// Backport the PyDateTime_DELTA functions from Python3.3 if required
|
|
25
|
-
#ifndef PyDateTime_DELTA_GET_DAYS
|
|
26
|
-
#define PyDateTime_DELTA_GET_DAYS(o) (((PyDateTime_Delta*)o)->days)
|
|
27
|
-
#endif
|
|
28
|
-
#ifndef PyDateTime_DELTA_GET_SECONDS
|
|
29
|
-
#define PyDateTime_DELTA_GET_SECONDS(o) (((PyDateTime_Delta*)o)->seconds)
|
|
30
|
-
#endif
|
|
31
|
-
#ifndef PyDateTime_DELTA_GET_MICROSECONDS
|
|
32
|
-
#define PyDateTime_DELTA_GET_MICROSECONDS(o) (((PyDateTime_Delta*)o)->microseconds)
|
|
33
|
-
#endif
|
|
34
|
-
|
|
35
|
-
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
|
|
36
|
-
PYBIND11_NAMESPACE_BEGIN(detail)
|
|
37
|
-
|
|
38
|
-
template <typename type> class duration_caster {
|
|
39
|
-
public:
|
|
40
|
-
using rep = typename type::rep;
|
|
41
|
-
using period = typename type::period;
|
|
42
|
-
|
|
43
|
-
using days = std::chrono::duration<int_least32_t, std::ratio<86400>>; // signed 25 bits required by the standard.
|
|
44
|
-
|
|
45
|
-
bool load(handle src, bool) {
|
|
46
|
-
using namespace std::chrono;
|
|
47
|
-
|
|
48
|
-
// Lazy initialise the PyDateTime import
|
|
49
|
-
if (!PyDateTimeAPI) { PyDateTime_IMPORT; }
|
|
50
|
-
|
|
51
|
-
if (!src) return false;
|
|
52
|
-
// If invoked with datetime.delta object
|
|
53
|
-
if (PyDelta_Check(src.ptr())) {
|
|
54
|
-
value = type(duration_cast<duration<rep, period>>(
|
|
55
|
-
days(PyDateTime_DELTA_GET_DAYS(src.ptr()))
|
|
56
|
-
+ seconds(PyDateTime_DELTA_GET_SECONDS(src.ptr()))
|
|
57
|
-
+ microseconds(PyDateTime_DELTA_GET_MICROSECONDS(src.ptr()))));
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
// If invoked with a float we assume it is seconds and convert
|
|
61
|
-
if (PyFloat_Check(src.ptr())) {
|
|
62
|
-
value = type(duration_cast<duration<rep, period>>(duration<double>(PyFloat_AsDouble(src.ptr()))));
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// If this is a duration just return it back
|
|
69
|
-
static const std::chrono::duration<rep, period>& get_duration(const std::chrono::duration<rep, period> &src) {
|
|
70
|
-
return src;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// If this is a time_point get the time_since_epoch
|
|
74
|
-
template <typename Clock> static std::chrono::duration<rep, period> get_duration(const std::chrono::time_point<Clock, std::chrono::duration<rep, period>> &src) {
|
|
75
|
-
return src.time_since_epoch();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
static handle cast(const type &src, return_value_policy /* policy */, handle /* parent */) {
|
|
79
|
-
using namespace std::chrono;
|
|
80
|
-
|
|
81
|
-
// Use overloaded function to get our duration from our source
|
|
82
|
-
// Works out if it is a duration or time_point and get the duration
|
|
83
|
-
auto d = get_duration(src);
|
|
84
|
-
|
|
85
|
-
// Lazy initialise the PyDateTime import
|
|
86
|
-
if (!PyDateTimeAPI) { PyDateTime_IMPORT; }
|
|
87
|
-
|
|
88
|
-
// Declare these special duration types so the conversions happen with the correct primitive types (int)
|
|
89
|
-
using dd_t = duration<int, std::ratio<86400>>;
|
|
90
|
-
using ss_t = duration<int, std::ratio<1>>;
|
|
91
|
-
using us_t = duration<int, std::micro>;
|
|
92
|
-
|
|
93
|
-
auto dd = duration_cast<dd_t>(d);
|
|
94
|
-
auto subd = d - dd;
|
|
95
|
-
auto ss = duration_cast<ss_t>(subd);
|
|
96
|
-
auto us = duration_cast<us_t>(subd - ss);
|
|
97
|
-
return PyDelta_FromDSU(dd.count(), ss.count(), us.count());
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
PYBIND11_TYPE_CASTER(type, _("datetime.timedelta"));
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
inline std::tm *localtime_thread_safe(const std::time_t *time, std::tm *buf) {
|
|
104
|
-
#if (defined(__STDC_LIB_EXT1__) && defined(__STDC_WANT_LIB_EXT1__)) || defined(_MSC_VER)
|
|
105
|
-
if (localtime_s(buf, time))
|
|
106
|
-
return nullptr;
|
|
107
|
-
return buf;
|
|
108
|
-
#else
|
|
109
|
-
static std::mutex mtx;
|
|
110
|
-
std::lock_guard<std::mutex> lock(mtx);
|
|
111
|
-
std::tm *tm_ptr = localtime(time);
|
|
112
|
-
if (tm_ptr != nullptr) {
|
|
113
|
-
*buf = *tm_ptr;
|
|
114
|
-
}
|
|
115
|
-
return tm_ptr;
|
|
116
|
-
#endif
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// This is for casting times on the system clock into datetime.datetime instances
|
|
120
|
-
template <typename Duration> class type_caster<std::chrono::time_point<std::chrono::system_clock, Duration>> {
|
|
121
|
-
public:
|
|
122
|
-
using type = std::chrono::time_point<std::chrono::system_clock, Duration>;
|
|
123
|
-
bool load(handle src, bool) {
|
|
124
|
-
using namespace std::chrono;
|
|
125
|
-
|
|
126
|
-
// Lazy initialise the PyDateTime import
|
|
127
|
-
if (!PyDateTimeAPI) { PyDateTime_IMPORT; }
|
|
128
|
-
|
|
129
|
-
if (!src) return false;
|
|
130
|
-
|
|
131
|
-
std::tm cal;
|
|
132
|
-
microseconds msecs;
|
|
133
|
-
|
|
134
|
-
if (PyDateTime_Check(src.ptr())) {
|
|
135
|
-
cal.tm_sec = PyDateTime_DATE_GET_SECOND(src.ptr());
|
|
136
|
-
cal.tm_min = PyDateTime_DATE_GET_MINUTE(src.ptr());
|
|
137
|
-
cal.tm_hour = PyDateTime_DATE_GET_HOUR(src.ptr());
|
|
138
|
-
cal.tm_mday = PyDateTime_GET_DAY(src.ptr());
|
|
139
|
-
cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1;
|
|
140
|
-
cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900;
|
|
141
|
-
cal.tm_isdst = -1;
|
|
142
|
-
msecs = microseconds(PyDateTime_DATE_GET_MICROSECOND(src.ptr()));
|
|
143
|
-
} else if (PyDate_Check(src.ptr())) {
|
|
144
|
-
cal.tm_sec = 0;
|
|
145
|
-
cal.tm_min = 0;
|
|
146
|
-
cal.tm_hour = 0;
|
|
147
|
-
cal.tm_mday = PyDateTime_GET_DAY(src.ptr());
|
|
148
|
-
cal.tm_mon = PyDateTime_GET_MONTH(src.ptr()) - 1;
|
|
149
|
-
cal.tm_year = PyDateTime_GET_YEAR(src.ptr()) - 1900;
|
|
150
|
-
cal.tm_isdst = -1;
|
|
151
|
-
msecs = microseconds(0);
|
|
152
|
-
} else if (PyTime_Check(src.ptr())) {
|
|
153
|
-
cal.tm_sec = PyDateTime_TIME_GET_SECOND(src.ptr());
|
|
154
|
-
cal.tm_min = PyDateTime_TIME_GET_MINUTE(src.ptr());
|
|
155
|
-
cal.tm_hour = PyDateTime_TIME_GET_HOUR(src.ptr());
|
|
156
|
-
cal.tm_mday = 1; // This date (day, month, year) = (1, 0, 70)
|
|
157
|
-
cal.tm_mon = 0; // represents 1-Jan-1970, which is the first
|
|
158
|
-
cal.tm_year = 70; // earliest available date for Python's datetime
|
|
159
|
-
cal.tm_isdst = -1;
|
|
160
|
-
msecs = microseconds(PyDateTime_TIME_GET_MICROSECOND(src.ptr()));
|
|
161
|
-
}
|
|
162
|
-
else return false;
|
|
163
|
-
|
|
164
|
-
value = time_point_cast<Duration>(system_clock::from_time_t(std::mktime(&cal)) + msecs);
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
static handle cast(const std::chrono::time_point<std::chrono::system_clock, Duration> &src, return_value_policy /* policy */, handle /* parent */) {
|
|
169
|
-
using namespace std::chrono;
|
|
170
|
-
|
|
171
|
-
// Lazy initialise the PyDateTime import
|
|
172
|
-
if (!PyDateTimeAPI) { PyDateTime_IMPORT; }
|
|
173
|
-
|
|
174
|
-
// Get out microseconds, and make sure they are positive, to avoid bug in eastern hemisphere time zones
|
|
175
|
-
// (cfr. https://github.com/pybind/pybind11/issues/2417)
|
|
176
|
-
using us_t = duration<int, std::micro>;
|
|
177
|
-
auto us = duration_cast<us_t>(src.time_since_epoch() % seconds(1));
|
|
178
|
-
if (us.count() < 0)
|
|
179
|
-
us += seconds(1);
|
|
180
|
-
|
|
181
|
-
// Subtract microseconds BEFORE `system_clock::to_time_t`, because:
|
|
182
|
-
// > If std::time_t has lower precision, it is implementation-defined whether the value is rounded or truncated.
|
|
183
|
-
// (https://en.cppreference.com/w/cpp/chrono/system_clock/to_time_t)
|
|
184
|
-
std::time_t tt = system_clock::to_time_t(time_point_cast<system_clock::duration>(src - us));
|
|
185
|
-
|
|
186
|
-
std::tm localtime;
|
|
187
|
-
std::tm *localtime_ptr = localtime_thread_safe(&tt, &localtime);
|
|
188
|
-
if (!localtime_ptr)
|
|
189
|
-
throw cast_error("Unable to represent system_clock in local time");
|
|
190
|
-
return PyDateTime_FromDateAndTime(localtime.tm_year + 1900,
|
|
191
|
-
localtime.tm_mon + 1,
|
|
192
|
-
localtime.tm_mday,
|
|
193
|
-
localtime.tm_hour,
|
|
194
|
-
localtime.tm_min,
|
|
195
|
-
localtime.tm_sec,
|
|
196
|
-
us.count());
|
|
197
|
-
}
|
|
198
|
-
PYBIND11_TYPE_CASTER(type, _("datetime.datetime"));
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// Other clocks that are not the system clock are not measured as datetime.datetime objects
|
|
202
|
-
// since they are not measured on calendar time. So instead we just make them timedeltas
|
|
203
|
-
// Or if they have passed us a time as a float we convert that
|
|
204
|
-
template <typename Clock, typename Duration> class type_caster<std::chrono::time_point<Clock, Duration>>
|
|
205
|
-
: public duration_caster<std::chrono::time_point<Clock, Duration>> {
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
template <typename Rep, typename Period> class type_caster<std::chrono::duration<Rep, Period>>
|
|
209
|
-
: public duration_caster<std::chrono::duration<Rep, Period>> {
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
PYBIND11_NAMESPACE_END(detail)
|
|
213
|
-
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
pybind11/complex.h: Complex number support
|
|
3
|
-
|
|
4
|
-
Copyright (c) 2016 Wenzel Jakob <wenzel.jakob@epfl.ch>
|
|
5
|
-
|
|
6
|
-
All rights reserved. Use of this source code is governed by a
|
|
7
|
-
BSD-style license that can be found in the LICENSE file.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
#pragma once
|
|
11
|
-
|
|
12
|
-
#include "pybind11.h"
|
|
13
|
-
#include <complex>
|
|
14
|
-
|
|
15
|
-
/// glibc defines I as a macro which breaks things, e.g., boost template names
|
|
16
|
-
#ifdef I
|
|
17
|
-
# undef I
|
|
18
|
-
#endif
|
|
19
|
-
|
|
20
|
-
PYBIND11_NAMESPACE_BEGIN(PYBIND11_NAMESPACE)
|
|
21
|
-
|
|
22
|
-
template <typename T> struct format_descriptor<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> {
|
|
23
|
-
static constexpr const char c = format_descriptor<T>::c;
|
|
24
|
-
static constexpr const char value[3] = { 'Z', c, '\0' };
|
|
25
|
-
static std::string format() { return std::string(value); }
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
#ifndef PYBIND11_CPP17
|
|
29
|
-
|
|
30
|
-
template <typename T> constexpr const char format_descriptor<
|
|
31
|
-
std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>>::value[3];
|
|
32
|
-
|
|
33
|
-
#endif
|
|
34
|
-
|
|
35
|
-
PYBIND11_NAMESPACE_BEGIN(detail)
|
|
36
|
-
|
|
37
|
-
template <typename T> struct is_fmt_numeric<std::complex<T>, detail::enable_if_t<std::is_floating_point<T>::value>> {
|
|
38
|
-
static constexpr bool value = true;
|
|
39
|
-
static constexpr int index = is_fmt_numeric<T>::index + 3;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
template <typename T> class type_caster<std::complex<T>> {
|
|
43
|
-
public:
|
|
44
|
-
bool load(handle src, bool convert) {
|
|
45
|
-
if (!src)
|
|
46
|
-
return false;
|
|
47
|
-
if (!convert && !PyComplex_Check(src.ptr()))
|
|
48
|
-
return false;
|
|
49
|
-
Py_complex result = PyComplex_AsCComplex(src.ptr());
|
|
50
|
-
if (result.real == -1.0 && PyErr_Occurred()) {
|
|
51
|
-
PyErr_Clear();
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
value = std::complex<T>((T) result.real, (T) result.imag);
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
static handle cast(const std::complex<T> &src, return_value_policy /* policy */, handle /* parent */) {
|
|
59
|
-
return PyComplex_FromDoubles((double) src.real(), (double) src.imag());
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
PYBIND11_TYPE_CASTER(std::complex<T>, _("complex"));
|
|
63
|
-
};
|
|
64
|
-
PYBIND11_NAMESPACE_END(detail)
|
|
65
|
-
PYBIND11_NAMESPACE_END(PYBIND11_NAMESPACE)
|