Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6cdb95d
move of first modules
asalzburger Oct 10, 2025
c23138a
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 10, 2025
957ce93
lintify
asalzburger Oct 10, 2025
01e4d94
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 10, 2025
72fe7bc
fix Covfie dep
asalzburger Oct 10, 2025
648825c
CMakeLists fix
asalzburger Oct 10, 2025
b95ec87
adding logging module
asalzburger Oct 10, 2025
002f86f
make stub know the new name
asalzburger Oct 10, 2025
98015ad
off your go
asalzburger Oct 10, 2025
7d707b7
next CI fix attempt
asalzburger Oct 11, 2025
9879e07
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 14, 2025
6ed23c2
try addressing ActsPythinBindings directly
asalzburger Oct 14, 2025
da046dc
lintify
asalzburger Oct 14, 2025
8f4fdb7
reverting import order
asalzburger Oct 14, 2025
bc51d5b
remove module adding
asalzburger Oct 14, 2025
1fc5942
lintify
asalzburger Oct 14, 2025
37484e3
make GeoModel work again
asalzburger Oct 15, 2025
2177583
next attempt, this time w/o replacement
asalzburger Oct 15, 2025
189101d
reverting init copy
asalzburger Oct 15, 2025
fd00f52
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 15, 2025
280d66d
moving geant4 and geomodel
asalzburger Oct 15, 2025
995f8b1
shifting obj to Core
asalzburger Oct 15, 2025
4b66fa6
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 15, 2025
4aa03b4
adapt geant4 library naming
asalzburger Oct 15, 2025
a7683f7
more cleanouts
asalzburger Oct 15, 2025
dbf2ecf
commit with algined dd4hep detector disabled
asalzburger Oct 15, 2025
ea4a0fa
done'ish
asalzburger Oct 16, 2025
a2117a7
lintify
asalzburger Oct 16, 2025
a2997b5
explicit import
asalzburger Oct 16, 2025
bed4efa
another try with explicit import
asalzburger Oct 16, 2025
d69a7b2
test pytest importlib flag
asalzburger Oct 17, 2025
abfb5c9
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 17, 2025
30fb14a
issue removal
asalzburger Oct 17, 2025
ee71fbd
lintify
asalzburger Oct 17, 2025
3d6f9cc
explicit test here
asalzburger Oct 17, 2025
0d22f21
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 17, 2025
5e37898
Merge branch 'main' into chore-move-Plugins-PythonBindings
asalzburger Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ jobs:
source build/this_acts_withdeps.sh
python3 -m pip install -r Examples/Python/tests/requirements.txt
python3 -m pip install pytest-md-report
pytest -rfExw -k "not gnn" -v
pytest --import-mode=importlib -rfExw -k "not gnn" -v
cat ${PYTEST_MD_REPORT_OUTPUT} >> $GITHUB_STEP_SUMMARY

linux_physmon:
Expand Down
1 change: 0 additions & 1 deletion Examples/Io/Root/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ acts_add_library(
ExamplesIoRoot
SHARED
src/RootMeasurementWriter.cpp
src/RootMaterialDecorator.cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was malplaced, it should (and now does) live in ActsPlugins/Root this is corrected here such that the Plugins python bindings are already correct.

src/RootMaterialWriter.cpp
src/RootMaterialTrackReader.cpp
src/RootMaterialTrackWriter.cpp
Expand Down
65 changes: 36 additions & 29 deletions Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ target_sources(
src/Input.cpp
src/Propagation.cpp
src/Generators.cpp
src/Obj.cpp
src/TruthTracking.cpp
src/TrackFitting.cpp
src/TrackFinding.cpp
Expand Down Expand Up @@ -97,53 +96,52 @@ if(ACTS_BUILD_PLUGIN_GEOMODEL)
Acts::ExamplesDetectorGeoModel
Acts::ExamplesMuonSpectrometerMockupDetector
)
target_sources(ActsPythonBindings PRIVATE src/GeoModel.cpp)
target_sources(ActsPythonBindings PRIVATE src/GeoModelExample.cpp)
else()
target_sources(ActsPythonBindings PRIVATE src/GeoModelStub.cpp)
endif()

if(ACTS_BUILD_PLUGIN_ROOT)
target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginRoot)
target_sources(ActsPythonBindings PRIVATE src/TGeo.cpp)
else()
target_sources(ActsPythonBindings PRIVATE src/TGeoStub.cpp)
endif()

if(ACTS_BUILD_PLUGIN_TRACCC)
target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginDetray)
target_sources(ActsPythonBindings PRIVATE src/Detray.cpp)
target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginCovfie)
target_sources(ActsPythonBindings PRIVATE src/Covfie.cpp)
target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesTraccc)
target_link_libraries(
ActsPythonBindings
PUBLIC Acts::PluginDetray Acts::PluginCovfie Acts::ExamplesTraccc
)
target_sources(ActsPythonBindings PRIVATE src/Traccc.cpp)
else()
target_sources(ActsPythonBindings PRIVATE src/DetrayStub.cpp)
target_sources(ActsPythonBindings PRIVATE src/CovfieStub.cpp)
target_sources(ActsPythonBindings PRIVATE src/TracccStub.cpp)
endif()

