From 4ebf3e5e5e15de170e55dec99d88163198c9cc01 Mon Sep 17 00:00:00 2001 From: Nathan Simpson Date: Mon, 14 Aug 2023 13:00:41 +0100 Subject: [PATCH] adjust to ignore zeroing out corr/cov for minuit, since it already handles this --- src/pyhf/optimize/mixins.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pyhf/optimize/mixins.py b/src/pyhf/optimize/mixins.py index 0504ae1d18..3d78af7cce 100644 --- a/src/pyhf/optimize/mixins.py +++ b/src/pyhf/optimize/mixins.py @@ -128,11 +128,8 @@ def _internal_postprocess( cov = hess_inv # we also need to edit the covariance matrix to zero-out uncertainties! - if fixed_vals is not None: - if using_minuit: - fixed_bools = fitresult.minuit.fixed - else: - fixed_bools = [False] * len(init_pars) + if fixed_vals is not None and not using_minuit: # minuit already does this + fixed_bools = [False] * len(init_pars) # Convert fixed_bools to a numpy array and reshape to make it a column vector fixed_mask = tensorlib.reshape( tensorlib.astensor(fixed_bools, dtype="bool"), (-1, 1) @@ -158,7 +155,7 @@ def _internal_postprocess( tensorlib.astensor(0.0), ) - if correlations_from_fit is not None: + if correlations_from_fit is not None and not using_minuit: _zeros = tensorlib.zeros(num_fixed_pars) # possibly a more elegant way to do this stitched_columns = [