Skip to content

Commit

Permalink
fix bounds check discovered by test
Browse files Browse the repository at this point in the history
  • Loading branch information
missing-user committed Dec 18, 2024
1 parent 91adc91 commit aa0c58f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/simsopt/_core/optimizable.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,9 @@ def full_lower_bounds(self, lb) -> None:
Set the lower bounds of the fixed and free DOFS associated with the
current Optimizable object and its ancestors.
"""
if list(self.dof_indices.values())[-1][-1] != len(lb):
if list(self._full_dof_indices.values())[-1][-1] != len(lb):
raise ValueError
for opt, indices in self.dof_indices.items():
for opt, indices in self._full_dof_indices.items():
opt._dofs.full_lower_bounds = lb[indices[0]:indices[1]]

@property
Expand Down Expand Up @@ -1278,9 +1278,9 @@ def full_upper_bounds(self, ub) -> None:
Set the upper bounds of the fixed and free DOFS associated with the
current Optimizable object and its ancestors.
"""
if list(self.dof_indices.values())[-1][-1] != len(ub):
if list(self._full_dof_indices.values())[-1][-1] != len(ub):
raise ValueError
for opt, indices in self.dof_indices.items():
for opt, indices in self._full_dof_indices.items():
opt._dofs.full_upper_bounds = ub[indices[0]:indices[1]]

@property
Expand Down

0 comments on commit aa0c58f

Please sign in to comment.