if(ACTS_BUILD_PLUGIN_ACTSVG)
target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoSvg)
target_sources(ActsPythonBindings PRIVATE src/Svg.cpp)
target_sources(ActsPythonBindings PRIVATE src/SvgExample.cpp)
else()
target_sources(ActsPythonBindings PRIVATE src/SvgStub.cpp)
endif()

if(ACTS_BUILD_PLUGIN_DD4HEP AND ACTS_BUILD_EXAMPLES_DD4HEP)
pybind11_add_module(ActsPythonBindingsDD4hep src/DD4hepComponent.cpp)
pybind11_add_module(ActsExamplesPythonBindingsDD4hep src/DD4hepComponent.cpp)
target_link_libraries(
ActsPythonBindingsDD4hep
ActsExamplesPythonBindingsDD4hep
PUBLIC Acts::PythonUtilities Acts::ExamplesDetectorDD4hep
)
add_dependencies(ActsPythonBindings ActsPythonBindingsDD4hep)
add_dependencies(ActsPythonBindings ActsExamplesPythonBindingsDD4hep)
add_dependencies(
ActsPluginsPythonBindingsDD4hep
ActsExamplesPythonBindingsDD4hep
)

install(TARGETS ActsPythonBindingsDD4hep DESTINATION ${_python_install_dir})
install(
TARGETS
ActsExamplesPythonBindingsDD4hep
DESTINATION
${_python_install_dir}
)
set_target_properties(
ActsPythonBindingsDD4hep
ActsExamplesPythonBindingsDD4hep
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
)
set_target_properties(
ActsPythonBindingsDD4hep
ActsExamplesPythonBindingsDD4hep
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
)
list(APPEND py_files examples/dd4hep.py)
Expand All @@ -160,24 +158,33 @@ else()
endif()

if(ACTS_BUILD_EXAMPLES_GEANT4)
pybind11_add_module(ActsPythonBindingsGeant4 src/Geant4Component.cpp)
pybind11_add_module(ActsExamplesPythonBindingsGeant4 src/Geant4Component.cpp)
target_link_libraries(
ActsPythonBindingsGeant4
ActsExamplesPythonBindingsGeant4
PUBLIC
Acts::ExamplesGeant4
Acts::ExamplesDetectorGeant4
Acts::PythonUtilities
Acts::ExamplesMuonSpectrometerMockupDetector
)
add_dependencies(ActsPythonBindings ActsPythonBindingsGeant4)
add_dependencies(ActsPythonBindings ActsExamplesPythonBindingsGeant4)
add_dependencies(
ActsPluginsPythonBindingsGeant4
ActsExamplesPythonBindingsGeant4
)

install(TARGETS ActsPythonBindingsGeant4 DESTINATION ${_python_install_dir})
install(
TARGETS
ActsExamplesPythonBindingsGeant4
DESTINATION
${_python_install_dir}
)
set_target_properties(
ActsPythonBindingsGeant4
ActsExamplesPythonBindingsGeant4
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
)
set_target_properties(
ActsPythonBindingsGeant4
ActsExamplesPythonBindingsGeant4
PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
)
list(APPEND py_files examples/geant4/__init__.py)
Expand Down
27 changes: 0 additions & 27 deletions Examples/Python/python/acts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,3 @@ def Propagator(stepper, navigator, loglevel=ActsPythonBindings.logging.INFO):


_patch_config(ActsPythonBindings)


@staticmethod
def _decoratorFromFile(file: Union[str, Path], **kwargs):
if isinstance(file, str):
file = Path(file)

kwargs.setdefault("level", ActsPythonBindings.logging.INFO)

if file.suffix in (".json", ".cbor"):
c = ActsPythonBindings.MaterialMapJsonConverter.Config()
for k in kwargs.keys():
if hasattr(c, k):
setattr(c, k, kwargs.pop(k))

return ActsPythonBindings.JsonMaterialDecorator(
jFileName=str(file), rConfig=c, **kwargs
)
elif file.suffix == ".root":
return ActsPythonBindings._examples.RootMaterialDecorator(
fileName=str(file), **kwargs
)
else:
raise ValueError(f"Unknown file type {file.suffix}")


ActsPythonBindings.IMaterialDecorator.fromFile = _decoratorFromFile
22 changes: 12 additions & 10 deletions Examples/Python/python/acts/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,14 @@ def _allmods(mod, base, found):
class CustomLogLevel(Protocol):
def __call__(
self,
minLevel: acts.logging.Level = acts.logging.VERBOSE,
maxLevel: acts.logging.Level = acts.logging.FATAL,
) -> acts.logging.Level: ...
minLevel: ActsPythonBindings.logging.Level = ActsPythonBindings.logging.VERBOSE,
maxLevel: ActsPythonBindings.logging.Level = ActsPythonBindings.logging.FATAL,
) -> ActsPythonBindings.logging.Level: ...


