Skip to content

Commit

Permalink
Update optimization bounds (Always prefer max sized particle)
Browse files Browse the repository at this point in the history
  • Loading branch information
sivonxay committed Dec 19, 2023
1 parent 8c51a00 commit 1eb5d12
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/NanoParticleTools/optimization/scipy_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from collections.abc import Callable


def get_bounds(n_constraints: int, n_elements: int) -> Bounds:
def get_bounds(n_constraints: int, n_elements: int, **kwargs) -> Bounds:
r"""
Get the Bounds which are utilized by scipy minimize.
Expand All @@ -34,7 +34,8 @@ def get_bounds(n_constraints: int, n_elements: int) -> Bounds:
(np.zeros(num_dopant_nodes), np.zeros(n_constraints)))
max_bounds = np.concatenate(
(np.ones(num_dopant_nodes), np.ones(n_constraints)))
bounds = Bounds(min_bounds, max_bounds)
min_bounds[-1] = 1
bounds = Bounds(min_bounds, max_bounds, **kwargs)
return bounds


Expand Down

0 comments on commit 1eb5d12

Please sign in to comment.