Skip to content

Commit add0d93

Browse files
committed
Extend apply-tool hack to prefix for now
1 parent 8902c7f commit add0d93

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/ctapipe/tools/apply_models.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,20 @@ def setup(self):
153153
for path in self.reconstructor_paths:
154154
r = Reconstructor.read(path, parent=self, subarray=self.loader.subarray)
155155

156-
# Init new Reconstructor with config parameters and overwrite the StereoCombiner
156+
# Init new Reconstructor with config parameters and
157+
# overwrite the StereoCombiner and prefix
157158
model_keys = ["model_cls", "norm_cls", "sign_cls"]
158159
model_kwargs = {
159160
key: getattr(r, key) for key in model_keys if hasattr(r, key)
160161
}
161-
r.stereo_combiner = Reconstructor.from_name(
162+
r_new = Reconstructor.from_name(
162163
r.__class__.__name__,
163164
subarray=self.loader.subarray,
164165
parent=self,
165-
prefix=r.prefix,
166166
**model_kwargs,
167-
).stereo_combiner
167+
)
168+
r.stereo_combiner = r_new.stereo_combiner
169+
r.prefix = r_new.prefix
168170

169171
if self.n_jobs:
170172
r.n_jobs = self.n_jobs

0 commit comments

Comments
 (0)