def defaultLogging(
s=None,
logLevel: Optional[acts.logging.Level] = None,
logLevel: Optional[ActsPythonBindings.logging.Level] = None,
) -> CustomLogLevel:
"""
Establishes a default logging strategy for the python examples interface.
Expand All @@ -374,11 +374,13 @@ def defaultLogging(
"""

def customLogLevel(
minLevel: acts.logging.Level = acts.logging.VERBOSE,
maxLevel: acts.logging.Level = acts.logging.FATAL,
) -> acts.logging.Level:
minLevel: ActsPythonBindings.logging.Level = ActsPythonBindings.logging.VERBOSE,
maxLevel: ActsPythonBindings.logging.Level = ActsPythonBindings.logging.FATAL,
) -> ActsPythonBindings.logging.Level:
l = logLevel if logLevel is not None else s.config.logLevel
return acts.logging.Level(min(maxLevel.value, max(minLevel.value, l.value)))
return ActsPythonBindings.logging.Level(
min(maxLevel.value, max(minLevel.value, l.value))
)

return customLogLevel

Expand All @@ -400,7 +402,7 @@ def __init__(self, *args, **kwargs):

kwargs["fpeMasks"] = kwargs.get("fpeMasks", []) + self._getAutoFpeMasks()

if self.config.logLevel >= acts.logging.DEBUG:
if self.config.logLevel >= ActsPythonBindings.logging.DEBUG:
self._printFpeSummary(kwargs["fpeMasks"])

cfg = self.Config()
Expand Down Expand Up @@ -443,7 +445,7 @@ def fromYaml(cls, file: Union[str, Path]) -> List["FpeMask"]:

return cls.fromDict(d)

_fpe_types_to_enum = {v.name: v for v in acts.FpeType.values}
_fpe_types_to_enum = {v.name: v for v in ActsPythonBindings.FpeType.values}

@staticmethod
def toDict(
Expand Down
15 changes: 11 additions & 4 deletions Examples/Python/python/acts/examples/dd4hep.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
# try importing and see if it works in order to provide a useful error message
try:
subprocess.check_call(
[sys.executable, "-c", "from acts import ActsPythonBindingsDD4hep"]
[
sys.executable,
"-c",
"from acts import ActsPluginsPythonBindingsDD4hep; from acts import ActsExamplesPythonBindingsDD4hep",
]
)
except subprocess.CalledProcessError as e:
print("Error encountered importing DD4hep. Likely you need to set LD_LIBRARY_PATH.")
sys.exit(1)

from acts._adapter import _patch_config
from acts import ActsPythonBindingsDD4hep
from acts import ActsPluginsPythonBindingsDD4hep
from acts.ActsPluginsPythonBindingsDD4hep import *

_patch_config(ActsPythonBindingsDD4hep)
from acts import ActsExamplesPythonBindingsDD4hep

from acts.ActsPythonBindingsDD4hep import *
_patch_config(ActsExamplesPythonBindingsDD4hep)

from acts.ActsExamplesPythonBindingsDD4hep import *
8 changes: 4 additions & 4 deletions Examples/Python/python/acts/examples/geant4/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
# try importing and see if it works in order to provide a useful error message
try:
subprocess.check_call(
[sys.executable, "-c", "from acts import ActsPythonBindingsGeant4"]
[sys.executable, "-c", "from acts import ActsExamplesPythonBindingsGeant4"]
)
except subprocess.CalledProcessError as e:
print("Error encountered importing DD4hep. Likely you need to set LD_LIBRARY_PATH.")
sys.exit(1)


from acts._adapter import _patch_config
from acts import ActsPythonBindingsGeant4
from acts import ActsExamplesPythonBindingsGeant4

_patch_config(ActsPythonBindingsGeant4)
_patch_config(ActsExamplesPythonBindingsGeant4)

from acts.ActsPythonBindingsGeant4 import *
from acts.ActsExamplesPythonBindingsGeant4 import *
3 changes: 2 additions & 1 deletion Examples/Python/python/acts/examples/odd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from pathlib import Path
from typing import Optional
import acts
from acts import root
import acts.examples
import warnings

Expand Down Expand Up @@ -89,7 +90,7 @@ def geoid_hook(geoid, surface):
return geoid

if materialDecorator is None:
materialDecorator = acts.examples.RootMaterialDecorator(
materialDecorator = acts.root.RootMaterialDecorator(
fileName=str(odd_dir / "data/odd-material-maps.root"),
level=customLogLevel(minLevel=acts.logging.WARNING),
)
Expand Down
13 changes: 0 additions & 13 deletions Examples/Python/src/CovfieStub.cpp

This file was deleted.

Loading
Loading