Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception to non-scalar passsed to solver.optimizer #753 #789

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nutils/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ def _optimize(target, functional: evaluable.asarray, constrain, arguments, tol:
dtype = _determine_dtype(target, (functional,), lhs0, constrain)
mask, vmask = _invert(constrain, target)
lhs, vlhs = _redict(lhs0, target, dtype)
if functional.shape != ():
Sbhat92 marked this conversation as resolved.
Show resolved Hide resolved
raise ValueError('The objective function must be a scalar function of a single variable')
Sbhat92 marked this conversation as resolved.
Show resolved Hide resolved
val, res, jac = _integrate_blocks(functional, residual, jacobian, arguments=lhs, mask=mask)
if droptol is not None:
supp = jac.rowsupp(droptol)
Expand Down