From 5d51b39f595d5a151b4a91785dca4fc217e3579a Mon Sep 17 00:00:00 2001 From: AdrianSosic Date: Fri, 22 Nov 2024 14:47:32 +0100 Subject: [PATCH] Drop _mark_as_measured method --- baybe/campaign.py | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/baybe/campaign.py b/baybe/campaign.py index cad6243bd..dbbb69cab 100644 --- a/baybe/campaign.py +++ b/baybe/campaign.py @@ -256,9 +256,13 @@ def add_measurements( # Update metadata if self.searchspace.type in (SearchSpaceType.DISCRETE, SearchSpaceType.HYBRID): - self._mark_as_measured( - data, numerical_measurements_must_be_within_tolerance + idxs_matched = fuzzy_row_match( + self.searchspace.discrete.exp_rep, + data, + self.parameters, + numerical_measurements_must_be_within_tolerance, ) + self._searchspace_metadata.loc[idxs_matched, _MEASURED] = True # Telemetry telemetry_record_value(TELEM_LABELS["COUNT_ADD_RESULTS"], 1) @@ -269,27 +273,6 @@ def add_measurements( numerical_measurements_must_be_within_tolerance, ) - def _mark_as_measured( - self, - measurements: pd.DataFrame, - numerical_measurements_must_be_within_tolerance: bool, - ) -> None: - """Mark the given elements of the discrete subspace as measured. - - Args: - measurements: A dataframe containing parameter configurations to be - marked as measured. - numerical_measurements_must_be_within_tolerance: See - :func:`baybe.utils.dataframe.fuzzy_row_match`. - """ - idxs_matched = fuzzy_row_match( - self.searchspace.discrete.exp_rep, - measurements, - self.parameters, - numerical_measurements_must_be_within_tolerance, - ) - self._searchspace_metadata.loc[idxs_matched, _MEASURED] = True - def toggle_discrete_candidates( # noqa: DOC501 self, constraints: Collection[DiscreteConstraint] | pd.DataFrame,