Skip to content

Commit f0cdf0a

Browse files
need to .item explicitly with newer numpy
1 parent 4620aaa commit f0cdf0a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

smodels/statistics/pyhfInterface.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,8 @@ def lmax( self, workspace_index=None, return_nll=False, evaluationType : NllEval
924924
if abs ( sigma_mu_temp - 1.0 ) < 1e-8: # Fischer information is nonsense
925925
#Calculate inv_hess numerically
926926
inv_hess = self.compute_invhess(o.x, workspace.data(model), model, model.config.poi_index)
927+
if isinstance(inv_hess,np.ndarray):
928+
inv_hess = inv_hess.item()
927929
sigma_mu_temp = float ( np.sqrt ( inv_hess))
928930
if abs ( sigma_mu_temp - 1.0 ) > 1e-8:
929931
sigma_mu = sigma_mu_temp * self.scale
@@ -939,6 +941,8 @@ def lmax( self, workspace_index=None, return_nll=False, evaluationType : NllEval
939941

940942
#Calculate inv_hess numerically
941943
inv_hess = self.compute_invhess(o.x, workspace.data(model), model, model.config.poi_index)
944+
if isinstance(inv_hess,np.ndarray):
945+
inv_hess = inv_hess.item()
942946
sigma_mu = float ( np.sqrt ( inv_hess)) * self.scale
943947

944948
muhat = float ( muhat[model.config.poi_index]*self.scale )

0 commit comments

Comments
 (0)