Skip to content

Commit

Permalink
Merge pull request #331 from lbl-anp/fix-numpy-complex-dep-warning
Browse files Browse the repository at this point in the history
Fix numpy complex dtype deprecation warning
  • Loading branch information
jccurtis committed Apr 4, 2022
2 parents ea70c32 + 119092c commit 479a264
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion becquerel/core/fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ def _likelihood_residual(self, params, data, weights, **kwargs):
mask = model <= 0 # This should not be necessary
diff = model - scipy.special.xlogy(data, model)
diff[mask] = 1e32
if diff.dtype == np.complex:
if np.issubdtype(diff.dtype, complex):
# data/model are complex
diff = diff.ravel().view(float)
return np.asarray(diff).ravel() # for compatibility with pandas.Series
Expand Down

0 comments on commit 479a264

Please sign in to comment.