@@ -62,8 +62,8 @@ def _get_constraint_violation(
62
62
eq_cons = np .array (f [1 : (nec + 1 )])
63
63
ineq_cons = np .array (f [(nec + 1 ) :])
64
64
# extract corresponding tolerances
65
- eq_con_tol = con_tol_array [1 : ( nec + 1 ) ]
66
- ineq_con_tol = con_tol_array [( nec + 1 ) :]
65
+ eq_con_tol = con_tol_array [0 : nec ]
66
+ ineq_con_tol = con_tol_array [nec :]
67
67
68
68
# determine maximum constraint violation
69
69
violations = np .concatenate (
@@ -110,7 +110,6 @@ class optgra:
110
110
111
111
@staticmethod
112
112
def _constraint_types_from_box_bounds (problem ):
113
-
114
113
lb , ub = problem .get_bounds ()
115
114
# all box-derived constraints are positive
116
115
finite_lb = sum (isfinite (elem ) for elem in lb )
@@ -129,7 +128,6 @@ def _wrap_fitness_func(
129
128
lb , ub = problem .get_bounds ()
130
129
131
130
def wrapped_fitness (x ):
132
-
133
131
# we are using vectorisation internally -> convert to ndarray
134
132
x = np .asarray (x , dtype = np .float64 )
135
133
_assert_finite (x , "decision vector" ) # catch nan values
@@ -169,7 +167,6 @@ def _wrap_gradient_func(
169
167
force_bounds = False ,
170
168
khanf : Optional [base_khan_function ] = None ,
171
169
):
172
-
173
170
# get the sparsity pattern to index the sparse gradients
174
171
sparsity_pattern = problem .gradient_sparsity ()
175
172
f_indices , x_indices = sparsity_pattern .T # Unpack indices
@@ -178,7 +175,6 @@ def _wrap_gradient_func(
178
175
shape = (problem .get_nf (), problem .get_nx ())
179
176
180
177
def wrapped_gradient (x ):
181
-
182
178
# we are using vectorisation internally -> convert to ndarray
183
179
x = np .asarray (x , dtype = np .float64 )
184
180
_assert_finite (x , "decision vector" ) # catch nan values
0 commit comments