From aa0c58f0097c3d582d1263486f35a532e4183d06 Mon Sep 17 00:00:00 2001 From: Philipp Jurasic Date: Wed, 18 Dec 2024 19:37:44 +0100 Subject: [PATCH] fix bounds check discovered by test --- src/simsopt/_core/optimizable.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/simsopt/_core/optimizable.py b/src/simsopt/_core/optimizable.py index e004ed70e..bfa66f122 100644 --- a/src/simsopt/_core/optimizable.py +++ b/src/simsopt/_core/optimizable.py @@ -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 @@ -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