-
Notifications
You must be signed in to change notification settings - Fork 76
Goodbye pytest warnings #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
834d13e
ccb9661
058522d
f9a4f9a
9704318
7050dca
b8acbfa
eb8b21b
0704191
24e8d89
6475402
018902e
e67feae
9c2a17c
1158cff
ba3e59c
b397234
4f7d1d4
5aa81af
75c0aec
2c8c70e
6fda0db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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 | ||||||
|
||||||
| np.cumulative_sum(closest_dist_sq), rand_vals | |
| np.cumsum(closest_dist_sq), rand_vals |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,12 +1,34 @@ | ||||||
| [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 | ||||||
|
|
||||||
| addopts = | ||||||
| --doctest-modules | ||||||
| --ignore=examples | ||||||
| --ignore=docs | ||||||
|
|
||||||
| ; Avoids import errors due to optional dependencies | ||||||
| --doctest-ignore-import-errors | ||||||
|
|
||||||
| testpaths = | ||||||
| baybe | ||||||
| tests | ||||||
| xfail_strict=true | ||||||
|
|
||||||
| filterwarnings = | ||||||
| error | ||||||
| ; Numerics/optimization | ||||||
| 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 | ||||||
|
||||||
| ignore:`scipy_minimize` terminated with status .*:botorch.exceptions.warnings.OptimizationWarning:.*botorch/fit | |
| ignore:`scipy_minimize` terminated with status .*:botorch.exceptions.warnings.OptimizationWarning:.*botorch/fit |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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) | ||||||
|
||||||
| combined = set(abbreviations + fullnames) | |
| combined = sorted(set(abbreviations + fullnames)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
warnings.simplefilter("ignore", FutureWarning)insideget_invalidsuppresses allFutureWarnings raised in this block, which can mask unrelated warnings and make it harder to spot new pandas deprecations. Prefer narrowing the filter to the specific pandas warning message (or module) you're targeting, or proactively adjust the dataframe/column dtypes before assignment to avoid emitting the warning in the first place.