Skip to content

Commit

Permalink
Merge branch 'main' into fixing-the-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] committed May 17, 2022
2 parents b505948 + 6ca91a3 commit 50f9d46
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Examples/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@ else()
endif()

add_custom_target(ActsPythonGlueCode)
configure_file(setup.sh.in ${_python_dir}/setup.sh COPYONLY)
configure_file(setup.sh.in ${_python_dir}/setup.sh @ONLY)
install(FILES setup.sh.in DESTINATION "python" RENAME setup.sh)


foreach(f ${py_files})
set(_target ${_python_dir}/acts/${f})
get_filename_component(_dir ${_target} DIRECTORY)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/python/acts/examples/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def dump_args_calls(
import collections

for n in dir(mod):
if n.startswith("_") or n == "Config":
if n.startswith("_") or n == "Config" or n == "Interval":
continue
f = getattr(mod, n)
if not (
Expand Down
29 changes: 27 additions & 2 deletions Examples/Python/setup.sh.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# This file is part of the Acts project.
#
# Copyright (C) 2021-2022 CERN for the benefit of the Acts project
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

export PYTHONPATH=$python_dir:$PYTHONPATH
# This script sets up the ACTS Python bindings in the environment in a somewhat
# robust way.

if [ -n "$ZSH_VERSION" ]; then
export PYTHONPATH=${0:a:h}:$PYTHONPATH
elif [ -n "$BASH_VERSION" ]; then
python_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export PYTHONPATH=$python_dir:$PYTHONPATH
else
# If the current shell is not ZSH or Bash, we can't guarantee that the
# script will work, so we throw an error.
echo "ERROR: neither ZSH nor Bash was detected, other shells are not supported. The environment has not been modified."
exit 1
fi

# This message might seem excessive, but the Acts bindings are only installed
# for one Python version, and it is not trivial for the user to find out which.
# Thus, we let them know explicitly so they can more easily debug any potential
# import errors.
echo "INFO: Acts Python @Python_VERSION_MAJOR@.@Python_VERSION_MINOR@ bindings setup complete."
6 changes: 5 additions & 1 deletion Examples/Scripts/Python/full_chain_itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
geo_dir = pathlib.Path("acts-itk")
outputDir = pathlib.Path.cwd()

# acts.examples.dump_args_calls(locals())
detector, trackingGeometry, decorators = itk.buildITkGeometry(geo_dir)
field = acts.ConstantBField(acts.Vector3(0.0, 0.0, 2.0 * u.T))
rnd = acts.examples.RandomNumbers(seed=42)

from particle_gun import addParticleGun, MomentumConfig, EtaConfig, ParticleConfig
from fatras import addFatras
from digitization import addDigitization
from seeding import addSeeding, SeedingAlgorithm, TruthSeedRanges
from seeding import addSeeding, TruthSeedRanges
from ckf_tracks import addCKFTracks, CKFPerformanceConfig

s = acts.examples.Sequencer(events=100, numThreads=-1)
Expand All @@ -38,11 +39,14 @@
outputDirRoot=outputDir,
rnd=rnd,
)
# from seeding import SeedingAlgorithm, ParticleSmearingSigmas
s = addSeeding(
s,
trackingGeometry,
field,
TruthSeedRanges(pt=(1.0 * u.GeV, None), eta=(-4.0, 4.0), nHits=(9, None)),
# SeedingAlgorithm.TruthEstimated,
# SeedingAlgorithm.TruthSmeared, ParticleSmearingSigmas(pRel=0.01), rnd=rnd,
geoSelectionConfigFile=geo_dir / "itk-hgtd/geoSelection-ITk.json",
outputDirRoot=outputDir,
)
Expand Down

0 comments on commit 50f9d46

Please sign in to comment.