Skip to content

Commit

Permalink
skip another numpy occurence
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann authored Oct 6, 2023
1 parent 11ed025 commit e57bc5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,13 @@ def scorer_tester(scorer, s1, s2, **kwargs):
assert pytest.approx(score1) == extract_iter_res1[0][1]
assert pytest.approx(score1) == extract_iter_res2[0][1]

try:
import numpy as np
except Exception:
np = None

# todo this should be able to handle None similar to the original scorer
if not is_none(s1) and not is_none(s2):
if not is_none(s1) and not is_none(s2) and np is not None:
score6 = process_cpp.cdist([s1], [s2], scorer=scorer, **kwargs)[0][0]
score7 = process_py.cdist([s1], [s2], scorer=scorer, **kwargs)[0][0]
assert pytest.approx(score1) == score6
Expand Down

0 comments on commit e57bc5f

Please sign in to comment.