Skip to content

Commit

Permalink
bugfix in logging output of selector
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasWeise committed Oct 16, 2024
1 parent 4a13c20 commit b6ef2db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion moptipy/evaluation/selector.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
offered by this module provides the functionality to make such a selection.
It may be a bit slow, but hopefully it will pick the largest possible
consistent sub-selection or, at least, get close to it.
The current method to select the data is rather heuristic. It is based on
iteratively deleting those data elements whose configuration elements appear
the least often. This is computed in absolute terms. I actually think
normalizing this score should be better, but seemingly using the absolute raw
score creates larger consistent datasets. So for now, this is how we will do
it.
"""

from collections import Counter
Expand Down Expand Up @@ -247,7 +254,7 @@ def select_consistent(data: Iterable[T], log: bool = True) -> list[T]:
source.sort(key=lambda x: x[0])
count: int = list.__len__(source)
if log:
logger(f"Found {source} records of data.")
logger(f"Found {count} records of data.")

set_l: Final[int] = set.__len__({x[0] for x in source})
if set_l != count:
Expand Down
2 changes: 1 addition & 1 deletion moptipy/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from typing import Final

#: the version string of `moptipy`
__version__: Final[str] = "0.9.125"
__version__: Final[str] = "0.9.126"

0 comments on commit b6ef2db

Please sign in to comment.