-
Notifications
You must be signed in to change notification settings - Fork 273
Make StereoCombiner configurable in ApplyModels #2724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Init new reconstructor with parent=self - Not working yet with DispReconstructor bc of different arguments
This comment has been minimized.
This comment has been minimized.
1 similar comment
Analysis Details0 IssuesCoverage and DuplicationsProject ID: cta-observatory_ctapipe_AY52EYhuvuGcMFidNyUs |
@@ -149,7 +149,25 @@ def setup(self): | |||
|
|||
self._reconstructors = [] | |||
for path in self.reconstructor_paths: | |||
r = Reconstructor.read(path, parent=self, subarray=self.loader.subarray) | |||
r = Reconstructor.read( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems very hacky... Isn't there a better solution for this?
I think we should rather re-evaluate how we store the models on disk / read them back. Pickling the whole |
One could maybe
which is called on its
in Can't really think of a better solution yet... |
I never liked that the whole reconstructor was pickled in the first place - it's easy, but also makes it very hard to customize how we store the models in the future, i.e. if we want to use some standard format. Decoupling how we store the models from the Reconstructor would be the best way, but that also requires a bit of thought and a lot of refactoring. E.g. how to know which reconstructor to construct before loading the model? How to store the parameter list? One way would be to change what is actually serialized in |
How about, instead of pickling the whole I know, that this is not much different from pickling the whole |
The dict is good I think, like that we can also attach a |
Ok, I'll get on this and open a second PR, since this is a bit wider in scope than this PR. |
Maybe it's also time to give https://onnx.ai/sklearn-onnx/ a shot again and not rely on pickle. |
Since the loaded joblib-pickled
Reconstructor
s inApplyModels
ctapipe/src/ctapipe/tools/apply_models.py
Line 152 in e5999e2
StereoCombiner
.Instantiating a new
Reconstructor.from_name(parent=self)
and handing over itsStereoCombiner
would solve this Problem.Fixes #2720