Skip to content

Commit 88b8086

Browse files
committed
Suppress numpy warnings in lmfit
1 parent 17bcc19 commit 88b8086

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

qiskit_experiments/curve_analysis/curve_analysis.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,15 @@ def _objective(_params):
361361
)
362362

363363
try:
364-
new = lmfit.minimize(
365-
fcn=_objective,
366-
params=guess_params,
367-
method=self.options.fit_method,
368-
scale_covar=not valid_uncertainty,
369-
nan_policy="omit",
370-
**fit_option.fitter_opts,
371-
)
364+
with np.errstate(all="ignore"):
365+
new = lmfit.minimize(
366+
fcn=_objective,
367+
params=guess_params,
368+
method=self.options.fit_method,
369+
scale_covar=not valid_uncertainty,
370+
nan_policy="omit",
371+
**fit_option.fitter_opts,
372+
)
372373
except Exception: # pylint: disable=broad-except
373374
continue
374375

0 commit comments

Comments
 (0)