File tree 1 file changed +6
-6
lines changed
pyomo/contrib/pynumero/interfaces
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -598,12 +598,12 @@ def __init__(self, pyomo_model):
598
598
need_scaling = True
599
599
600
600
self ._primals_scaling = np .ones (self .n_primals ())
601
- scaling_suffix = self . _pyomo_nlp . _pyomo_model . component ('scaling_factor' )
602
- if scaling_suffix and scaling_suffix . ctype is pyo . Suffix :
603
- need_scaling = True
604
- for i , v in enumerate ( self . get_pyomo_variables ()) :
605
- if v in scaling_suffix :
606
- self ._primals_scaling [i ] = scaling_suffix [ v ]
601
+ scaling_suffix_finder = SuffixFinder ('scaling_factor' )
602
+ for i , v in enumerate ( self . get_pyomo_variables ()) :
603
+ v_scaling = scaling_suffix_finder . find ( v )
604
+ if v_scaling is not None :
605
+ need_scaling = True
606
+ self ._primals_scaling [i ] = v_scaling
607
607
608
608
self ._constraints_scaling = []
609
609
pyomo_nlp_scaling = self ._pyomo_nlp .get_constraints_scaling ()
You can’t perform that action at this time.
0 commit comments