Skip to content

Commit

Permalink
Drop _mark_as_measured method
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianSosic committed Nov 22, 2024
1 parent eb1dbc3 commit 5d51b39
Showing 1 changed file with 6 additions and 23 deletions.
29 changes: 6 additions & 23 deletions baybe/campaign.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit 5d51b39

Please sign in to comment.