Skip to content

Stop emitting misleading warning when constructing results of a fit with daemon_flux parameters#957

Open
thehrh wants to merge 1 commit into
masterfrom
fix/metric_val_consistency_check_in_HypoFitResult_construction
Open

Stop emitting misleading warning when constructing results of a fit with daemon_flux parameters#957
thehrh wants to merge 1 commit into
masterfrom
fix/metric_val_consistency_check_in_HypoFitResult_construction

Conversation

@thehrh

@thehrh thehrh commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

When performing the sanity check on the metric value: Summing all the individual prior contributions was wrong, and so was the associated warning.

The detailed metric info should have been extended by the correct calculation by ParamSet.priors_penalty instead, which it now includes and uses (if available: old fit results won't have the "priors_penalty_total" entry/entries but still need to be supported—though without any comparison between metric values now).

In the Detectors case, each DistributionMaker's detailed metric info will also contain the new entry, but we still can't just add these up due to the possible existence of shared parameters.

No unit tests are added here, but I've tested the following manually:

  • at the end of a fit using a Pipeline with or without free daemon_flux-parameters (I modified IceCube_3y_oscillations_example.ipynb for this):
    • no warning is emitted
    • result.detailed_metric_info["mod_chi2"]["priors_penalty_total"] indeed contains a value that when added to result.detailed_metric_info["mod_chi2"]["maps"]["total"] agrees with result.metric_val
  • in the case of the Detectors fit in Multi_detector_test.ipynb:
    • as expected, there are two identical entries for "priors_penalty_total"
    • also: 2 * result.detailed_metric_info[0]["mod_chi2"]["maps"]["total"] + result.detailed_metric_info[0]["mod_chi2"]["priors_penalty_total"] yields the same value as result.metric_val
      (The first expression isn't generally valid, just in the special notebook scenario.)

… total in all cases (that don't constitute a Detectors fit result)
@thehrh thehrh added this to the 4.3 milestone Jun 18, 2026
@thehrh thehrh requested a review from JanWeldert June 18, 2026 16:50
@thehrh thehrh marked this pull request as ready for review June 18, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant