Make StereoCombiner configurable in ApplyModels - #2724
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 |
| 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.
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. |
|
Superseded by #2773 |
Since the loaded joblib-pickled
Reconstructors inApplyModelsctapipe/src/ctapipe/tools/apply_models.py
Line 152 in e5999e2
StereoCombiner.Instantiating a new
Reconstructor.from_name(parent=self)and handing over itsStereoCombinerwould solve this Problem.Fixes #2720