Skip to content

Commit fa222dc

Browse files
saitcakmakfacebook-github-bot
authored andcommitted
Update filtered input data type warning type in BoTorchTestCase
Summary: Since #2304, these warnings use `InputDataWarning`. The current filter does not filter these out: https://github.com/pytorch/botorch/actions/runs/8904363989/job/24453525662 Also audited the test classes to make sure they call `super().setUp()` if they overwrite `setUp`. Reviewed By: Balandat Differential Revision: D56805187 fbshipit-source-id: a0899a7b799f4cbee13f9b5dff7f36b00bf01c19
1 parent 82fa50d commit fa222dc

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

botorch/utils/testing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def setUp(self, suppress_input_warnings: bool = True) -> None:
5151
warnings.filterwarnings(
5252
"ignore",
5353
message="The model inputs are of type",
54-
category=UserWarning,
54+
category=InputDataWarning,
5555
)
5656
warnings.filterwarnings(
5757
"ignore",

test/acquisition/multi_objective/test_monte_carlo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ def get_zeros_like_last(Z: Tensor) -> Tensor:
702702

703703
class TestQNoisyExpectedHypervolumeImprovement(BotorchTestCase):
704704
def setUp(self):
705+
super().setUp()
705706
self.ref_point = [0.0, 0.0, 0.0]
706707
self.Y_raw = torch.tensor(
707708
[
@@ -718,7 +719,6 @@ def setUp(self):
718719
],
719720
device=self.device,
720721
)
721-
super().setUp()
722722

723723
def test_q_noisy_expected_hypervolume_improvement(self):
724724
for dtype in (torch.float, torch.double):

test/acquisition/test_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
class TestObjectiveAndConstraintIntegration(BotorchTestCase):
3333
def setUp(self) -> None:
34+
super().setUp()
3435
self.q = 3
3536
self.d = 2
3637
self.tkwargs = {"device": self.device, "dtype": torch.double}

0 commit comments

Comments
 (0)