Skip to content

Commit

Permalink
MNT: rename 'like_with_tols' to 'isclose'
Browse files Browse the repository at this point in the history
  • Loading branch information
shilorigins committed Sep 17, 2024
1 parent 10462fa commit 7fd2ff9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion superscore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def search(self, *post) -> Generator[Entry, None, None]:
for search_term in post:
if not isinstance(search_term, SearchTerm):
search_term = SearchTerm(*search_term)
if search_term.operator == 'like_with_tols':
if search_term.operator == 'isclose':
target, rel_tol, abs_tol = search_term.value
lower = target - target * rel_tol - abs_tol
upper = target + target * rel_tol + abs_tol
Expand Down
4 changes: 2 additions & 2 deletions superscore/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ def test_find_config(sscore_cfg: str):

def test_search(sample_client):
results = list(sample_client.search(
('data', 'like_with_tols', (4, 0, 0))
('data', 'isclose', (4, 0, 0))
))
assert len(results) == 0

results = list(sample_client.search(
SearchTerm(operator='like_with_tols', attr='data', value=(4, .5, 1))
SearchTerm(operator='isclose', attr='data', value=(4, .5, 1))
))
assert len(results) == 4

0 comments on commit 7fd2ff9

Please sign in to comment.