Skip to content

Commit

Permalink
MAINT: make sure the constraint is a vector
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfaff committed Feb 8, 2024
1 parent 51c6473 commit 496fd87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scipy/optimize/_differentialevolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ def fun(x):
if x.ndim == 1 and res.ndim == 2:
# deal with case that constraint.A is an np.matrix
# see gh20041
res = res[:, 0]
res = np.squeeze(np.asarray(res[:, 0]))

return res
elif isinstance(constraint, Bounds):
Expand Down

0 comments on commit 496fd87

Please sign in to comment.