xcoll 0.4.0__py3-none-any.whl → 0.5.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/__init__.py +2 -1
- xcoll/beam_elements/__init__.py +9 -2
- xcoll/beam_elements/absorber.py +2 -2
- xcoll/beam_elements/base.py +105 -67
- xcoll/beam_elements/blowup.py +198 -0
- xcoll/beam_elements/{collimators_src → elements_src}/black_absorber.h +21 -3
- xcoll/beam_elements/{collimators_src → elements_src}/black_crystal.h +20 -2
- xcoll/beam_elements/elements_src/blowup.h +42 -0
- xcoll/beam_elements/elements_src/emittance_monitor.h +109 -0
- xcoll/beam_elements/{collimators_src → elements_src}/everest_block.h +19 -2
- xcoll/beam_elements/{collimators_src → elements_src}/everest_collimator.h +19 -3
- xcoll/beam_elements/{collimators_src → elements_src}/everest_crystal.h +30 -9
- xcoll/beam_elements/everest.py +5 -6
- xcoll/beam_elements/monitor.py +428 -0
- xcoll/colldb.py +103 -74
- xcoll/general.py +4 -4
- xcoll/initial_distribution.py +18 -6
- xcoll/install.py +3 -1
- xcoll/interaction_record/interaction_record.py +127 -81
- xcoll/interaction_record/interaction_record_src/interaction_record.h +43 -43
- xcoll/line_tools.py +8 -9
- xcoll/lossmap.py +48 -38
- xcoll/scattering_routines/everest/amorphous.h +4 -11
- xcoll/scattering_routines/everest/channeling.h +3 -8
- xcoll/scattering_routines/everest/everest.h +4 -1
- xcoll/scattering_routines/everest/jaw.h +4 -3
- xcoll/scattering_routines/everest/materials.py +35 -15
- xcoll/scattering_routines/everest/multiple_coulomb_scattering.h +2 -2
- xcoll/scattering_routines/everest/nuclear_interaction.h +1 -1
- xcoll/scattering_routines/everest/properties.h +6 -1
- xcoll/scattering_routines/fluka/flukaio/lib/libFlukaIO64.a +0 -0
- xcoll/scattering_routines/geant4/collimasim/.git +1 -0
- xcoll/scattering_routines/geant4/collimasim/.gitignore +12 -0
- xcoll/scattering_routines/geant4/collimasim/.gitmodules +3 -0
- xcoll/scattering_routines/geant4/collimasim/CMakeLists.txt +26 -0
- xcoll/scattering_routines/geant4/collimasim/README.md +21 -0
- xcoll/scattering_routines/geant4/collimasim/docs/Makefile +20 -0
- xcoll/scattering_routines/geant4/collimasim/docs/make.bat +35 -0
- xcoll/scattering_routines/geant4/collimasim/docs/source/collimasim.rst +10 -0
- xcoll/scattering_routines/geant4/collimasim/docs/source/conf.py +59 -0
- xcoll/scattering_routines/geant4/collimasim/docs/source/index.rst +26 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.appveyor.yml +37 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-format +19 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.clang-tidy +65 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.cmake-format.yaml +73 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.git +1 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CODEOWNERS +9 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/CONTRIBUTING.md +386 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/bug-report.yml +45 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/ISSUE_TEMPLATE/config.yml +8 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/dependabot.yml +16 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler.yml +8 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/labeler_merged.yml +3 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/pull_request_template.md +19 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/ci.yml +969 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/configure.yml +84 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/format.yml +48 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/labeler.yml +16 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.github/workflows/pip.yml +103 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.gitignore +45 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.pre-commit-config.yaml +151 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/.readthedocs.yml +3 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/CMakeLists.txt +297 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/LICENSE +29 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/MANIFEST.in +6 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/README.rst +180 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Doxyfile +23 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/Makefile +192 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/_static/theme_overrides.css +11 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/chrono.rst +81 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/custom.rst +93 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/eigen.rst +310 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/functional.rst +109 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/index.rst +43 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/overview.rst +171 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/stl.rst +251 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/cast/strings.rst +305 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/classes.rst +1297 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/embedding.rst +262 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/exceptions.rst +396 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/functions.rst +568 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/misc.rst +337 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/index.rst +13 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/numpy.rst +463 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/object.rst +286 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/pycpp/utilities.rst +155 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/advanced/smart_ptrs.rst +174 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/basics.rst +308 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.py +91 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/benchmark.rst +95 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/changelog.rst +2050 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/classes.rst +542 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/cmake/index.rst +8 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/compiling.rst +648 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/conf.py +381 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/faq.rst +343 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/index.rst +48 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/installing.rst +105 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/limitations.rst +72 -0
- 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 +427 -0
- 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 +427 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/reference.rst +130 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/release.rst +96 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/requirements.txt +8 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/docs/upgrade.rst +548 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/attr.h +605 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/buffer_info.h +144 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/cast.h +1432 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/chrono.h +213 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/common.h +2 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/complex.h +65 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/class.h +709 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/common.h +1021 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/descr.h +104 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/init.h +346 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/internals.h +467 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/type_caster_base.h +978 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/detail/typeid.h +55 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eigen.h +606 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/embed.h +284 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/eval.h +163 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/functional.h +121 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/gil.h +193 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/iostream.h +275 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/numpy.h +1741 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/operators.h +163 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/options.h +65 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pybind11.h +2497 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/pytypes.h +1879 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl/filesystem.h +103 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl.h +375 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/include/pybind11/stl_bind.h +747 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/noxfile.py +88 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__init__.py +11 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/__main__.py +52 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.py +12 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/_version.pyi +6 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/commands.py +21 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/py.typed +0 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.py +482 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pybind11/setup_helpers.pyi +63 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/pyproject.toml +41 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.cfg +56 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/setup.py +155 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/CMakeLists.txt +503 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/conftest.py +208 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/constructor_stats.h +275 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/cross_module_gil_utils.cpp +73 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/env.py +33 -0
- 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 +279 -0
- 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 +143 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/local_bindings.h +85 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/object.h +179 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_cross_module_tests.cpp +151 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.cpp +91 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pybind11_tests.h +85 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/pytest.ini +19 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/requirements.txt +12 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.cpp +26 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_async.py +25 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.cpp +216 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_buffers.py +163 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.cpp +286 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_builtin_casters.py +536 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.cpp +107 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_call_policies.py +248 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.cpp +227 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_callbacks.py +202 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.cpp +84 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_chrono.py +210 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.cpp +550 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_class.py +473 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/CMakeLists.txt +84 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/embed.cpp +21 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_embed/CMakeLists.txt +28 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_function/CMakeLists.txt +39 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/installed_target/CMakeLists.txt +46 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/main.cpp +6 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_embed/CMakeLists.txt +41 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_function/CMakeLists.txt +35 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/subdirectory_target/CMakeLists.txt +41 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_cmake_build/test.py +10 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.cpp +165 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_constants_and_functions.py +53 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.cpp +238 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_copy_move.py +126 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.cpp +141 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_casters.py +117 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.cpp +41 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_custom_type_setup.py +50 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.cpp +69 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_docstring_options.py +42 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.cpp +348 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eigen.py +771 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/CMakeLists.txt +47 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/catch.cpp +22 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/external_module.cpp +23 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.cpp +326 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_embed/test_interpreter.py +15 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.cpp +148 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_enum.py +272 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.cpp +119 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval.py +51 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_eval_call.py +5 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.cpp +285 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.h +12 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_exceptions.py +265 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.cpp +397 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_factory_constructors.py +520 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.cpp +49 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_gil_scoped.py +94 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.cpp +125 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_iostream.py +331 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.cpp +153 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_kwargs_and_defaults.py +284 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.cpp +107 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_local_bindings.py +257 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.cpp +412 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_methods_and_attributes.py +517 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.cpp +102 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_modules.py +92 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.cpp +233 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_multiple_inheritance.py +360 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.cpp +472 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_array.py +593 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.cpp +524 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_dtypes.py +441 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.cpp +103 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_numpy_vectorize.py +267 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.cpp +73 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_opaque_types.py +59 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.cpp +235 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_operator_overloading.py +146 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.cpp +189 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pickling.py +82 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.cpp +560 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_pytypes.py +651 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.cpp +500 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_sequences_and_iterators.py +253 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.cpp +452 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_smart_ptr.py +318 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.cpp +342 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl.py +291 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.cpp +131 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_stl_binders.py +318 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.cpp +144 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_tagbased_polymorphic.py +29 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.cpp +66 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_thread.py +44 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.cpp +22 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_union.py +9 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.cpp +510 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/test_virtual_functions.py +408 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-numpy-scipy.supp +140 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tests/valgrind-python.supp +117 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindCatch.cmake +70 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindEigen3.cmake +86 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/FindPythonLibsNew.cmake +257 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/check-style.sh +44 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/cmake_uninstall.cmake.in +23 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/libsize.py +39 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/make_changelog.py +64 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Common.cmake +402 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Config.cmake.in +233 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11NewTools.cmake +276 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pybind11Tools.cmake +214 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/pyproject.toml +3 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_global.py.in +65 -0
- xcoll/scattering_routines/geant4/collimasim/lib/pybind11/tools/setup_main.py.in +41 -0
- xcoll/scattering_routines/geant4/collimasim/pyproject.toml +8 -0
- xcoll/scattering_routines/geant4/collimasim/setup.py +144 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.cpp +403 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSPyATInterface.hh +100 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.cpp +763 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/BDSXtrackInterface.hh +118 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/__init__.py +8 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/bindings.cpp +63 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/pyCollimatorPass.py +142 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim/xtrack_collimator.py +556 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/PKG-INFO +6 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/SOURCES.txt +24 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/dependency_links.txt +1 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/not-zip-safe +1 -0
- xcoll/scattering_routines/geant4/collimasim/src/collimasim.egg-info/top_level.txt +1 -0
- xcoll/scattering_routines/geant4/collimasim/tests/README.md +25 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_forions.dat +25 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_new_example.dat +18 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_old_example.dat +68 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_testing.dat +15 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/CollDB_yaml_example.yaml +110 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps.dat +7 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collgaps_pyat_test.dat +3 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/collonly_twiss_file_example.tfs +54 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings.gmad +3 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_black_absorber.gmad +3 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/settings_ions.gmad +5 -0
- xcoll/scattering_routines/geant4/collimasim/tests/resources/twiss_file_testing.tfs +51 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat.py +65 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_passmethod.py +59 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_pyat_tracking.py +102 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack.py +75 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_angle.py +74 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_colldb_load.py +84 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction.py +159 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_interaction_ion.py +99 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_ions.py +78 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_lost_energy.py +88 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tilt.py +80 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking.py +97 -0
- xcoll/scattering_routines/geant4/collimasim/tests/test_xtrack_tracking_ions.py +96 -0
- xcoll/scattering_routines/geometry/collimator_geometry.h +9 -10
- xcoll/scattering_routines/geometry/crystal_geometry.h +9 -6
- {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/METADATA +1 -1
- xcoll-0.5.1.dist-info/RECORD +413 -0
- xcoll/scattering_routines/fluka/build_fluka_input.py +0 -58
- xcoll-0.4.0.dist-info/RECORD +0 -126
- {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/LICENSE +0 -0
- {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/NOTICE +0 -0
- {xcoll-0.4.0.dist-info → xcoll-0.5.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from pybind11_tests import numpy_vectorize as m
|
|
5
|
+
|
|
6
|
+
np = pytest.importorskip("numpy")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def test_vectorize(capture):
|
|
10
|
+
assert np.isclose(m.vectorized_func3(np.array(3 + 7j)), [6 + 14j])
|
|
11
|
+
|
|
12
|
+
for f in [m.vectorized_func, m.vectorized_func2]:
|
|
13
|
+
with capture:
|
|
14
|
+
assert np.isclose(f(1, 2, 3), 6)
|
|
15
|
+
assert capture == "my_func(x:int=1, y:float=2, z:float=3)"
|
|
16
|
+
with capture:
|
|
17
|
+
assert np.isclose(f(np.array(1), np.array(2), 3), 6)
|
|
18
|
+
assert capture == "my_func(x:int=1, y:float=2, z:float=3)"
|
|
19
|
+
with capture:
|
|
20
|
+
assert np.allclose(f(np.array([1, 3]), np.array([2, 4]), 3), [6, 36])
|
|
21
|
+
assert (
|
|
22
|
+
capture
|
|
23
|
+
== """
|
|
24
|
+
my_func(x:int=1, y:float=2, z:float=3)
|
|
25
|
+
my_func(x:int=3, y:float=4, z:float=3)
|
|
26
|
+
"""
|
|
27
|
+
)
|
|
28
|
+
with capture:
|
|
29
|
+
a = np.array([[1, 2], [3, 4]], order="F")
|
|
30
|
+
b = np.array([[10, 20], [30, 40]], order="F")
|
|
31
|
+
c = 3
|
|
32
|
+
result = f(a, b, c)
|
|
33
|
+
assert np.allclose(result, a * b * c)
|
|
34
|
+
assert result.flags.f_contiguous
|
|
35
|
+
# All inputs are F order and full or singletons, so we the result is in col-major order:
|
|
36
|
+
assert (
|
|
37
|
+
capture
|
|
38
|
+
== """
|
|
39
|
+
my_func(x:int=1, y:float=10, z:float=3)
|
|
40
|
+
my_func(x:int=3, y:float=30, z:float=3)
|
|
41
|
+
my_func(x:int=2, y:float=20, z:float=3)
|
|
42
|
+
my_func(x:int=4, y:float=40, z:float=3)
|
|
43
|
+
"""
|
|
44
|
+
)
|
|
45
|
+
with capture:
|
|
46
|
+
a, b, c = (
|
|
47
|
+
np.array([[1, 3, 5], [7, 9, 11]]),
|
|
48
|
+
np.array([[2, 4, 6], [8, 10, 12]]),
|
|
49
|
+
3,
|
|
50
|
+
)
|
|
51
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
52
|
+
assert (
|
|
53
|
+
capture
|
|
54
|
+
== """
|
|
55
|
+
my_func(x:int=1, y:float=2, z:float=3)
|
|
56
|
+
my_func(x:int=3, y:float=4, z:float=3)
|
|
57
|
+
my_func(x:int=5, y:float=6, z:float=3)
|
|
58
|
+
my_func(x:int=7, y:float=8, z:float=3)
|
|
59
|
+
my_func(x:int=9, y:float=10, z:float=3)
|
|
60
|
+
my_func(x:int=11, y:float=12, z:float=3)
|
|
61
|
+
"""
|
|
62
|
+
)
|
|
63
|
+
with capture:
|
|
64
|
+
a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2
|
|
65
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
66
|
+
assert (
|
|
67
|
+
capture
|
|
68
|
+
== """
|
|
69
|
+
my_func(x:int=1, y:float=2, z:float=2)
|
|
70
|
+
my_func(x:int=2, y:float=3, z:float=2)
|
|
71
|
+
my_func(x:int=3, y:float=4, z:float=2)
|
|
72
|
+
my_func(x:int=4, y:float=2, z:float=2)
|
|
73
|
+
my_func(x:int=5, y:float=3, z:float=2)
|
|
74
|
+
my_func(x:int=6, y:float=4, z:float=2)
|
|
75
|
+
"""
|
|
76
|
+
)
|
|
77
|
+
with capture:
|
|
78
|
+
a, b, c = np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2
|
|
79
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
80
|
+
assert (
|
|
81
|
+
capture
|
|
82
|
+
== """
|
|
83
|
+
my_func(x:int=1, y:float=2, z:float=2)
|
|
84
|
+
my_func(x:int=2, y:float=2, z:float=2)
|
|
85
|
+
my_func(x:int=3, y:float=2, z:float=2)
|
|
86
|
+
my_func(x:int=4, y:float=3, z:float=2)
|
|
87
|
+
my_func(x:int=5, y:float=3, z:float=2)
|
|
88
|
+
my_func(x:int=6, y:float=3, z:float=2)
|
|
89
|
+
"""
|
|
90
|
+
)
|
|
91
|
+
with capture:
|
|
92
|
+
a, b, c = (
|
|
93
|
+
np.array([[1, 2, 3], [4, 5, 6]], order="F"),
|
|
94
|
+
np.array([[2], [3]]),
|
|
95
|
+
2,
|
|
96
|
+
)
|
|
97
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
98
|
+
assert (
|
|
99
|
+
capture
|
|
100
|
+
== """
|
|
101
|
+
my_func(x:int=1, y:float=2, z:float=2)
|
|
102
|
+
my_func(x:int=2, y:float=2, z:float=2)
|
|
103
|
+
my_func(x:int=3, y:float=2, z:float=2)
|
|
104
|
+
my_func(x:int=4, y:float=3, z:float=2)
|
|
105
|
+
my_func(x:int=5, y:float=3, z:float=2)
|
|
106
|
+
my_func(x:int=6, y:float=3, z:float=2)
|
|
107
|
+
"""
|
|
108
|
+
)
|
|
109
|
+
with capture:
|
|
110
|
+
a, b, c = np.array([[1, 2, 3], [4, 5, 6]])[::, ::2], np.array([[2], [3]]), 2
|
|
111
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
112
|
+
assert (
|
|
113
|
+
capture
|
|
114
|
+
== """
|
|
115
|
+
my_func(x:int=1, y:float=2, z:float=2)
|
|
116
|
+
my_func(x:int=3, y:float=2, z:float=2)
|
|
117
|
+
my_func(x:int=4, y:float=3, z:float=2)
|
|
118
|
+
my_func(x:int=6, y:float=3, z:float=2)
|
|
119
|
+
"""
|
|
120
|
+
)
|
|
121
|
+
with capture:
|
|
122
|
+
a, b, c = (
|
|
123
|
+
np.array([[1, 2, 3], [4, 5, 6]], order="F")[::, ::2],
|
|
124
|
+
np.array([[2], [3]]),
|
|
125
|
+
2,
|
|
126
|
+
)
|
|
127
|
+
assert np.allclose(f(a, b, c), a * b * c)
|
|
128
|
+
assert (
|
|
129
|
+
capture
|
|
130
|
+
== """
|
|
131
|
+
my_func(x:int=1, y:float=2, z:float=2)
|
|
132
|
+
my_func(x:int=3, y:float=2, z:float=2)
|
|
133
|
+
my_func(x:int=4, y:float=3, z:float=2)
|
|
134
|
+
my_func(x:int=6, y:float=3, z:float=2)
|
|
135
|
+
"""
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def test_type_selection():
|
|
140
|
+
assert m.selective_func(np.array([1], dtype=np.int32)) == "Int branch taken."
|
|
141
|
+
assert m.selective_func(np.array([1.0], dtype=np.float32)) == "Float branch taken."
|
|
142
|
+
assert (
|
|
143
|
+
m.selective_func(np.array([1.0j], dtype=np.complex64))
|
|
144
|
+
== "Complex float branch taken."
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_docs(doc):
|
|
149
|
+
assert (
|
|
150
|
+
doc(m.vectorized_func)
|
|
151
|
+
== """
|
|
152
|
+
vectorized_func(arg0: numpy.ndarray[numpy.int32], arg1: numpy.ndarray[numpy.float32], arg2: numpy.ndarray[numpy.float64]) -> object
|
|
153
|
+
""" # noqa: E501 line too long
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
def test_trivial_broadcasting():
|
|
158
|
+
trivial, vectorized_is_trivial = m.trivial, m.vectorized_is_trivial
|
|
159
|
+
|
|
160
|
+
assert vectorized_is_trivial(1, 2, 3) == trivial.c_trivial
|
|
161
|
+
assert vectorized_is_trivial(np.array(1), np.array(2), 3) == trivial.c_trivial
|
|
162
|
+
assert (
|
|
163
|
+
vectorized_is_trivial(np.array([1, 3]), np.array([2, 4]), 3)
|
|
164
|
+
== trivial.c_trivial
|
|
165
|
+
)
|
|
166
|
+
assert trivial.c_trivial == vectorized_is_trivial(
|
|
167
|
+
np.array([[1, 3, 5], [7, 9, 11]]), np.array([[2, 4, 6], [8, 10, 12]]), 3
|
|
168
|
+
)
|
|
169
|
+
assert (
|
|
170
|
+
vectorized_is_trivial(np.array([[1, 2, 3], [4, 5, 6]]), np.array([2, 3, 4]), 2)
|
|
171
|
+
== trivial.non_trivial
|
|
172
|
+
)
|
|
173
|
+
assert (
|
|
174
|
+
vectorized_is_trivial(np.array([[1, 2, 3], [4, 5, 6]]), np.array([[2], [3]]), 2)
|
|
175
|
+
== trivial.non_trivial
|
|
176
|
+
)
|
|
177
|
+
z1 = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], dtype="int32")
|
|
178
|
+
z2 = np.array(z1, dtype="float32")
|
|
179
|
+
z3 = np.array(z1, dtype="float64")
|
|
180
|
+
assert vectorized_is_trivial(z1, z2, z3) == trivial.c_trivial
|
|
181
|
+
assert vectorized_is_trivial(1, z2, z3) == trivial.c_trivial
|
|
182
|
+
assert vectorized_is_trivial(z1, 1, z3) == trivial.c_trivial
|
|
183
|
+
assert vectorized_is_trivial(z1, z2, 1) == trivial.c_trivial
|
|
184
|
+
assert vectorized_is_trivial(z1[::2, ::2], 1, 1) == trivial.non_trivial
|
|
185
|
+
assert vectorized_is_trivial(1, 1, z1[::2, ::2]) == trivial.c_trivial
|
|
186
|
+
assert vectorized_is_trivial(1, 1, z3[::2, ::2]) == trivial.non_trivial
|
|
187
|
+
assert vectorized_is_trivial(z1, 1, z3[1::4, 1::4]) == trivial.c_trivial
|
|
188
|
+
|
|
189
|
+
y1 = np.array(z1, order="F")
|
|
190
|
+
y2 = np.array(y1)
|
|
191
|
+
y3 = np.array(y1)
|
|
192
|
+
assert vectorized_is_trivial(y1, y2, y3) == trivial.f_trivial
|
|
193
|
+
assert vectorized_is_trivial(y1, 1, 1) == trivial.f_trivial
|
|
194
|
+
assert vectorized_is_trivial(1, y2, 1) == trivial.f_trivial
|
|
195
|
+
assert vectorized_is_trivial(1, 1, y3) == trivial.f_trivial
|
|
196
|
+
assert vectorized_is_trivial(y1, z2, 1) == trivial.non_trivial
|
|
197
|
+
assert vectorized_is_trivial(z1[1::4, 1::4], y2, 1) == trivial.f_trivial
|
|
198
|
+
assert vectorized_is_trivial(y1[1::4, 1::4], z2, 1) == trivial.c_trivial
|
|
199
|
+
|
|
200
|
+
assert m.vectorized_func(z1, z2, z3).flags.c_contiguous
|
|
201
|
+
assert m.vectorized_func(y1, y2, y3).flags.f_contiguous
|
|
202
|
+
assert m.vectorized_func(z1, 1, 1).flags.c_contiguous
|
|
203
|
+
assert m.vectorized_func(1, y2, 1).flags.f_contiguous
|
|
204
|
+
assert m.vectorized_func(z1[1::4, 1::4], y2, 1).flags.f_contiguous
|
|
205
|
+
assert m.vectorized_func(y1[1::4, 1::4], z2, 1).flags.c_contiguous
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def test_passthrough_arguments(doc):
|
|
209
|
+
assert doc(m.vec_passthrough) == (
|
|
210
|
+
"vec_passthrough("
|
|
211
|
+
+ ", ".join(
|
|
212
|
+
[
|
|
213
|
+
"arg0: float",
|
|
214
|
+
"arg1: numpy.ndarray[numpy.float64]",
|
|
215
|
+
"arg2: numpy.ndarray[numpy.float64]",
|
|
216
|
+
"arg3: numpy.ndarray[numpy.int32]",
|
|
217
|
+
"arg4: int",
|
|
218
|
+
"arg5: m.numpy_vectorize.NonPODClass",
|
|
219
|
+
"arg6: numpy.ndarray[numpy.float64]",
|
|
220
|
+
]
|
|
221
|
+
)
|
|
222
|
+
+ ") -> object"
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
b = np.array([[10, 20, 30]], dtype="float64")
|
|
226
|
+
c = np.array([100, 200]) # NOT a vectorized argument
|
|
227
|
+
d = np.array([[1000], [2000], [3000]], dtype="int")
|
|
228
|
+
g = np.array([[1000000, 2000000, 3000000]], dtype="int") # requires casting
|
|
229
|
+
assert np.all(
|
|
230
|
+
m.vec_passthrough(1, b, c, d, 10000, m.NonPODClass(100000), g)
|
|
231
|
+
== np.array(
|
|
232
|
+
[
|
|
233
|
+
[1111111, 2111121, 3111131],
|
|
234
|
+
[1112111, 2112121, 3112131],
|
|
235
|
+
[1113111, 2113121, 3113131],
|
|
236
|
+
]
|
|
237
|
+
)
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
def test_method_vectorization():
|
|
242
|
+
o = m.VectorizeTestClass(3)
|
|
243
|
+
x = np.array([1, 2], dtype="int")
|
|
244
|
+
y = np.array([[10], [20]], dtype="float32")
|
|
245
|
+
assert np.all(o.method(x, y) == [[14, 15], [24, 25]])
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
def test_array_collapse():
|
|
249
|
+
assert not isinstance(m.vectorized_func(1, 2, 3), np.ndarray)
|
|
250
|
+
assert not isinstance(m.vectorized_func(np.array(1), 2, 3), np.ndarray)
|
|
251
|
+
z = m.vectorized_func([1], 2, 3)
|
|
252
|
+
assert isinstance(z, np.ndarray)
|
|
253
|
+
assert z.shape == (1,)
|
|
254
|
+
z = m.vectorized_func(1, [[[2]]], 3)
|
|
255
|
+
assert isinstance(z, np.ndarray)
|
|
256
|
+
assert z.shape == (1, 1, 1)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def test_vectorized_noreturn():
|
|
260
|
+
x = m.NonPODClass(0)
|
|
261
|
+
assert x.value == 0
|
|
262
|
+
m.add_to(x, [1, 2, 3, 4])
|
|
263
|
+
assert x.value == 10
|
|
264
|
+
m.add_to(x, 1)
|
|
265
|
+
assert x.value == 11
|
|
266
|
+
m.add_to(x, [[1, 1], [2, 3]])
|
|
267
|
+
assert x.value == 18
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
tests/test_opaque_types.cpp -- opaque types, passing void pointers
|
|
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
|
+
#include "pybind11_tests.h"
|
|
11
|
+
#include <pybind11/stl.h>
|
|
12
|
+
#include <vector>
|
|
13
|
+
|
|
14
|
+
// IMPORTANT: Disable internal pybind11 translation mechanisms for STL data structures
|
|
15
|
+
//
|
|
16
|
+
// This also deliberately doesn't use the below StringList type alias to test
|
|
17
|
+
// that MAKE_OPAQUE can handle a type containing a `,`. (The `std::allocator`
|
|
18
|
+
// bit is just the default `std::vector` allocator).
|
|
19
|
+
PYBIND11_MAKE_OPAQUE(std::vector<std::string, std::allocator<std::string>>);
|
|
20
|
+
|
|
21
|
+
using StringList = std::vector<std::string, std::allocator<std::string>>;
|
|
22
|
+
|
|
23
|
+
TEST_SUBMODULE(opaque_types, m) {
|
|
24
|
+
// test_string_list
|
|
25
|
+
py::class_<StringList>(m, "StringList")
|
|
26
|
+
.def(py::init<>())
|
|
27
|
+
.def("pop_back", &StringList::pop_back)
|
|
28
|
+
/* There are multiple versions of push_back(), etc. Select the right ones. */
|
|
29
|
+
.def("push_back", (void (StringList::*)(const std::string &)) &StringList::push_back)
|
|
30
|
+
.def("back", (std::string &(StringList::*)()) &StringList::back)
|
|
31
|
+
.def("__len__", [](const StringList &v) { return v.size(); })
|
|
32
|
+
.def("__iter__", [](StringList &v) {
|
|
33
|
+
return py::make_iterator(v.begin(), v.end());
|
|
34
|
+
}, py::keep_alive<0, 1>());
|
|
35
|
+
|
|
36
|
+
class ClassWithSTLVecProperty {
|
|
37
|
+
public:
|
|
38
|
+
StringList stringList;
|
|
39
|
+
};
|
|
40
|
+
py::class_<ClassWithSTLVecProperty>(m, "ClassWithSTLVecProperty")
|
|
41
|
+
.def(py::init<>())
|
|
42
|
+
.def_readwrite("stringList", &ClassWithSTLVecProperty::stringList);
|
|
43
|
+
|
|
44
|
+
m.def("print_opaque_list", [](const StringList &l) {
|
|
45
|
+
std::string ret = "Opaque list: [";
|
|
46
|
+
bool first = true;
|
|
47
|
+
for (const auto &entry : l) {
|
|
48
|
+
if (!first)
|
|
49
|
+
ret += ", ";
|
|
50
|
+
ret += entry;
|
|
51
|
+
first = false;
|
|
52
|
+
}
|
|
53
|
+
return ret + "]";
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// test_pointers
|
|
57
|
+
m.def("return_void_ptr", []() { return (void *) 0x1234; });
|
|
58
|
+
m.def("get_void_ptr_value", [](void *ptr) { return reinterpret_cast<std::intptr_t>(ptr); });
|
|
59
|
+
m.def("return_null_str", []() { return (char *) nullptr; });
|
|
60
|
+
m.def("get_null_str_value", [](char *ptr) { return reinterpret_cast<std::intptr_t>(ptr); });
|
|
61
|
+
|
|
62
|
+
m.def("return_unique_ptr", []() -> std::unique_ptr<StringList> {
|
|
63
|
+
auto *result = new StringList();
|
|
64
|
+
result->push_back("some value");
|
|
65
|
+
return std::unique_ptr<StringList>(result);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// test unions
|
|
69
|
+
py::class_<IntFloat>(m, "IntFloat")
|
|
70
|
+
.def(py::init<>())
|
|
71
|
+
.def_readwrite("i", &IntFloat::i)
|
|
72
|
+
.def_readwrite("f", &IntFloat::f);
|
|
73
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from pybind11_tests import ConstructorStats, UserType
|
|
5
|
+
from pybind11_tests import opaque_types as m
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_string_list():
|
|
9
|
+
lst = m.StringList()
|
|
10
|
+
lst.push_back("Element 1")
|
|
11
|
+
lst.push_back("Element 2")
|
|
12
|
+
assert m.print_opaque_list(lst) == "Opaque list: [Element 1, Element 2]"
|
|
13
|
+
assert lst.back() == "Element 2"
|
|
14
|
+
|
|
15
|
+
for i, k in enumerate(lst, start=1):
|
|
16
|
+
assert k == "Element {}".format(i)
|
|
17
|
+
lst.pop_back()
|
|
18
|
+
assert m.print_opaque_list(lst) == "Opaque list: [Element 1]"
|
|
19
|
+
|
|
20
|
+
cvp = m.ClassWithSTLVecProperty()
|
|
21
|
+
assert m.print_opaque_list(cvp.stringList) == "Opaque list: []"
|
|
22
|
+
|
|
23
|
+
cvp.stringList = lst
|
|
24
|
+
cvp.stringList.push_back("Element 3")
|
|
25
|
+
assert m.print_opaque_list(cvp.stringList) == "Opaque list: [Element 1, Element 3]"
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_pointers(msg):
|
|
29
|
+
living_before = ConstructorStats.get(UserType).alive()
|
|
30
|
+
assert m.get_void_ptr_value(m.return_void_ptr()) == 0x1234
|
|
31
|
+
assert m.get_void_ptr_value(UserType()) # Should also work for other C++ types
|
|
32
|
+
assert ConstructorStats.get(UserType).alive() == living_before
|
|
33
|
+
|
|
34
|
+
with pytest.raises(TypeError) as excinfo:
|
|
35
|
+
m.get_void_ptr_value([1, 2, 3]) # This should not work
|
|
36
|
+
assert (
|
|
37
|
+
msg(excinfo.value)
|
|
38
|
+
== """
|
|
39
|
+
get_void_ptr_value(): incompatible function arguments. The following argument types are supported:
|
|
40
|
+
1. (arg0: capsule) -> int
|
|
41
|
+
|
|
42
|
+
Invoked with: [1, 2, 3]
|
|
43
|
+
""" # noqa: E501 line too long
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
assert m.return_null_str() is None
|
|
47
|
+
assert m.get_null_str_value(m.return_null_str()) is not None
|
|
48
|
+
|
|
49
|
+
ptr = m.return_unique_ptr()
|
|
50
|
+
assert "StringList" in repr(ptr)
|
|
51
|
+
assert m.print_opaque_list(ptr) == "Opaque list: [some value]"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def test_unions():
|
|
55
|
+
int_float_union = m.IntFloat()
|
|
56
|
+
int_float_union.i = 42
|
|
57
|
+
assert int_float_union.i == 42
|
|
58
|
+
int_float_union.f = 3.0
|
|
59
|
+
assert int_float_union.f == 3.0
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/*
|
|
2
|
+
tests/test_operator_overloading.cpp -- operator overloading
|
|
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
|
+
#include "pybind11_tests.h"
|
|
11
|
+
#include "constructor_stats.h"
|
|
12
|
+
#include <pybind11/operators.h>
|
|
13
|
+
#include <functional>
|
|
14
|
+
|
|
15
|
+
class Vector2 {
|
|
16
|
+
public:
|
|
17
|
+
Vector2(float x, float y) : x(x), y(y) { print_created(this, toString()); }
|
|
18
|
+
Vector2(const Vector2 &v) : x(v.x), y(v.y) { print_copy_created(this); }
|
|
19
|
+
Vector2(Vector2 &&v) noexcept : x(v.x), y(v.y) {
|
|
20
|
+
print_move_created(this);
|
|
21
|
+
v.x = v.y = 0;
|
|
22
|
+
}
|
|
23
|
+
Vector2 &operator=(const Vector2 &v) { x = v.x; y = v.y; print_copy_assigned(this); return *this; }
|
|
24
|
+
Vector2 &operator=(Vector2 &&v) noexcept {
|
|
25
|
+
x = v.x;
|
|
26
|
+
y = v.y;
|
|
27
|
+
v.x = v.y = 0;
|
|
28
|
+
print_move_assigned(this);
|
|
29
|
+
return *this;
|
|
30
|
+
}
|
|
31
|
+
~Vector2() { print_destroyed(this); }
|
|
32
|
+
|
|
33
|
+
std::string toString() const { return "[" + std::to_string(x) + ", " + std::to_string(y) + "]"; }
|
|
34
|
+
|
|
35
|
+
Vector2 operator-() const { return Vector2(-x, -y); }
|
|
36
|
+
Vector2 operator+(const Vector2 &v) const { return Vector2(x + v.x, y + v.y); }
|
|
37
|
+
Vector2 operator-(const Vector2 &v) const { return Vector2(x - v.x, y - v.y); }
|
|
38
|
+
Vector2 operator-(float value) const { return Vector2(x - value, y - value); }
|
|
39
|
+
Vector2 operator+(float value) const { return Vector2(x + value, y + value); }
|
|
40
|
+
Vector2 operator*(float value) const { return Vector2(x * value, y * value); }
|
|
41
|
+
Vector2 operator/(float value) const { return Vector2(x / value, y / value); }
|
|
42
|
+
Vector2 operator*(const Vector2 &v) const { return Vector2(x * v.x, y * v.y); }
|
|
43
|
+
Vector2 operator/(const Vector2 &v) const { return Vector2(x / v.x, y / v.y); }
|
|
44
|
+
Vector2& operator+=(const Vector2 &v) { x += v.x; y += v.y; return *this; }
|
|
45
|
+
Vector2& operator-=(const Vector2 &v) { x -= v.x; y -= v.y; return *this; }
|
|
46
|
+
Vector2& operator*=(float v) { x *= v; y *= v; return *this; }
|
|
47
|
+
Vector2& operator/=(float v) { x /= v; y /= v; return *this; }
|
|
48
|
+
Vector2& operator*=(const Vector2 &v) { x *= v.x; y *= v.y; return *this; }
|
|
49
|
+
Vector2& operator/=(const Vector2 &v) { x /= v.x; y /= v.y; return *this; }
|
|
50
|
+
|
|
51
|
+
friend Vector2 operator+(float f, const Vector2 &v) { return Vector2(f + v.x, f + v.y); }
|
|
52
|
+
friend Vector2 operator-(float f, const Vector2 &v) { return Vector2(f - v.x, f - v.y); }
|
|
53
|
+
friend Vector2 operator*(float f, const Vector2 &v) { return Vector2(f * v.x, f * v.y); }
|
|
54
|
+
friend Vector2 operator/(float f, const Vector2 &v) { return Vector2(f / v.x, f / v.y); }
|
|
55
|
+
|
|
56
|
+
bool operator==(const Vector2 &v) const {
|
|
57
|
+
return x == v.x && y == v.y;
|
|
58
|
+
}
|
|
59
|
+
bool operator!=(const Vector2 &v) const {
|
|
60
|
+
return x != v.x || y != v.y;
|
|
61
|
+
}
|
|
62
|
+
private:
|
|
63
|
+
float x, y;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
class C1 { };
|
|
67
|
+
class C2 { };
|
|
68
|
+
|
|
69
|
+
int operator+(const C1 &, const C1 &) { return 11; }
|
|
70
|
+
int operator+(const C2 &, const C2 &) { return 22; }
|
|
71
|
+
int operator+(const C2 &, const C1 &) { return 21; }
|
|
72
|
+
int operator+(const C1 &, const C2 &) { return 12; }
|
|
73
|
+
|
|
74
|
+
// Note: Specializing explicit within `namespace std { ... }` is done due to a
|
|
75
|
+
// bug in GCC<7. If you are supporting compilers later than this, consider
|
|
76
|
+
// specializing `using template<> struct std::hash<...>` in the global
|
|
77
|
+
// namespace instead, per this recommendation:
|
|
78
|
+
// https://en.cppreference.com/w/cpp/language/extending_std#Adding_template_specializations
|
|
79
|
+
namespace std {
|
|
80
|
+
template<>
|
|
81
|
+
struct hash<Vector2> {
|
|
82
|
+
// Not a good hash function, but easy to test
|
|
83
|
+
size_t operator()(const Vector2 &) { return 4; }
|
|
84
|
+
};
|
|
85
|
+
} // namespace std
|
|
86
|
+
|
|
87
|
+
// Not a good abs function, but easy to test.
|
|
88
|
+
std::string abs(const Vector2&) {
|
|
89
|
+
return "abs(Vector2)";
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// MSVC & Intel warns about unknown pragmas, and warnings are errors.
|
|
93
|
+
#if !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
|
94
|
+
#pragma GCC diagnostic push
|
|
95
|
+
// clang 7.0.0 and Apple LLVM 10.0.1 introduce `-Wself-assign-overloaded` to
|
|
96
|
+
// `-Wall`, which is used here for overloading (e.g. `py::self += py::self `).
|
|
97
|
+
// Here, we suppress the warning using `#pragma diagnostic`.
|
|
98
|
+
// Taken from: https://github.com/RobotLocomotion/drake/commit/aaf84b46
|
|
99
|
+
// TODO(eric): This could be resolved using a function / functor (e.g. `py::self()`).
|
|
100
|
+
#if defined(__APPLE__) && defined(__clang__)
|
|
101
|
+
#if (__clang_major__ >= 10)
|
|
102
|
+
#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
|
|
103
|
+
#endif
|
|
104
|
+
#elif defined(__clang__)
|
|
105
|
+
#if (__clang_major__ >= 7)
|
|
106
|
+
#pragma GCC diagnostic ignored "-Wself-assign-overloaded"
|
|
107
|
+
#endif
|
|
108
|
+
#endif
|
|
109
|
+
#endif
|
|
110
|
+
|
|
111
|
+
TEST_SUBMODULE(operators, m) {
|
|
112
|
+
|
|
113
|
+
// test_operator_overloading
|
|
114
|
+
py::class_<Vector2>(m, "Vector2")
|
|
115
|
+
.def(py::init<float, float>())
|
|
116
|
+
.def(py::self + py::self)
|
|
117
|
+
.def(py::self + float())
|
|
118
|
+
.def(py::self - py::self)
|
|
119
|
+
.def(py::self - float())
|
|
120
|
+
.def(py::self * float())
|
|
121
|
+
.def(py::self / float())
|
|
122
|
+
.def(py::self * py::self)
|
|
123
|
+
.def(py::self / py::self)
|
|
124
|
+
.def(py::self += py::self)
|
|
125
|
+
.def(py::self -= py::self)
|
|
126
|
+
.def(py::self *= float())
|
|
127
|
+
.def(py::self /= float())
|
|
128
|
+
.def(py::self *= py::self)
|
|
129
|
+
.def(py::self /= py::self)
|
|
130
|
+
.def(float() + py::self)
|
|
131
|
+
.def(float() - py::self)
|
|
132
|
+
.def(float() * py::self)
|
|
133
|
+
.def(float() / py::self)
|
|
134
|
+
.def(-py::self)
|
|
135
|
+
.def("__str__", &Vector2::toString)
|
|
136
|
+
.def("__repr__", &Vector2::toString)
|
|
137
|
+
.def(py::self == py::self)
|
|
138
|
+
.def(py::self != py::self)
|
|
139
|
+
.def(py::hash(py::self))
|
|
140
|
+
// N.B. See warning about usage of `py::detail::abs(py::self)` in
|
|
141
|
+
// `operators.h`.
|
|
142
|
+
.def("__abs__", [](const Vector2& v) { return abs(v); })
|
|
143
|
+
;
|
|
144
|
+
|
|
145
|
+
m.attr("Vector") = m.attr("Vector2");
|
|
146
|
+
|
|
147
|
+
// test_operators_notimplemented
|
|
148
|
+
// #393: need to return NotSupported to ensure correct arithmetic operator behavior
|
|
149
|
+
py::class_<C1>(m, "C1")
|
|
150
|
+
.def(py::init<>())
|
|
151
|
+
.def(py::self + py::self);
|
|
152
|
+
|
|
153
|
+
py::class_<C2>(m, "C2")
|
|
154
|
+
.def(py::init<>())
|
|
155
|
+
.def(py::self + py::self)
|
|
156
|
+
.def("__add__", [](const C2& c2, const C1& c1) { return c2 + c1; })
|
|
157
|
+
.def("__radd__", [](const C2& c2, const C1& c1) { return c1 + c2; });
|
|
158
|
+
|
|
159
|
+
// test_nested
|
|
160
|
+
// #328: first member in a class can't be used in operators
|
|
161
|
+
struct NestABase { int value = -2; };
|
|
162
|
+
py::class_<NestABase>(m, "NestABase")
|
|
163
|
+
.def(py::init<>())
|
|
164
|
+
.def_readwrite("value", &NestABase::value);
|
|
165
|
+
|
|
166
|
+
struct NestA : NestABase {
|
|
167
|
+
int value = 3;
|
|
168
|
+
NestA& operator+=(int i) { value += i; return *this; }
|
|
169
|
+
};
|
|
170
|
+
py::class_<NestA>(m, "NestA")
|
|
171
|
+
.def(py::init<>())
|
|
172
|
+
.def(py::self += int())
|
|
173
|
+
.def("as_base", [](NestA &a) -> NestABase& {
|
|
174
|
+
return (NestABase&) a;
|
|
175
|
+
}, py::return_value_policy::reference_internal);
|
|
176
|
+
m.def("get_NestA", [](const NestA &a) { return a.value; });
|
|
177
|
+
|
|
178
|
+
struct NestB {
|
|
179
|
+
NestA a;
|
|
180
|
+
int value = 4;
|
|
181
|
+
NestB& operator-=(int i) { value -= i; return *this; }
|
|
182
|
+
};
|
|
183
|
+
py::class_<NestB>(m, "NestB")
|
|
184
|
+
.def(py::init<>())
|
|
185
|
+
.def(py::self -= int())
|
|
186
|
+
.def_readwrite("a", &NestB::a);
|
|
187
|
+
m.def("get_NestB", [](const NestB &b) { return b.value; });
|
|
188
|
+
|
|
189
|
+
struct NestC {
|
|
190
|
+
NestB b;
|
|
191
|
+
int value = 5;
|
|
192
|
+
NestC& operator*=(int i) { value *= i; return *this; }
|
|
193
|
+
};
|
|
194
|
+
py::class_<NestC>(m, "NestC")
|
|
195
|
+
.def(py::init<>())
|
|
196
|
+
.def(py::self *= int())
|
|
197
|
+
.def_readwrite("b", &NestC::b);
|
|
198
|
+
m.def("get_NestC", [](const NestC &c) { return c.value; });
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
// test_overriding_eq_reset_hash
|
|
202
|
+
// #2191 Overriding __eq__ should set __hash__ to None
|
|
203
|
+
struct Comparable {
|
|
204
|
+
int value;
|
|
205
|
+
bool operator==(const Comparable& rhs) const {return value == rhs.value;}
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
struct Hashable : Comparable {
|
|
209
|
+
explicit Hashable(int value): Comparable{value}{};
|
|
210
|
+
size_t hash() const { return static_cast<size_t>(value); }
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
struct Hashable2 : Hashable {
|
|
214
|
+
using Hashable::Hashable;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
py::class_<Comparable>(m, "Comparable")
|
|
218
|
+
.def(py::init<int>())
|
|
219
|
+
.def(py::self == py::self);
|
|
220
|
+
|
|
221
|
+
py::class_<Hashable>(m, "Hashable")
|
|
222
|
+
.def(py::init<int>())
|
|
223
|
+
.def(py::self == py::self)
|
|
224
|
+
.def("__hash__", &Hashable::hash);
|
|
225
|
+
|
|
226
|
+
// define __hash__ before __eq__
|
|
227
|
+
py::class_<Hashable2>(m, "Hashable2")
|
|
228
|
+
.def("__hash__", &Hashable::hash)
|
|
229
|
+
.def(py::init<int>())
|
|
230
|
+
.def(py::self == py::self);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
#if !defined(_MSC_VER) && !defined(__INTEL_COMPILER)
|
|
234
|
+
#pragma GCC diagnostic pop
|
|
235
|
+
#endif
|