Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 30, 2024
1 parent 0033b56 commit 7d62be0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tests/test_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ def load_sequences():
def mh():
return MinHash(MINHASH_NUM, MINHASH_K, track_abundance=False)


@pytest.fixture
def mh_protein():
return MinHash(
MINHASH_NUM, MINHASH_K, is_protein=True, track_abundance=False
)
return MinHash(MINHASH_NUM, MINHASH_K, is_protein=True, track_abundance=False)


@pytest.fixture
Expand Down Expand Up @@ -91,6 +90,7 @@ def test_add_many(benchmark, mh):
def test_similarity(benchmark, mh, populated_mh):
benchmark(mh.similarity, populated_mh)


def test_count_common(benchmark, mh, populated_mh):
benchmark(mh.count_common, populated_mh)

Expand All @@ -106,6 +106,7 @@ def test_copy(benchmark, populated_mh):
def test_concat(benchmark, mh, populated_mh):
benchmark(mh.__iadd__, populated_mh)


####################


Expand All @@ -117,17 +118,20 @@ def setup(self):
for seq in self.sequences:
self.populated_mh.add_sequence(seq)


def time_get_mins_abundance(self):
mh = self.populated_mh
for i in range(GET_MINS_RANGE):
mh.get_mins(with_abundance=True)


def time_set_abundances(self):
mh = self.mh
mins = self.populated_mh.get_mins(with_abundance=True)
for i in range(SET_ABUNDANCES_RANGE):
mh.set_abundances(mins)


def time_set_abundances_noclear(self):
mh = self.mh
mins = self.populated_mh.get_mins(with_abundance=True)
Expand All @@ -144,9 +148,7 @@ def zipstore():

zf = NamedTemporaryFile()

with zipfile.ZipFile(
zf, mode="w", compression=zipfile.ZIP_STORED
) as storage:
with zipfile.ZipFile(zf, mode="w", compression=zipfile.ZIP_STORED) as storage:
for i in range(ZIP_STORAGE_WRITE):
# just so we have lots of entries
storage.writestr(str(i), b"0")
Expand Down

0 comments on commit 7d62be0

Please sign in to comment.