Skip to content

Commit

Permalink
Merge branch 'master' into dp/softmax
Browse files Browse the repository at this point in the history
  • Loading branch information
dpanici authored Nov 12, 2024
2 parents 00c964c + 01e54a0 commit 0fadf3f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions desc/optimize/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,11 @@ def optimize( # noqa: C901 - FIXME: simplify this
objective, nonlinear_constraints = _maybe_wrap_nonlinear_constraints(
eq, objective, nonlinear_constraints, self.method, options
)
if not isinstance(objective, ProximalProjection):
for t in things:
linear_constraints = maybe_add_self_consistency(t, linear_constraints)
is_prox = isinstance(objective, ProximalProjection)
for t in things:
if isinstance(t, Equilibrium) and is_prox:
continue # don't add Equilibrium self-consistency if proximal is used
linear_constraints = maybe_add_self_consistency(t, linear_constraints)
linear_constraint = _combine_constraints(linear_constraints)
nonlinear_constraint = _combine_constraints(nonlinear_constraints)

Expand Down

0 comments on commit 0fadf3f

Please sign in to comment.