Skip to content

Commit ee56ec6

Browse files
committed
adjust to ignore zeroing out corr/cov for minuit, since it already handles this
1 parent 474bd1a commit ee56ec6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/pyhf/optimize/mixins.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,8 @@ def _internal_postprocess(
128128
cov = hess_inv
129129

130130
# we also need to edit the covariance matrix to zero-out uncertainties!
131-
if fixed_vals is not None:
132-
if using_minuit:
133-
fixed_bools = fitresult.minuit.fixed
134-
else:
135-
fixed_bools = [False] * len(init_pars)
131+
if fixed_vals is not None and not using_minuit: # minuit already does this
132+
fixed_bools = [False] * len(init_pars)
136133
# Convert fixed_bools to a numpy array and reshape to make it a column vector
137134
fixed_mask = tensorlib.reshape(
138135
tensorlib.astensor(fixed_bools, dtype="bool"), (-1, 1)
@@ -158,7 +155,7 @@ def _internal_postprocess(
158155
tensorlib.astensor(0.0),
159156
)
160157

161-
if correlations_from_fit is not None:
158+
if correlations_from_fit is not None and not using_minuit:
162159
_zeros = tensorlib.zeros(num_fixed_pars)
163160
# possibly a more elegant way to do this
164161
stitched_columns = [

0 commit comments

Comments
 (0)