Skip to content

Commit 1eb5d12

Browse files
committed
Update optimization bounds (Always prefer max sized particle)
1 parent 8c51a00 commit 1eb5d12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/NanoParticleTools/optimization/scipy_optimize.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from collections.abc import Callable
1313

1414

15-
def get_bounds(n_constraints: int, n_elements: int) -> Bounds:
15+
def get_bounds(n_constraints: int, n_elements: int, **kwargs) -> Bounds:
1616
r"""
1717
Get the Bounds which are utilized by scipy minimize.
1818
@@ -34,7 +34,8 @@ def get_bounds(n_constraints: int, n_elements: int) -> Bounds:
3434
(np.zeros(num_dopant_nodes), np.zeros(n_constraints)))
3535
max_bounds = np.concatenate(
3636
(np.ones(num_dopant_nodes), np.ones(n_constraints)))
37-
bounds = Bounds(min_bounds, max_bounds)
37+
min_bounds[-1] = 1
38+
bounds = Bounds(min_bounds, max_bounds, **kwargs)
3839
return bounds
3940

4041

0 commit comments

Comments
 (0)