Skip to content

Commit 625a6b4

Browse files
ignore warnings in pyhf
1 parent a1be7bc commit 625a6b4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

smodels/statistics/pyhfInterface.py

+2
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ def lmax( self, workspace_index=None, return_nll=False, expected=False,
905905
else:
906906
sigma_mu_temp = 1.
907907
try:
908+
warnings.filterwarnings( "ignore", category=RuntimeWarning )
908909
_1, _2, o = pyhf.infer.mle.fit(workspace.data(model), model,
909910
return_fitted_val=True, return_result_obj = True, init_pars = list(muhat), method="BFGS" )
910911
sigma_mu_temp = float ( np.sqrt ( o.hess_inv[model.config.poi_index][model.config.poi_index] ) )
@@ -913,6 +914,7 @@ def lmax( self, workspace_index=None, return_nll=False, expected=False,
913914
if abs ( sigma_mu_temp - 1.0 ) > 1e-5:
914915
sigma_mu = sigma_mu_temp * self.scale
915916
else:
917+
warnings.filterwarnings( "ignore", category=RuntimeWarning )
916918
_, _, o = pyhf.infer.mle.fit(workspace.data(model), model,
917919
return_fitted_val=True, return_result_obj = True, method="L-BFGS-B" )
918920
sigma_mu_temp = float ( np.sqrt ( o.hess_inv.todense()[model.config.poi_index][model.config.poi_index] ) )

0 commit comments

Comments
 (0)