Skip to content

Commit

Permalink
grad_complex.py: np.complex -> complex (anyoptimization#407)
Browse files Browse the repository at this point in the history
```output
E           AttributeError: module 'numpy' has no attribute 'complex'.
E           `np.complex` was a deprecated alias for the builtin `complex`. To avoid this error in existing code, use `complex` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.complex128` here.
E           The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E               https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations. Did you mean: 'complex_'?
```
  • Loading branch information
veprbl authored Apr 3, 2023
1 parent 9b0d425 commit a984a0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pymoo/gradient/grad_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def calc_complex_gradient(problem, return_values_of, x, eps, *args, **kwargs):
xp = x + np.eye(len(x)) * np.complex(0, eps)
xp = x + np.eye(len(x)) * complex(0, eps)
out = problem.do(xp, return_values_of, *args, **kwargs)

grad = {}
Expand Down

0 comments on commit a984a0a

Please sign in to comment.