Skip to content

Commit

Permalink
Suppress numpy warnings in lmfit
Browse files Browse the repository at this point in the history
  • Loading branch information
nkanazawa1989 committed Aug 31, 2023
1 parent 17bcc19 commit 88b8086
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions qiskit_experiments/curve_analysis/curve_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,15 @@ def _objective(_params):
)

try:
new = lmfit.minimize(
fcn=_objective,
params=guess_params,
method=self.options.fit_method,
scale_covar=not valid_uncertainty,
nan_policy="omit",
**fit_option.fitter_opts,
)
with np.errstate(all="ignore"):
new = lmfit.minimize(
fcn=_objective,
params=guess_params,
method=self.options.fit_method,
scale_covar=not valid_uncertainty,
nan_policy="omit",
**fit_option.fitter_opts,
)
except Exception: # pylint: disable=broad-except
continue

Expand Down

0 comments on commit 88b8086

Please sign in to comment.