Description
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
while checking
combiner.weights
here: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
.