Describe the bug
When using the ApplyModels tool, configuration values set via the command line (e.g., --EnergyRegressor.stereo_combiner.weights=intensity) or given as input in a config file are not applied to the loaded Reconstructor instances.
I think this issue is caused by the way the Reconstructor models are loaded using
Reconstructor.read(path, parent=self, subarray=self.loader.subarray).
Since these instances are deserialized from a joblib file, their attributes are not automatically updated with values from the ApplyModels configuration.
To Reproduce
Steps to reproduce the behavior:
pytest -s src/ctapipe/tools/tests/test_apply_models.py::test_apply_energy_regressor
which includes
|
"--StereoMeanCombiner.weights=konrad", |
while checking
combiner.weights here:
|
combiner = reconstructor.stereo_combiner |
(weights are set to default value = "none" )
Expected behavior
Configuration values specified via CLI or config files should be properly applied to all components of a loaded Reconstructor.
Describe the bug
When using the
ApplyModelstool, configuration values set via the command line (e.g.,--EnergyRegressor.stereo_combiner.weights=intensity) or given as input in a config file are not applied to the loaded Reconstructor instances.I think this issue is caused by the way the
Reconstructormodels are loaded usingReconstructor.read(path, parent=self, subarray=self.loader.subarray).Since these instances are deserialized from a joblib file, their attributes are not automatically updated with values from the
ApplyModelsconfiguration.To Reproduce
Steps to reproduce the behavior:
which includes
ctapipe/src/ctapipe/tools/tests/test_apply_models.py
Line 34 in e5999e2
while checking
combiner.weightshere:ctapipe/src/ctapipe/tools/apply_models.py
Line 238 in e5999e2
(weights are set to default value = "none" )
Expected behavior
Configuration values specified via CLI or config files should be properly applied to all components of a loaded
Reconstructor.