Skip to content

Commit

Permalink
update the differentiate.Modes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedongPeng committed Feb 13, 2024
1 parent a0997d8 commit 6c9fa3e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyomo/contrib/mindtpy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ def calc_jacobians(constraint_list, differentiate_mode):
# Map nonlinear_constraint --> Map(
# variable --> jacobian of constraint w.r.t. variable)
jacobians = ComponentMap()
if differentiate_mode == 'reverse_symbolic':
mode = EXPR.differentiate.Modes.reverse_symbolic
elif differentiate_mode == 'sympy':
mode = EXPR.differentiate.Modes.sympy
mode = EXPR.differentiate.Modes(differentiate_mode)
for c in constraint_list:
vars_in_constr = list(EXPR.identify_variables(c.body))
jac_list = EXPR.differentiate(c.body, wrt_list=vars_in_constr, mode=mode)
Expand Down

0 comments on commit 6c9fa3e

Please sign in to comment.