xcoll 0.5.12__py3-none-any.whl → 0.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of xcoll might be problematic. Click here for more details.
- xcoll/__init__.py +5 -18
- 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/headers/particle_states.py +51 -0
- xcoll/initial_distribution.py +121 -91
- 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.0.dist-info}/METADATA +5 -5
- xcoll-0.6.0.dist-info/RECORD +135 -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.0.dist-info}/LICENSE +0 -0
- {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/NOTICE +0 -0
- {xcoll-0.5.12.dist-info → xcoll-0.6.0.dist-info}/WHEEL +0 -0
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
import pytest
|
|
3
|
-
|
|
4
|
-
import env # noqa: F401
|
|
5
|
-
|
|
6
|
-
m = pytest.importorskip("pybind11_tests.virtual_functions")
|
|
7
|
-
from pybind11_tests import ConstructorStats # noqa: E402
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def test_override(capture, msg):
|
|
11
|
-
class ExtendedExampleVirt(m.ExampleVirt):
|
|
12
|
-
def __init__(self, state):
|
|
13
|
-
super(ExtendedExampleVirt, self).__init__(state + 1)
|
|
14
|
-
self.data = "Hello world"
|
|
15
|
-
|
|
16
|
-
def run(self, value):
|
|
17
|
-
print("ExtendedExampleVirt::run(%i), calling parent.." % value)
|
|
18
|
-
return super(ExtendedExampleVirt, self).run(value + 1)
|
|
19
|
-
|
|
20
|
-
def run_bool(self):
|
|
21
|
-
print("ExtendedExampleVirt::run_bool()")
|
|
22
|
-
return False
|
|
23
|
-
|
|
24
|
-
def get_string1(self):
|
|
25
|
-
return "override1"
|
|
26
|
-
|
|
27
|
-
def pure_virtual(self):
|
|
28
|
-
print("ExtendedExampleVirt::pure_virtual(): %s" % self.data)
|
|
29
|
-
|
|
30
|
-
class ExtendedExampleVirt2(ExtendedExampleVirt):
|
|
31
|
-
def __init__(self, state):
|
|
32
|
-
super(ExtendedExampleVirt2, self).__init__(state + 1)
|
|
33
|
-
|
|
34
|
-
def get_string2(self):
|
|
35
|
-
return "override2"
|
|
36
|
-
|
|
37
|
-
ex12 = m.ExampleVirt(10)
|
|
38
|
-
with capture:
|
|
39
|
-
assert m.runExampleVirt(ex12, 20) == 30
|
|
40
|
-
assert (
|
|
41
|
-
capture
|
|
42
|
-
== """
|
|
43
|
-
Original implementation of ExampleVirt::run(state=10, value=20, str1=default1, str2=default2)
|
|
44
|
-
""" # noqa: E501 line too long
|
|
45
|
-
)
|
|
46
|
-
|
|
47
|
-
with pytest.raises(RuntimeError) as excinfo:
|
|
48
|
-
m.runExampleVirtVirtual(ex12)
|
|
49
|
-
assert (
|
|
50
|
-
msg(excinfo.value)
|
|
51
|
-
== 'Tried to call pure virtual function "ExampleVirt::pure_virtual"'
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
ex12p = ExtendedExampleVirt(10)
|
|
55
|
-
with capture:
|
|
56
|
-
assert m.runExampleVirt(ex12p, 20) == 32
|
|
57
|
-
assert (
|
|
58
|
-
capture
|
|
59
|
-
== """
|
|
60
|
-
ExtendedExampleVirt::run(20), calling parent..
|
|
61
|
-
Original implementation of ExampleVirt::run(state=11, value=21, str1=override1, str2=default2)
|
|
62
|
-
""" # noqa: E501 line too long
|
|
63
|
-
)
|
|
64
|
-
with capture:
|
|
65
|
-
assert m.runExampleVirtBool(ex12p) is False
|
|
66
|
-
assert capture == "ExtendedExampleVirt::run_bool()"
|
|
67
|
-
with capture:
|
|
68
|
-
m.runExampleVirtVirtual(ex12p)
|
|
69
|
-
assert capture == "ExtendedExampleVirt::pure_virtual(): Hello world"
|
|
70
|
-
|
|
71
|
-
ex12p2 = ExtendedExampleVirt2(15)
|
|
72
|
-
with capture:
|
|
73
|
-
assert m.runExampleVirt(ex12p2, 50) == 68
|
|
74
|
-
assert (
|
|
75
|
-
capture
|
|
76
|
-
== """
|
|
77
|
-
ExtendedExampleVirt::run(50), calling parent..
|
|
78
|
-
Original implementation of ExampleVirt::run(state=17, value=51, str1=override1, str2=override2)
|
|
79
|
-
""" # noqa: E501 line too long
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
cstats = ConstructorStats.get(m.ExampleVirt)
|
|
83
|
-
assert cstats.alive() == 3
|
|
84
|
-
del ex12, ex12p, ex12p2
|
|
85
|
-
assert cstats.alive() == 0
|
|
86
|
-
assert cstats.values() == ["10", "11", "17"]
|
|
87
|
-
assert cstats.copy_constructions == 0
|
|
88
|
-
assert cstats.move_constructions >= 0
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def test_alias_delay_initialization1(capture):
|
|
92
|
-
"""`A` only initializes its trampoline class when we inherit from it
|
|
93
|
-
|
|
94
|
-
If we just create and use an A instance directly, the trampoline initialization is
|
|
95
|
-
bypassed and we only initialize an A() instead (for performance reasons).
|
|
96
|
-
"""
|
|
97
|
-
|
|
98
|
-
class B(m.A):
|
|
99
|
-
def __init__(self):
|
|
100
|
-
super(B, self).__init__()
|
|
101
|
-
|
|
102
|
-
def f(self):
|
|
103
|
-
print("In python f()")
|
|
104
|
-
|
|
105
|
-
# C++ version
|
|
106
|
-
with capture:
|
|
107
|
-
a = m.A()
|
|
108
|
-
m.call_f(a)
|
|
109
|
-
del a
|
|
110
|
-
pytest.gc_collect()
|
|
111
|
-
assert capture == "A.f()"
|
|
112
|
-
|
|
113
|
-
# Python version
|
|
114
|
-
with capture:
|
|
115
|
-
b = B()
|
|
116
|
-
m.call_f(b)
|
|
117
|
-
del b
|
|
118
|
-
pytest.gc_collect()
|
|
119
|
-
assert (
|
|
120
|
-
capture
|
|
121
|
-
== """
|
|
122
|
-
PyA.PyA()
|
|
123
|
-
PyA.f()
|
|
124
|
-
In python f()
|
|
125
|
-
PyA.~PyA()
|
|
126
|
-
"""
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
def test_alias_delay_initialization2(capture):
|
|
131
|
-
"""`A2`, unlike the above, is configured to always initialize the alias
|
|
132
|
-
|
|
133
|
-
While the extra initialization and extra class layer has small virtual dispatch
|
|
134
|
-
performance penalty, it also allows us to do more things with the trampoline
|
|
135
|
-
class such as defining local variables and performing construction/destruction.
|
|
136
|
-
"""
|
|
137
|
-
|
|
138
|
-
class B2(m.A2):
|
|
139
|
-
def __init__(self):
|
|
140
|
-
super(B2, self).__init__()
|
|
141
|
-
|
|
142
|
-
def f(self):
|
|
143
|
-
print("In python B2.f()")
|
|
144
|
-
|
|
145
|
-
# No python subclass version
|
|
146
|
-
with capture:
|
|
147
|
-
a2 = m.A2()
|
|
148
|
-
m.call_f(a2)
|
|
149
|
-
del a2
|
|
150
|
-
pytest.gc_collect()
|
|
151
|
-
a3 = m.A2(1)
|
|
152
|
-
m.call_f(a3)
|
|
153
|
-
del a3
|
|
154
|
-
pytest.gc_collect()
|
|
155
|
-
assert (
|
|
156
|
-
capture
|
|
157
|
-
== """
|
|
158
|
-
PyA2.PyA2()
|
|
159
|
-
PyA2.f()
|
|
160
|
-
A2.f()
|
|
161
|
-
PyA2.~PyA2()
|
|
162
|
-
PyA2.PyA2()
|
|
163
|
-
PyA2.f()
|
|
164
|
-
A2.f()
|
|
165
|
-
PyA2.~PyA2()
|
|
166
|
-
"""
|
|
167
|
-
)
|
|
168
|
-
|
|
169
|
-
# Python subclass version
|
|
170
|
-
with capture:
|
|
171
|
-
b2 = B2()
|
|
172
|
-
m.call_f(b2)
|
|
173
|
-
del b2
|
|
174
|
-
pytest.gc_collect()
|
|
175
|
-
assert (
|
|
176
|
-
capture
|
|
177
|
-
== """
|
|
178
|
-
PyA2.PyA2()
|
|
179
|
-
PyA2.f()
|
|
180
|
-
In python B2.f()
|
|
181
|
-
PyA2.~PyA2()
|
|
182
|
-
"""
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
# PyPy: Reference count > 1 causes call with noncopyable instance
|
|
187
|
-
# to fail in ncv1.print_nc()
|
|
188
|
-
@pytest.mark.xfail("env.PYPY")
|
|
189
|
-
@pytest.mark.skipif(
|
|
190
|
-
not hasattr(m, "NCVirt"), reason="NCVirt does not work on Intel/PGI/NVCC compilers"
|
|
191
|
-
)
|
|
192
|
-
def test_move_support():
|
|
193
|
-
class NCVirtExt(m.NCVirt):
|
|
194
|
-
def get_noncopyable(self, a, b):
|
|
195
|
-
# Constructs and returns a new instance:
|
|
196
|
-
nc = m.NonCopyable(a * a, b * b)
|
|
197
|
-
return nc
|
|
198
|
-
|
|
199
|
-
def get_movable(self, a, b):
|
|
200
|
-
# Return a referenced copy
|
|
201
|
-
self.movable = m.Movable(a, b)
|
|
202
|
-
return self.movable
|
|
203
|
-
|
|
204
|
-
class NCVirtExt2(m.NCVirt):
|
|
205
|
-
def get_noncopyable(self, a, b):
|
|
206
|
-
# Keep a reference: this is going to throw an exception
|
|
207
|
-
self.nc = m.NonCopyable(a, b)
|
|
208
|
-
return self.nc
|
|
209
|
-
|
|
210
|
-
def get_movable(self, a, b):
|
|
211
|
-
# Return a new instance without storing it
|
|
212
|
-
return m.Movable(a, b)
|
|
213
|
-
|
|
214
|
-
ncv1 = NCVirtExt()
|
|
215
|
-
assert ncv1.print_nc(2, 3) == "36"
|
|
216
|
-
assert ncv1.print_movable(4, 5) == "9"
|
|
217
|
-
ncv2 = NCVirtExt2()
|
|
218
|
-
assert ncv2.print_movable(7, 7) == "14"
|
|
219
|
-
# Don't check the exception message here because it differs under debug/non-debug mode
|
|
220
|
-
with pytest.raises(RuntimeError):
|
|
221
|
-
ncv2.print_nc(9, 9)
|
|
222
|
-
|
|
223
|
-
nc_stats = ConstructorStats.get(m.NonCopyable)
|
|
224
|
-
mv_stats = ConstructorStats.get(m.Movable)
|
|
225
|
-
assert nc_stats.alive() == 1
|
|
226
|
-
assert mv_stats.alive() == 1
|
|
227
|
-
del ncv1, ncv2
|
|
228
|
-
assert nc_stats.alive() == 0
|
|
229
|
-
assert mv_stats.alive() == 0
|
|
230
|
-
assert nc_stats.values() == ["4", "9", "9", "9"]
|
|
231
|
-
assert mv_stats.values() == ["4", "5", "7", "7"]
|
|
232
|
-
assert nc_stats.copy_constructions == 0
|
|
233
|
-
assert mv_stats.copy_constructions == 1
|
|
234
|
-
assert nc_stats.move_constructions >= 0
|
|
235
|
-
assert mv_stats.move_constructions >= 0
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
def test_dispatch_issue(msg):
|
|
239
|
-
"""#159: virtual function dispatch has problems with similar-named functions"""
|
|
240
|
-
|
|
241
|
-
class PyClass1(m.DispatchIssue):
|
|
242
|
-
def dispatch(self):
|
|
243
|
-
return "Yay.."
|
|
244
|
-
|
|
245
|
-
class PyClass2(m.DispatchIssue):
|
|
246
|
-
def dispatch(self):
|
|
247
|
-
with pytest.raises(RuntimeError) as excinfo:
|
|
248
|
-
super(PyClass2, self).dispatch()
|
|
249
|
-
assert (
|
|
250
|
-
msg(excinfo.value)
|
|
251
|
-
== 'Tried to call pure virtual function "Base::dispatch"'
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
return m.dispatch_issue_go(PyClass1())
|
|
255
|
-
|
|
256
|
-
b = PyClass2()
|
|
257
|
-
assert m.dispatch_issue_go(b) == "Yay.."
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
def test_override_ref():
|
|
261
|
-
"""#392/397: overriding reference-returning functions"""
|
|
262
|
-
o = m.OverrideTest("asdf")
|
|
263
|
-
|
|
264
|
-
# Not allowed (see associated .cpp comment)
|
|
265
|
-
# i = o.str_ref()
|
|
266
|
-
# assert o.str_ref() == "asdf"
|
|
267
|
-
assert o.str_value() == "asdf"
|
|
268
|
-
|
|
269
|
-
assert o.A_value().value == "hi"
|
|
270
|
-
a = o.A_ref()
|
|
271
|
-
assert a.value == "hi"
|
|
272
|
-
a.value = "bye"
|
|
273
|
-
assert a.value == "bye"
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
def test_inherited_virtuals():
|
|
277
|
-
class AR(m.A_Repeat):
|
|
278
|
-
def unlucky_number(self):
|
|
279
|
-
return 99
|
|
280
|
-
|
|
281
|
-
class AT(m.A_Tpl):
|
|
282
|
-
def unlucky_number(self):
|
|
283
|
-
return 999
|
|
284
|
-
|
|
285
|
-
obj = AR()
|
|
286
|
-
assert obj.say_something(3) == "hihihi"
|
|
287
|
-
assert obj.unlucky_number() == 99
|
|
288
|
-
assert obj.say_everything() == "hi 99"
|
|
289
|
-
|
|
290
|
-
obj = AT()
|
|
291
|
-
assert obj.say_something(3) == "hihihi"
|
|
292
|
-
assert obj.unlucky_number() == 999
|
|
293
|
-
assert obj.say_everything() == "hi 999"
|
|
294
|
-
|
|
295
|
-
for obj in [m.B_Repeat(), m.B_Tpl()]:
|
|
296
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
297
|
-
assert obj.unlucky_number() == 13
|
|
298
|
-
assert obj.lucky_number() == 7.0
|
|
299
|
-
assert obj.say_everything() == "B says hi 1 times 13"
|
|
300
|
-
|
|
301
|
-
for obj in [m.C_Repeat(), m.C_Tpl()]:
|
|
302
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
303
|
-
assert obj.unlucky_number() == 4444
|
|
304
|
-
assert obj.lucky_number() == 888.0
|
|
305
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
306
|
-
|
|
307
|
-
class CR(m.C_Repeat):
|
|
308
|
-
def lucky_number(self):
|
|
309
|
-
return m.C_Repeat.lucky_number(self) + 1.25
|
|
310
|
-
|
|
311
|
-
obj = CR()
|
|
312
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
313
|
-
assert obj.unlucky_number() == 4444
|
|
314
|
-
assert obj.lucky_number() == 889.25
|
|
315
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
316
|
-
|
|
317
|
-
class CT(m.C_Tpl):
|
|
318
|
-
pass
|
|
319
|
-
|
|
320
|
-
obj = CT()
|
|
321
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
322
|
-
assert obj.unlucky_number() == 4444
|
|
323
|
-
assert obj.lucky_number() == 888.0
|
|
324
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
325
|
-
|
|
326
|
-
class CCR(CR):
|
|
327
|
-
def lucky_number(self):
|
|
328
|
-
return CR.lucky_number(self) * 10
|
|
329
|
-
|
|
330
|
-
obj = CCR()
|
|
331
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
332
|
-
assert obj.unlucky_number() == 4444
|
|
333
|
-
assert obj.lucky_number() == 8892.5
|
|
334
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
335
|
-
|
|
336
|
-
class CCT(CT):
|
|
337
|
-
def lucky_number(self):
|
|
338
|
-
return CT.lucky_number(self) * 1000
|
|
339
|
-
|
|
340
|
-
obj = CCT()
|
|
341
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
342
|
-
assert obj.unlucky_number() == 4444
|
|
343
|
-
assert obj.lucky_number() == 888000.0
|
|
344
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
345
|
-
|
|
346
|
-
class DR(m.D_Repeat):
|
|
347
|
-
def unlucky_number(self):
|
|
348
|
-
return 123
|
|
349
|
-
|
|
350
|
-
def lucky_number(self):
|
|
351
|
-
return 42.0
|
|
352
|
-
|
|
353
|
-
for obj in [m.D_Repeat(), m.D_Tpl()]:
|
|
354
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
355
|
-
assert obj.unlucky_number() == 4444
|
|
356
|
-
assert obj.lucky_number() == 888.0
|
|
357
|
-
assert obj.say_everything() == "B says hi 1 times 4444"
|
|
358
|
-
|
|
359
|
-
obj = DR()
|
|
360
|
-
assert obj.say_something(3) == "B says hi 3 times"
|
|
361
|
-
assert obj.unlucky_number() == 123
|
|
362
|
-
assert obj.lucky_number() == 42.0
|
|
363
|
-
assert obj.say_everything() == "B says hi 1 times 123"
|
|
364
|
-
|
|
365
|
-
class DT(m.D_Tpl):
|
|
366
|
-
def say_something(self, times):
|
|
367
|
-
return "DT says:" + (" quack" * times)
|
|
368
|
-
|
|
369
|
-
def unlucky_number(self):
|
|
370
|
-
return 1234
|
|
371
|
-
|
|
372
|
-
def lucky_number(self):
|
|
373
|
-
return -4.25
|
|
374
|
-
|
|
375
|
-
obj = DT()
|
|
376
|
-
assert obj.say_something(3) == "DT says: quack quack quack"
|
|
377
|
-
assert obj.unlucky_number() == 1234
|
|
378
|
-
assert obj.lucky_number() == -4.25
|
|
379
|
-
assert obj.say_everything() == "DT says: quack 1234"
|
|
380
|
-
|
|
381
|
-
class DT2(DT):
|
|
382
|
-
def say_something(self, times):
|
|
383
|
-
return "DT2: " + ("QUACK" * times)
|
|
384
|
-
|
|
385
|
-
def unlucky_number(self):
|
|
386
|
-
return -3
|
|
387
|
-
|
|
388
|
-
class BT(m.B_Tpl):
|
|
389
|
-
def say_something(self, times):
|
|
390
|
-
return "BT" * times
|
|
391
|
-
|
|
392
|
-
def unlucky_number(self):
|
|
393
|
-
return -7
|
|
394
|
-
|
|
395
|
-
def lucky_number(self):
|
|
396
|
-
return -1.375
|
|
397
|
-
|
|
398
|
-
obj = BT()
|
|
399
|
-
assert obj.say_something(3) == "BTBTBT"
|
|
400
|
-
assert obj.unlucky_number() == -7
|
|
401
|
-
assert obj.lucky_number() == -1.375
|
|
402
|
-
assert obj.say_everything() == "BT -7"
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
def test_issue_1454():
|
|
406
|
-
# Fix issue #1454 (crash when acquiring/releasing GIL on another thread in Python 2.7)
|
|
407
|
-
m.test_gil()
|
|
408
|
-
m.test_gil_from_thread()
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
# Valgrind suppression file for NumPy & SciPy errors and leaks in pybind11 tests
|
|
2
|
-
#
|
|
3
|
-
# On updating a dependency, to get a list of "default" leaks in e.g. NumPy, run
|
|
4
|
-
# `PYTHONMALLOC=malloc valgrind --leak-check=full --show-leak-kinds=definite,indirect python3.9-dbg -c "import numpy"`
|
|
5
|
-
# To use these suppression files, add e.g. `--suppressions=valgrind-numpy-scipy.supp`
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
Leaks when importing NumPy
|
|
9
|
-
Memcheck:Leak
|
|
10
|
-
fun:malloc
|
|
11
|
-
fun:_PyMem_RawMalloc
|
|
12
|
-
fun:PyObject_Malloc
|
|
13
|
-
fun:_PyObject_GC_Alloc
|
|
14
|
-
fun:_PyObject_GC_Malloc
|
|
15
|
-
fun:_PyObject_GC_NewVar
|
|
16
|
-
fun:tuple_alloc
|
|
17
|
-
fun:PyTuple_Pack
|
|
18
|
-
...
|
|
19
|
-
fun:__pyx_pymod_exec_*
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
Leaks when importing NumPy (bis)
|
|
24
|
-
Memcheck:Leak
|
|
25
|
-
fun:malloc
|
|
26
|
-
fun:_PyMem_RawMalloc
|
|
27
|
-
fun:PyObject_Malloc
|
|
28
|
-
fun:_PyObject_New
|
|
29
|
-
fun:PyCode_NewWithPosOnlyArgs
|
|
30
|
-
fun:PyCode_New
|
|
31
|
-
...
|
|
32
|
-
fun:__pyx_pymod_exec_*
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
Leaks when importing NumPy (ter)
|
|
37
|
-
Memcheck:Leak
|
|
38
|
-
fun:malloc
|
|
39
|
-
fun:_PyMem_RawMalloc
|
|
40
|
-
fun:PyObject_Malloc
|
|
41
|
-
fun:_PyObject_GC_Alloc
|
|
42
|
-
fun:_PyObject_GC_Malloc
|
|
43
|
-
fun:_PyObject_GC_NewVar
|
|
44
|
-
fun:tuple_alloc
|
|
45
|
-
fun:_PyTuple_FromArray
|
|
46
|
-
fun:_PyObject_MakeTpCall
|
|
47
|
-
fun:_PyObject_VectorcallTstate
|
|
48
|
-
fun:PyObject_Vectorcall
|
|
49
|
-
fun:call_function
|
|
50
|
-
fun:_PyEval_EvalFrameDefault
|
|
51
|
-
fun:_PyEval_EvalFrame
|
|
52
|
-
fun:function_code_fastcall
|
|
53
|
-
fun:_PyFunction_Vectorcall
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
Leaks when importing NumPy (quater)
|
|
58
|
-
Memcheck:Leak
|
|
59
|
-
fun:malloc
|
|
60
|
-
fun:_PyMem_RawMalloc
|
|
61
|
-
fun:PyObject_Malloc
|
|
62
|
-
fun:_PyObject_GC_Alloc
|
|
63
|
-
fun:_PyObject_GC_Malloc
|
|
64
|
-
fun:_PyObject_GC_NewVar
|
|
65
|
-
fun:tuple_alloc
|
|
66
|
-
fun:_PyTuple_FromArray
|
|
67
|
-
fun:_PyObject_MakeTpCall
|
|
68
|
-
fun:_PyObject_VectorcallTstate
|
|
69
|
-
fun:_PyObject_CallFunctionVa
|
|
70
|
-
fun:PyObject_CallFunction
|
|
71
|
-
fun:PyImport_Import
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
{
|
|
75
|
-
Leaks when importing NumPy (quinquies)
|
|
76
|
-
Memcheck:Leak
|
|
77
|
-
fun:malloc
|
|
78
|
-
fun:_PyMem_RawMalloc
|
|
79
|
-
fun:PyObject_Malloc
|
|
80
|
-
fun:_PyObject_GC_Alloc
|
|
81
|
-
fun:_PyObject_GC_Malloc
|
|
82
|
-
fun:_PyObject_GC_NewVar
|
|
83
|
-
fun:tuple_alloc
|
|
84
|
-
fun:PyTuple_New
|
|
85
|
-
fun:r_object
|
|
86
|
-
fun:r_object
|
|
87
|
-
fun:r_object
|
|
88
|
-
fun:r_object
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
Leaks when importing NumPy (sexies)
|
|
93
|
-
Memcheck:Leak
|
|
94
|
-
fun:malloc
|
|
95
|
-
fun:_PyMem_RawMalloc
|
|
96
|
-
fun:PyObject_Malloc
|
|
97
|
-
fun:_PyObject_GC_Alloc
|
|
98
|
-
fun:_PyObject_GC_Malloc
|
|
99
|
-
fun:_PyObject_GC_NewVar
|
|
100
|
-
fun:tuple_alloc
|
|
101
|
-
fun:PyTuple_New
|
|
102
|
-
fun:dictiter_iternextitem
|
|
103
|
-
fun:list_extend
|
|
104
|
-
fun:_PyList_Extend
|
|
105
|
-
fun:PySequence_List
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
Leak when importing scipy.fft
|
|
110
|
-
Memcheck:Leak
|
|
111
|
-
fun:_Znwm
|
|
112
|
-
fun:PyInit_pypocketfft
|
|
113
|
-
fun:_PyImport_LoadDynamicModuleWithSpec
|
|
114
|
-
fun:_imp_create_dynamic_impl*
|
|
115
|
-
fun:_imp_create_dynamic
|
|
116
|
-
fun:cfunction_vectorcall_FASTCALL
|
|
117
|
-
fun:PyVectorcall_Call
|
|
118
|
-
fun:_PyObject_Call
|
|
119
|
-
fun:PyObject_Call
|
|
120
|
-
fun:do_call_core
|
|
121
|
-
fun:_PyEval_EvalFrameDefault
|
|
122
|
-
fun:_PyEval_EvalFrame
|
|
123
|
-
fun:_PyEval_EvalCode
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
{
|
|
127
|
-
NumPy leaks when spawning a subprocess
|
|
128
|
-
Memcheck:Leak
|
|
129
|
-
fun:malloc
|
|
130
|
-
...
|
|
131
|
-
fun:_buffer_get_info
|
|
132
|
-
fun:array_getbuffer
|
|
133
|
-
fun:PyObject_GetBuffer
|
|
134
|
-
fun:__Pyx__GetBufferAndValidate*
|
|
135
|
-
fun:__pyx_f_5numpy_6random_13bit_generator_12SeedSequence_mix_entropy
|
|
136
|
-
fun:__pyx_pw_5numpy_6random_13bit_generator_12SeedSequence_1__init__
|
|
137
|
-
fun:type_call
|
|
138
|
-
fun:__Pyx__PyObject_CallOneArg
|
|
139
|
-
fun:__pyx_pw_5numpy_6random_13bit_generator_12BitGenerator_1__init__
|
|
140
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# Valgrind suppression file for CPython errors and leaks in pybind11 tests
|
|
2
|
-
|
|
3
|
-
# Taken verbatim from https://github.com/python/cpython/blob/3.9/Misc/valgrind-python.supp#L266-L272
|
|
4
|
-
{
|
|
5
|
-
Uninitialised byte(s) false alarm, see bpo-35561
|
|
6
|
-
Memcheck:Param
|
|
7
|
-
epoll_ctl(event)
|
|
8
|
-
fun:epoll_ctl
|
|
9
|
-
fun:pyepoll_internal_ctl
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
Python leaks when spawning a subprocess
|
|
14
|
-
Memcheck:Leak
|
|
15
|
-
fun:malloc
|
|
16
|
-
fun:_PyMem_RawMalloc
|
|
17
|
-
fun:PyMem_RawMalloc
|
|
18
|
-
fun:PyThread_allocate_lock
|
|
19
|
-
fun:_PyEval_InitState
|
|
20
|
-
fun:PyInterpreterState_New
|
|
21
|
-
...
|
|
22
|
-
fun:pyinit_core*
|
|
23
|
-
fun:Py_InitializeFromConfig
|
|
24
|
-
fun:pymain_init
|
|
25
|
-
fun:pymain_main
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
Python leaks when spawning a subprocess
|
|
30
|
-
Memcheck:Leak
|
|
31
|
-
fun:malloc
|
|
32
|
-
fun:_PyMem_RawMalloc
|
|
33
|
-
fun:_PyMem_DebugRawAlloc
|
|
34
|
-
fun:_PyMem_DebugRawMalloc
|
|
35
|
-
fun:PyMem_RawMalloc
|
|
36
|
-
fun:PyThread_allocate_lock
|
|
37
|
-
fun:_PyRuntimeState_Init_impl
|
|
38
|
-
fun:_PyRuntimeState_Init
|
|
39
|
-
fun:_PyRuntime_Initialize
|
|
40
|
-
fun:pymain_init
|
|
41
|
-
fun:pymain_main
|
|
42
|
-
fun:Py_BytesMain
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
Python leaks when spawning a subprocess
|
|
47
|
-
Memcheck:Leak
|
|
48
|
-
fun:malloc
|
|
49
|
-
fun:_PyMem_RawMalloc
|
|
50
|
-
fun:PyMem_RawMalloc
|
|
51
|
-
fun:PyThread_allocate_lock
|
|
52
|
-
fun:_PyImport_AcquireLock
|
|
53
|
-
fun:_imp_acquire_lock_impl*
|
|
54
|
-
fun:_imp_acquire_lock
|
|
55
|
-
fun:cfunction_vectorcall_NOARGS
|
|
56
|
-
fun:_PyObject_VectorcallTstate
|
|
57
|
-
fun:PyObject_Vectorcall
|
|
58
|
-
fun:call_function
|
|
59
|
-
fun:_PyEval_EvalFrameDefault
|
|
60
|
-
fun:_PyEval_EvalFrame
|
|
61
|
-
fun:function_code_fastcall
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
Python leaks when spawning a subprocess
|
|
66
|
-
Memcheck:Leak
|
|
67
|
-
fun:malloc
|
|
68
|
-
fun:_PyMem_RawMalloc
|
|
69
|
-
fun:PyMem_RawMalloc
|
|
70
|
-
fun:PyThread_allocate_lock
|
|
71
|
-
fun:newlockobject
|
|
72
|
-
...
|
|
73
|
-
fun:cfunction_vectorcall_NOARGS
|
|
74
|
-
fun:_PyObject_VectorcallTstate
|
|
75
|
-
fun:PyObject_Vectorcall
|
|
76
|
-
fun:call_function
|
|
77
|
-
fun:_PyEval_EvalFrameDefault
|
|
78
|
-
fun:_PyEval_EvalFrame
|
|
79
|
-
fun:function_code_fastcall
|
|
80
|
-
fun:_PyFunction_Vectorcall
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
{
|
|
84
|
-
Python leaks when spawning a subprocess
|
|
85
|
-
Memcheck:Leak
|
|
86
|
-
fun:malloc
|
|
87
|
-
fun:_PyMem_RawMalloc
|
|
88
|
-
fun:PyMem_RawMalloc
|
|
89
|
-
fun:PyThread_allocate_lock
|
|
90
|
-
fun:rlock_new
|
|
91
|
-
fun:type_call
|
|
92
|
-
fun:_PyObject_Call
|
|
93
|
-
fun:PyObject_Call
|
|
94
|
-
fun:do_call_core
|
|
95
|
-
fun:_PyEval_EvalFrameDefault
|
|
96
|
-
fun:_PyEval_EvalFrame
|
|
97
|
-
fun:_PyEval_EvalCode
|
|
98
|
-
fun:_PyFunction_Vectorcall
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
# Not really CPython-specific, see link
|
|
102
|
-
{
|
|
103
|
-
dlopen leak (https://stackoverflow.com/questions/1542457/memory-leak-reported-by-valgrind-in-dlopen)
|
|
104
|
-
Memcheck:Leak
|
|
105
|
-
fun:malloc
|
|
106
|
-
...
|
|
107
|
-
fun:dl_open_worker
|
|
108
|
-
fun:_dl_catch_exception
|
|
109
|
-
fun:_dl_open
|
|
110
|
-
fun:dlopen_doit
|
|
111
|
-
fun:_dl_catch_exception
|
|
112
|
-
fun:_dl_catch_error
|
|
113
|
-
fun:_dlerror_run
|
|
114
|
-
fun:dlopen@@GLIBC_2.2.5
|
|
115
|
-
fun:_PyImport_FindSharedFuncptr
|
|
116
|
-
fun:_PyImport_LoadDynamicModuleWithSpec
|
|
117
|
-
}
|