Skip to content

Commit d474c3b

Browse files
committed
add warning logging when initializing minimizer if the SoB dicts in the llh & inj dicts are different
1 parent f680b4c commit d474c3b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

flarestack/core/minimisation.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,18 @@ def __init__(self, mh_dict):
227227
f"Fixing gamma to {self.llh_gamma} for llh but injection is with {self.inj_dict['injection_energy_pdf']['gamma']}"
228228
)
229229

230+
# check if SoB spline dict is same in the llh & inj dicts
231+
if (
232+
"sob_dict" in self.inj_dict
233+
and "sob_dict" in self.llh_dict
234+
and self.llh_dict["sob_dict"] != self.inj_dict["sob_dict"]
235+
):
236+
logger.warning(
237+
"Passed 'sob_dict' aren't the same for injector and llh: "
238+
+ f"inj = {self.inj_dict['sob_dict']}, llh = {self.llh_dict['sob_dict']}"
239+
+ " Proceed with caution!"
240+
)
241+
230242
p0, bounds, names = self.return_parameter_info(mh_dict)
231243

232244
self.p0 = p0

0 commit comments

Comments
 (0)