From 4d72c5eb23964255138a69c1f200bbe04cda231a Mon Sep 17 00:00:00 2001 From: Paul-Saves Date: Mon, 21 Aug 2023 20:35:34 +0200 Subject: [PATCH] simplify testing clauses --- smt/utils/design_space.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smt/utils/design_space.py b/smt/utils/design_space.py index 2f3d25713..22d3b3802 100644 --- a/smt/utils/design_space.py +++ b/smt/utils/design_space.py @@ -748,9 +748,9 @@ def _sample_valid_x(self, n: int, **kwargs) -> Tuple[np.ndarray, np.ndarray]: # Simplified implementation: sample design vectors in unfolded space x_limits_unfolded = self.get_unfolded_num_bounds() - if "random_state" in kwargs.keys(): + if "random_state" in kwargs: self.seed = kwargs["random_state"] - if "use_new_sampler" in kwargs.keys() and kwargs["use_new_sampler"]: + if kwargs.get("reset_sampler"): kwargs.pop("use_new_sampler", None) if self.use_new_sampler: self.sampler = LHS(xlimits=x_limits_unfolded, **kwargs)