key4hep / key4hep/k4RecTracker

Rename C++ component library to avoid Python module collision with Tracking directory

Open
#90 11 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
6
Forks
35
Avg merge
1d 3h
Merged PRs (30d)
4

Description

### Check duplicate issues.

- [x] Checked for duplicates

### Goal

The `TrackMerger` configurable relies on a generated Python module under the `Tracking` namespace (`Tracking.TrackingConf`). This causes an import failure when running frameworks like `ILDConfig` that have a local `Tracking/` directory on `sys.path`.

Python resolves `import Tracking` to `ILDConfig/StandardConfig/production/Tracking/__init__.py` instead of the CMake-generated Gaudi component package, shadowing `Tracking.TrackingConf`.

**Suggested Fix**
Rename the CMake library target in `k4RecTracker` (e.g., from `Tracking` to `k4RecTracker` or `k4RecTrackerTracking`) so that Gaudi exports configurables under a non-generic Python package name

**Error message:**
```bash
[k4run - WARNING] ConfigurableDb.getConfigurable: : Module Tracking.TrackingConf not found (needed for configurable TrackMerger)
...
File "/home/user/code/ILDConfig/StandardConfig/production/ILDReconstruction.py", line 289, in
sequenceLoader.load("Tracking/TrackMerging_FCCee")
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/code/ILDConfig/StandardConfig/production/py_utils.py", line 136, in load
seq_module = import_from(
filename,
global_vars=self.global_vars,
)
File "/home/user/code/ILDConfig/StandardConfig/production/py_utils.py", line 48, in import_from
loader.exec_module(m File "/home/user/code/ILDConfig/StandardConfig/production/ILDReconstruction.py", line 289, in
sequenceLoader.load("Tracking/TrackMerging_FCCee")
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/code/ILDConfig/StandardConfig/production/py_utils.py", line 136, in load
seq_module = import_from(
filename,
global_vars=self.global_vars,
)
File "/home/user/code/ILDConfig/StandardConfig/production/py_utils.py", line 48, in import_from
loader.exec_module(module)
~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 1027, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/user/code/ILDConfig/StandardConfig/production/Tracking/TrackMerging_FCCee.py", line 136, in
merger = TrackMerger(
f"{track_type}TrackMerger",
...<4 lines>...
**var["merger"].get("thresholds", {}),
)odule)
~~~~~~~~~~~~~~~~~~^^^^^^^^
File "", line 1027, in exec_module
File "", line 488, in _call_with_frames_removed
File "/home/user/code/ILDConfig/StandardConfig/production/Tracking/TrackMerging_FCCee.py", line 136, in
merger = TrackMerger(
f"{track_type}TrackMerger",
...<4 lines>...
**var["merger"].get("thresholds", {}),
)
TypeError: 'NoneType' object is not callable
```

### Operating System and Version

Ubuntu 24.04.4 LTS

### compiler

does not matter

### The version of the key4hep stack

nightlies 04.08.2026

### Package Version

from above nightlies

### Reproducer

```console
$ ipython
$ import sys, Tracking
$ print("Tracking package location:", Tracking.__file__)
Tracking package location: /home/user/code/ILDConfig/StandardConfig/production/Tracking/__init__.py
```
(This should be the `k4RecTracker` package...)

A reproducer of the bug when run the ILD Reco is available if necessary upon request

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by locating the CMake library target in k4RecTracker and inspect how it exports the generated Python configurable package. Reproduce the collision with the `ipython` import check and trace `Tracking/TrackMerging_FCCee.py` through `ILDConfig`'s `py_utils.py`. Done means the generated package has a non-generic import name and `TrackMerger` loads without the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, python
Domain
backend, build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.