From 6f1b9c0b20a73bc9b00f003bc22b40849dd64941 Mon Sep 17 00:00:00 2001 From: Hiroki Takizawa Date: Sat, 14 Dec 2024 06:12:00 +0900 Subject: [PATCH 1/3] Update components.py --- package/samplers/ctpe/components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/samplers/ctpe/components.py b/package/samplers/ctpe/components.py index 71a8d6d1..efae578d 100644 --- a/package/samplers/ctpe/components.py +++ b/package/samplers/ctpe/components.py @@ -18,7 +18,7 @@ def __call__(self, x: int) -> int: elif self._strategy == "sqrt": n = int(np.ceil(self._beta * np.sqrt(x))) else: - assert "Should not reach." + raise AssertionError("Should not reach.") return min(n, 25) @@ -45,4 +45,4 @@ def __call__(self, x: int) -> np.ndarray: weights[:-25] = 1e-12 return weights else: - assert "Should not reach." + raise AssertionError("Should not reach.") From 377710ee6a9aff8937b82c4f7137fbb32c1a176f Mon Sep 17 00:00:00 2001 From: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com> Date: Sat, 14 Dec 2024 08:33:24 +0900 Subject: [PATCH 2/3] Update package/samplers/ctpe/components.py --- package/samplers/ctpe/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/samplers/ctpe/components.py b/package/samplers/ctpe/components.py index efae578d..d3ce2aaf 100644 --- a/package/samplers/ctpe/components.py +++ b/package/samplers/ctpe/components.py @@ -45,4 +45,4 @@ def __call__(self, x: int) -> np.ndarray: weights[:-25] = 1e-12 return weights else: - raise AssertionError("Should not reach.") + assert False, "Should not reach." From 9a8402856dd347d9fa6786f637010b8a5efa7ea6 Mon Sep 17 00:00:00 2001 From: Shuhei Watanabe <47781922+nabenabe0928@users.noreply.github.com> Date: Sat, 14 Dec 2024 08:33:32 +0900 Subject: [PATCH 3/3] Update package/samplers/ctpe/components.py --- package/samplers/ctpe/components.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/samplers/ctpe/components.py b/package/samplers/ctpe/components.py index d3ce2aaf..c2018d4f 100644 --- a/package/samplers/ctpe/components.py +++ b/package/samplers/ctpe/components.py @@ -18,7 +18,7 @@ def __call__(self, x: int) -> int: elif self._strategy == "sqrt": n = int(np.ceil(self._beta * np.sqrt(x))) else: - raise AssertionError("Should not reach.") + assert False, "Should not reach." return min(n, 25)