@@ -160,8 +160,8 @@ def test_ocp_generates_rust_solver_and_calls_tcp_interface(self):
160160 .with_initial_tolerance (1e-5 ) \
161161 .with_delta_tolerance (1e-5 ) \
162162 .with_initial_penalty (10.0 ) \
163- .with_penalty_weight_update_factor (5.0 ) \
164- .with_max_inner_iterations (50 ) \
163+ .with_penalty_weight_update_factor (1.2 ) \
164+ .with_max_inner_iterations (500 ) \
165165 .with_max_outer_iterations (10 )
166166
167167 builder = og .ocp .OCPBuilder (
@@ -170,24 +170,17 @@ def test_ocp_generates_rust_solver_and_calls_tcp_interface(self):
170170 build_configuration = build_config ,
171171 solver_configuration = solver_config ,
172172 )
173- builder .build ()
174-
175- mng = og .tcp .OptimizerTcpManager (
176- optimizer_path = os .path .join (OcpTestCase .TEST_DIR , optimizer_name )
177- )
178- mng .start ()
173+ optimizer = builder .build ()
179174
180175 try :
181- pong = mng .ping ()
182- self .assertEqual (1 , pong ["Pong" ])
183-
184- response = mng .call (p = [1.0 , 0.0 ])
185- self .assertTrue (response .is_ok ())
186- status = response .get ()
187- self .assertEqual ("Converged" , status .exit_status )
188- self .assertEqual (2 , len (status .solution ))
176+ result = optimizer .solve (x0 = [1.0 ], xref = [0.0 ])
177+ print (result )
178+ self .assertEqual ("Converged" , result .exit_status )
179+ self .assertEqual (2 , len (result .solution ))
180+ self .assertEqual (2 , len (result .inputs ))
181+ self .assertEqual (3 , len (result .states ))
189182 finally :
190- mng .kill ()
183+ optimizer .kill ()
191184
192185
193186if __name__ == "__main__" :
0 commit comments