From 834d13ead55ec057bb55ed72a2bbd10590702823 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 11:48:42 +0200 Subject: [PATCH 01/22] Treat warnings as errors during tests --- pytest.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pytest.ini b/pytest.ini index 7ba12d0881..ed5a3c8b4e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -6,7 +6,12 @@ addopts = ; Avoids import errors due to optional dependencies --doctest-ignore-import-errors + testpaths = baybe tests + xfail_strict=true + +filterwarnings = + error From ccb966128ab4fef8ec941f96b0f56b73c6d58f9d Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 10:20:52 +0200 Subject: [PATCH 02/22] Ignore torch.jit.script warning --- tests/conftest.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 882204c156..9ee0e5501f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -83,6 +83,13 @@ create_fake_input, ) +# TODO: Remove when https://github.com/cornellius-gp/linear_operator/pull/129 is ready +warnings.filterwarnings( + "ignore", + message=".*torch.jit.script.*is deprecated", + category=DeprecationWarning, +) + # Hypothesis settings hypothesis_settings.register_profile("ci", deadline=500, max_examples=100) if strtobool(os.getenv("CI", "false")): From 058522d5ae8e07aa89de950dafa017df5471e7cd Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 10:29:41 +0200 Subject: [PATCH 03/22] Ignore legacy target warning for test parametrization --- tests/test_deprecations.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_deprecations.py b/tests/test_deprecations.py index b1961d31a6..4a57513be7 100644 --- a/tests/test_deprecations.py +++ b/tests/test_deprecations.py @@ -340,9 +340,13 @@ def test_constructor_equivalence_match(transformation): assert t1 == t2 -@pytest.mark.parametrize( - ("legacy", "deprecation", "modern", "expected"), - [ +# NOTE: The parametrize values below use the deprecated legacy interface of +# ModernTarget (e.g. ModernTarget("t", "MAX")), which emits DeprecationWarning. +# Since these are evaluated at module/collection time, we suppress the warning here +# to avoid failures when running with `-W error`. +with warnings.catch_warnings(): + warnings.simplefilter("ignore", DeprecationWarning) + _target_transformation_params = [ param( LegacyTarget("t", "MAX"), ModernTarget("t", "MAX"), @@ -464,7 +468,12 @@ def test_constructor_equivalence_match(transformation): triangular_transform(sample_input(), 2, 6), id="match_triangular_scaled_shifted", ), - ], + ] + + +@pytest.mark.parametrize( + ("legacy", "deprecation", "modern", "expected"), + _target_transformation_params, ) def test_target_transformation( series, From f9a4f9a3adf9ba9e54e1a3127e058ca7c236f19e Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 10:40:57 +0200 Subject: [PATCH 04/22] Ignore legacy target warnings in test bodies --- tests/test_deprecations.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_deprecations.py b/tests/test_deprecations.py index 4a57513be7..47849d6659 100644 --- a/tests/test_deprecations.py +++ b/tests/test_deprecations.py @@ -243,6 +243,7 @@ def test_target_deprecation_helpers(): NumericalTarget.from_modern_interface("t", minimize=True) +@pytest.mark.filterwarnings("ignore::DeprecationWarning") def test_target_legacy_deserialization(): """Deserialization also works from legacy arguments.""" actual = NumericalTarget.from_dict({"name": "t", "mode": "MATCH", "bounds": (1, 2)}) @@ -259,6 +260,7 @@ def series() -> pd.Series: return sample_input() +@pytest.mark.filterwarnings("ignore::DeprecationWarning") @pytest.mark.parametrize("mode", ["MAX", "MIN"]) def test_constructor_equivalence_min_max(mode): """ @@ -300,6 +302,7 @@ def test_constructor_equivalence_min_max(mode): assert t1 == t2 +@pytest.mark.filterwarnings("ignore::DeprecationWarning") @pytest.mark.parametrize("transformation", ["TRIANGULAR", "BELL"]) def test_constructor_equivalence_match(transformation): """ @@ -491,6 +494,7 @@ def test_target_transformation( assert_series_equal(modern.transform(series), expected) +@pytest.mark.filterwarnings("ignore::DeprecationWarning") def test_deserialization_using_constructor(): """Deserialization using the 'constructor' field works despite having other deprecation mechanisms in place.""" # noqa From 9704318c8678380bd2408fda65a460ba4be61f84 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 11:09:06 +0200 Subject: [PATCH 05/22] Ignore pandas FutureWarning A proper fix is needed for Pandas 3.0, but this is outside the scope of the PR. For now, since we're living with the warning anyway, a simple ignore to enable the pytest -W error mode suffices. --- baybe/constraints/discrete.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/baybe/constraints/discrete.py b/baybe/constraints/discrete.py index 740e603f89..7acd39139d 100644 --- a/baybe/constraints/discrete.py +++ b/baybe/constraints/discrete.py @@ -3,6 +3,7 @@ from __future__ import annotations import gc +import warnings from collections.abc import Callable from functools import reduce from typing import TYPE_CHECKING, Any, ClassVar, cast @@ -233,13 +234,18 @@ def get_invalid(self, data: pd.DataFrame) -> pd.Index: # Create data copy and mark entries where the dependency conditions are negative # with a dummy value to cause degeneracy. censored_data = data.copy() - for k, _ in enumerate(self.parameters): - # .loc assignments are not supported by mypy + pandas-stubs yet - # See https://github.com/pandas-dev/pandas-stubs/issues/572 - censored_data.loc[ # type: ignore[call-overload] - ~self.conditions[k].evaluate(data[self.parameters[k]]), - self.affected_parameters[k], - ] = Dummy() + with warnings.catch_warnings(): + # Suppress pandas FutureWarning about setting incompatible dtype. + # TODO: Needs proper fix for pandas 3.0 compatibility. + warnings.simplefilter("ignore", FutureWarning) + + for k, _ in enumerate(self.parameters): + # .loc assignments are not supported by mypy + pandas-stubs yet + # See https://github.com/pandas-dev/pandas-stubs/issues/572 + censored_data.loc[ # type: ignore[call-overload] + ~self.conditions[k].evaluate(data[self.parameters[k]]), + self.affected_parameters[k], + ] = Dummy() # Create an invariant indicator: pair each value of an affected parameter with # the corresponding value of the parameter it depends on. These indicators From 7050dca69f08686cb3878ffd96b95742c4ad68df Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 11:51:41 +0200 Subject: [PATCH 06/22] Ignore linear_operator NumericalWarning --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index ed5a3c8b4e..1ca47be68e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -15,3 +15,5 @@ xfail_strict=true filterwarnings = error + ; Numerics + ignore:A not p.d., added jitter of .*:linear_operator.utils.warnings.NumericalWarning From b8acbfad763cf8c83ed8620bb770128d0a18c2e2 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 20:16:11 +0200 Subject: [PATCH 07/22] Ignore BoTorch failed optimization RuntimeWarning --- pytest.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 1ca47be68e..d823a9d401 100644 --- a/pytest.ini +++ b/pytest.ini @@ -15,5 +15,6 @@ xfail_strict=true filterwarnings = error - ; Numerics + ; Numerics/optimization ignore:A not p.d., added jitter of .*:linear_operator.utils.warnings.NumericalWarning + ignore:Optimization failed.*:RuntimeWarning:botorch.optim.optimize From eb8b21b3b499e2236adf12dd4fe8e1a6d7bf8235 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 20:29:02 +0200 Subject: [PATCH 08/22] Avoid expected warning being converted into error --- tests/constraints/test_cardinality_constraint_continuous.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/constraints/test_cardinality_constraint_continuous.py b/tests/constraints/test_cardinality_constraint_continuous.py index 2717ceff42..04e9e10cf9 100644 --- a/tests/constraints/test_cardinality_constraint_continuous.py +++ b/tests/constraints/test_cardinality_constraint_continuous.py @@ -231,6 +231,7 @@ def prepare_measurements() -> pd.DataFrame: ) with warnings.catch_warnings(record=True) as captured_warnings: + warnings.filterwarnings("always", category=MinimumCardinalityViolatedWarning) BotorchRecommender().recommend( BATCH_SIZE, searchspace, objective, prepare_measurements() ) From 070419123bfd7008ba6f20b9edc09ec165627656 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 13:06:41 +0200 Subject: [PATCH 09/22] Ignore BoTorch log-acquisition warnings --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index d823a9d401..b274378884 100644 --- a/pytest.ini +++ b/pytest.ini @@ -18,3 +18,5 @@ filterwarnings = ; Numerics/optimization ignore:A not p.d., added jitter of .*:linear_operator.utils.warnings.NumericalWarning ignore:Optimization failed.*:RuntimeWarning:botorch.optim.optimize + ; BoTorch warning recommending to switch to log-versions of acquisition functions + ignore:.*has known numerical issues that lead to suboptimal optimization performance.*:botorch.exceptions.warnings.NumericsWarning:botorch.acquisition From 24e8d89d394fdaf8b1bd46c07cb16464ee28a740 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Tue, 21 Apr 2026 16:35:51 +0200 Subject: [PATCH 10/22] Fix target tensor layout Original error message: sklearn.exceptions.DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel(). --- tests/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 9ee0e5501f..7b821bbbfc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -925,7 +925,7 @@ def fixture_default_onnx_str() -> bytes: # Train sklearn model train_x = torch.arange(10).view(-1, 1) - train_y = torch.arange(10).view(-1, 1) + train_y = torch.arange(10) model = BayesianRidge() model.fit(train_x, train_y) From 64754020694c6c242849b1a16d4eebe9740a77d2 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Tue, 21 Apr 2026 16:40:14 +0200 Subject: [PATCH 11/22] Temporarily ignore linear_operator DeprecationWarning --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index b274378884..8eae407adf 100644 --- a/pytest.ini +++ b/pytest.ini @@ -20,3 +20,6 @@ filterwarnings = ignore:Optimization failed.*:RuntimeWarning:botorch.optim.optimize ; BoTorch warning recommending to switch to log-versions of acquisition functions ignore:.*has known numerical issues that lead to suboptimal optimization performance.*:botorch.exceptions.warnings.NumericsWarning:botorch.acquisition + ; Temporary ignores + ; https://github.com/meta-pytorch/botorch/pull/3279 + ignore:chol argument to CholLinearOperator should be a TriangularLinearOperator.*:DeprecationWarning:linear_operator.operators.chol_linear_operator From 018902e949a389a688ba3f398635551a20ee38dd Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 13:15:55 +0200 Subject: [PATCH 12/22] Ignore scipy optimization termination warning (reraised by BoTorch) --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pytest.ini b/pytest.ini index 8eae407adf..6781b2d5be 100644 --- a/pytest.ini +++ b/pytest.ini @@ -18,6 +18,8 @@ filterwarnings = ; Numerics/optimization ignore:A not p.d., added jitter of .*:linear_operator.utils.warnings.NumericalWarning ignore:Optimization failed.*:RuntimeWarning:botorch.optim.optimize + ; Note: File format instead of module format needed due to BoTorch reraising using `warn_explicit` without `module` argument + ignore:`scipy_minimize` terminated with status .*:botorch.exceptions.warnings.OptimizationWarning:.*botorch/fit ; BoTorch warning recommending to switch to log-versions of acquisition functions ignore:.*has known numerical issues that lead to suboptimal optimization performance.*:botorch.exceptions.warnings.NumericsWarning:botorch.acquisition ; Temporary ignores From e67feae4418eb41dd4ccc451bf7d3cb9f6751c6c Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 09:46:42 +0200 Subject: [PATCH 13/22] Drop tenacity warning --- tests/conftest.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 7b821bbbfc..51aa5a1b03 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -958,9 +958,6 @@ def fixture_default_onnx_surrogate(onnx_str) -> CustomONNXSurrogate: match=r".*Expected value argument.*to be within the support.*" ), ), - before_sleep=lambda x: warnings.warn( - f"Retrying iteration test due to '{x.outcome.exception()}'" - ), ) def run_iterations( campaign: Campaign, n_iterations: int, batch_size: int, add_noise: bool = True From 9c2a17c6fa47933273ff54073f3a10cbbb3c9679 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 09:53:25 +0200 Subject: [PATCH 14/22] Extend regex for linear_operator warning --- pytest.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytest.ini b/pytest.ini index 6781b2d5be..9699aa21a2 100644 --- a/pytest.ini +++ b/pytest.ini @@ -16,7 +16,7 @@ xfail_strict=true filterwarnings = error ; Numerics/optimization - ignore:A not p.d., added jitter of .*:linear_operator.utils.warnings.NumericalWarning + ignore:.*add(ed|ing) jitter.*:linear_operator.utils.warnings.NumericalWarning ignore:Optimization failed.*:RuntimeWarning:botorch.optim.optimize ; Note: File format instead of module format needed due to BoTorch reraising using `warn_explicit` without `module` argument ignore:`scipy_minimize` terminated with status .*:botorch.exceptions.warnings.OptimizationWarning:.*botorch/fit From 1158cff928fbbe021aae005fce106a6c3377b236 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Mon, 20 Apr 2026 13:23:54 +0200 Subject: [PATCH 15/22] Replace stable_cumsum with np.cumulative_sum Deprecation message from sklearn: "`sklearn.utils.extmath.stable_cumsum` is deprecated in version 1.8 and " "will be removed in 1.10. Use `np.cumulative_sum` with the desired dtype " "directly instead." --- baybe/utils/clustering_algorithms/third_party/kmedoids.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/baybe/utils/clustering_algorithms/third_party/kmedoids.py b/baybe/utils/clustering_algorithms/third_party/kmedoids.py index 55369ebd1b..82be6bd76f 100644 --- a/baybe/utils/clustering_algorithms/third_party/kmedoids.py +++ b/baybe/utils/clustering_algorithms/third_party/kmedoids.py @@ -46,7 +46,6 @@ pairwise_distances_argmin, ) from sklearn.utils import check_array, check_random_state -from sklearn.utils.extmath import stable_cumsum from sklearn.utils.validation import check_is_fitted from baybe.settings import active_settings @@ -485,7 +484,9 @@ def _kpp_init(self, D, n_clusters, random_state_, n_local_trials=None): # pick the remaining n_clusters-1 points for cluster_index in range(1, n_clusters): rand_vals = random_state_.random_sample(n_local_trials) * current_pot - candidate_ids = np.searchsorted(stable_cumsum(closest_dist_sq), rand_vals) + candidate_ids = np.searchsorted( + np.cumulative_sum(closest_dist_sq), rand_vals + ) # Compute distances to center candidates distance_to_candidates = D[candidate_ids, :] ** 2 From ba3e59c8b9a9911a868829b032f944752126c40c Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 09:59:21 +0200 Subject: [PATCH 16/22] Avoid acquisition value degeneracy by adding more data Original error message: botorch.exceptions.warnings.BadInitialCandidatesWarning: All acquisition values for raw samples points are the same for at least one batch. Choosing initial conditions at random. --- tests/test_surrogate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_surrogate.py b/tests/test_surrogate.py index b9deedf153..20e4f5c622 100644 --- a/tests/test_surrogate.py +++ b/tests/test_surrogate.py @@ -185,7 +185,7 @@ def test_invalid_model_params(model_cls, params): ) def test_continuous_incompatibility(campaign): """Using surrogates without gradients on continuous spaces fails expectedly.""" - data = create_fake_input(campaign.parameters, campaign.targets) + data = create_fake_input(campaign.parameters, campaign.targets, n_rows=3) campaign.add_measurements(data) skip = False From b397234a8a0fc0d56731056ee0148961f4d7f2c5 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 10:04:03 +0200 Subject: [PATCH 17/22] Add missing detach() call to numpy surrogates --- baybe/surrogates/linear.py | 4 +++- baybe/surrogates/ngboost.py | 2 +- baybe/surrogates/random_forest.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/baybe/surrogates/linear.py b/baybe/surrogates/linear.py index ba1fed5b2c..99d847f0cd 100644 --- a/baybe/surrogates/linear.py +++ b/baybe/surrogates/linear.py @@ -71,7 +71,9 @@ def _estimate_moments( import torch # Get predictions - dists = self._model.predict(candidates_comp_scaled.numpy(), return_std=True) + dists = self._model.predict( + candidates_comp_scaled.detach().numpy(), return_std=True + ) # Split into posterior mean and variance mean = torch.from_numpy(dists[0]) diff --git a/baybe/surrogates/ngboost.py b/baybe/surrogates/ngboost.py index 6cb1cee135..5d3c6dcc3b 100644 --- a/baybe/surrogates/ngboost.py +++ b/baybe/surrogates/ngboost.py @@ -98,7 +98,7 @@ def _estimate_moments( import torch # Get predictions - dists = self._model.pred_dist(candidates_comp_scaled) + dists = self._model.pred_dist(candidates_comp_scaled.detach().numpy()) # Split into posterior mean and variance mean = torch.from_numpy(dists.mean()) diff --git a/baybe/surrogates/random_forest.py b/baybe/surrogates/random_forest.py index 91ad599bb1..69f8588a0d 100644 --- a/baybe/surrogates/random_forest.py +++ b/baybe/surrogates/random_forest.py @@ -109,7 +109,7 @@ def predict(candidates_comp_scaled: Tensor) -> Tensor: return torch.from_numpy( self._predict_ensemble( - self._model.estimators_, candidates_comp_scaled.numpy() + self._model.estimators_, candidates_comp_scaled.detach().numpy() ) ) From 4f7d1d474e9b1ad0f1c1bae4f6529c4f8c755345 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 10:26:42 +0200 Subject: [PATCH 18/22] Activate pytest's strict mode --- pytest.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytest.ini b/pytest.ini index 9699aa21a2..c2f35c5930 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,6 @@ [pytest] +strict = true + addopts = --doctest-modules --ignore=examples @@ -11,8 +13,6 @@ testpaths = baybe tests -xfail_strict=true - filterwarnings = error ; Numerics/optimization From 5aa81af308536128274ca1fc4f5b5fddfbe8d363 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 11:16:11 +0200 Subject: [PATCH 19/22] Fix some duplicate parametrization IDs --- tests/constraints/test_constraints_continuous.py | 2 +- .../alternative_creation/test_acquisition.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/constraints/test_constraints_continuous.py b/tests/constraints/test_constraints_continuous.py index e2ed9361bb..2b5c91e112 100644 --- a/tests/constraints/test_constraints_continuous.py +++ b/tests/constraints/test_constraints_continuous.py @@ -221,7 +221,7 @@ def test_hybridspace_ineq(campaign, n_iterations, batch_size): param(["A", "B"], [1.0, 2.0, 3.0], 0.0, ">=", id="ineq_too_many_coeffs"), param(["A", "B"], [1.0, 2.0], "bla", ">=", id="ineq_invalid_rhs"), param(["A", "B"], [1.0, 2.0], 0.0, "invalid", id="ineq_invalid_operator1"), - param(["A", "B"], [1.0, 2.0], 0.0, 2.0, id="ineq_invalid_operator1"), + param(["A", "B"], [1.0, 2.0], 0.0, 2.0, id="ineq_invalid_operator2"), ], ) def test_invalid_constraints(parameters, coefficients, rhs, op): diff --git a/tests/hypothesis_strategies/alternative_creation/test_acquisition.py b/tests/hypothesis_strategies/alternative_creation/test_acquisition.py index 513e7a2679..933ffcf201 100644 --- a/tests/hypothesis_strategies/alternative_creation/test_acquisition.py +++ b/tests/hypothesis_strategies/alternative_creation/test_acquisition.py @@ -6,22 +6,22 @@ from baybe.recommenders import BotorchRecommender from baybe.utils.basic import get_subclasses -abbreviation_list = [ +abbreviations = [ cl.abbreviation for cl in get_subclasses(AcquisitionFunction) if hasattr(cl, "abbreviation") ] +fullnames = [cl.__name__ for cl in get_subclasses(AcquisitionFunction)] +combined = set(abbreviations + fullnames) -fullname_list = [cl.__name__ for cl in get_subclasses(AcquisitionFunction)] - -@pytest.mark.parametrize("acqf", abbreviation_list + fullname_list) +@pytest.mark.parametrize("acqf", combined) def test_creation_from_string(acqf): """Tests the creation from strings.""" AcquisitionFunction.from_dict({"type": acqf}) -@pytest.mark.parametrize("acqf", abbreviation_list + fullname_list) +@pytest.mark.parametrize("acqf", combined) def test_string_usage_in_recommender(acqf): """Tests the recommender initialization with acqfs as string.""" BotorchRecommender(acquisition_function=acqf) From 75c0aecc2796f944d1bbe1c5de0b4abbc635f1f4 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 11:19:20 +0200 Subject: [PATCH 20/22] Temporarily disable strict parametrization requirement --- pytest.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pytest.ini b/pytest.ini index c2f35c5930..0561485495 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,10 @@ [pytest] strict = true +# Currently blocked by test_iterations.py. Should be activated once that test module +# has been properly refactored. +strict_parametrization_ids=false + addopts = --doctest-modules --ignore=examples From 2c8c70eee77e3d4751eb44cfdfcba7d22b94259b Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 13:59:26 +0200 Subject: [PATCH 21/22] Register filterwarnings marker for strict mode --- pytest.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest.ini b/pytest.ini index 0561485495..ea27ff0064 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,9 @@ [pytest] strict = true +markers = + filterwarnings: Apply warning filters to a test + # Currently blocked by test_iterations.py. Should be activated once that test module # has been properly refactored. strict_parametrization_ids=false From 6fda0db5e2d1a28605db27344dc4ad712cb117b9 Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Wed, 22 Apr 2026 14:43:12 +0200 Subject: [PATCH 22/22] Skip test in CORETEST environment The reason why this used to work before is due to the previously missing n_rows argument: with only a single data point, the models fell back to the simple MeanPredictionSurrogate, bypassing the optional import error --- tests/test_surrogate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_surrogate.py b/tests/test_surrogate.py index 20e4f5c622..5a4f617b0e 100644 --- a/tests/test_surrogate.py +++ b/tests/test_surrogate.py @@ -163,6 +163,10 @@ def test_invalid_model_params(model_cls, params): model_cls(model_params=params) +@pytest.mark.skipif( + os.environ.get("BAYBE_TEST_ENV") != "FULLTEST", + reason="Most surrogates are only available in FULLTEST environment.", +) @pytest.mark.parametrize( "target_names", [["Target_max"], ["Target_max_bounded", "Target_min_bounded"]],