@@ -5,15 +5,15 @@ using ExaModels
55import NLPModels
66import NLPModels: obj, cons!, cons_nln!, grad!, jac_coord!, hess_coord!, jac_structure!, hess_structure!
77import ExaModels: num_scenarios, num_vars_per_scenario, num_constraints_per_scenario, total_vars,
8- total_cons, set_scenario_parameters!, set_all_scenario_parameters!, var_indices,
9- cons_block_indices, grad_indices,
10- extract_vars!, extract_cons_block!,
11- global_var_index, global_con_index, get_model
8+ total_cons, set_scenario_parameters!, set_all_scenario_parameters!, var_indices,
9+ cons_block_indices, grad_indices,
10+ extract_vars!, extract_cons_block!,
11+ global_var_index, global_con_index, get_model
1212
1313import NLPModelsIpopt: ipopt
1414
1515function runtests ()
16- @testset " BatchExaModel" begin
16+ return @testset " BatchExaModel" begin
1717
1818 @testset " Construction and dimensions" begin
1919 ns, nv = 3 , 2
@@ -379,11 +379,11 @@ function runtests()
379379 # Each scenario's variable should equal its parameter
380380 for (i, θ) in enumerate (θ_vals)
381381 v_sol = x_sol[var_indices (model, i)]
382- @test v_sol[1 ] ≈ θ atol = 1e -5
382+ @test v_sol[1 ] ≈ θ atol = 1.0e -5
383383 end
384384
385385 # Optimal objective should be 0
386- @test result. objective ≈ 0.0 atol = 1e -8
386+ @test result. objective ≈ 0.0 atol = 1.0e -8
387387 end
388388
389389 @testset " Ipopt solver - multiple variables per scenario" begin
@@ -416,12 +416,12 @@ function runtests()
416416 x_sol = result. solution
417417
418418 # Scenario 1: v = [1, 3]
419- @test x_sol[var_indices (model, 1 )] ≈ [1.0 , 3.0 ] atol = 1e -5
419+ @test x_sol[var_indices (model, 1 )] ≈ [1.0 , 3.0 ] atol = 1.0e -5
420420
421421 # Scenario 2: v = [2, 2]
422- @test x_sol[var_indices (model, 2 )] ≈ [2.0 , 2.0 ] atol = 1e -5
422+ @test x_sol[var_indices (model, 2 )] ≈ [2.0 , 2.0 ] atol = 1.0e -5
423423
424- @test result. objective ≈ 0.0 atol = 1e -8
424+ @test result. objective ≈ 0.0 atol = 1.0e -8
425425 end
426426
427427 @testset " Variable bounds with start values" begin
@@ -431,7 +431,8 @@ function runtests()
431431
432432 v_start_vals = [0.1 , 0.2 , 0.3 , 0.4 ] # ns * nv = 4 values
433433
434- model = BatchExaModel (nv, ns, θ_sets;
434+ model = BatchExaModel (
435+ nv, ns, θ_sets;
435436 v_start = v_start_vals,
436437 v_lvar = 0.0 ,
437438 v_uvar = 10.0
0 commit comments