Skip to content

Commit 0be0416

Browse files
committed
fix linting, remove mypy
1 parent 16ed953 commit 0be0416

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

benchmark.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
from typing import Dict, Optional
1+
import argparse
2+
import gzip
23
import timeit
3-
from isal import igzip, isal_zlib
44
import zlib
5-
import gzip
65
from pathlib import Path
7-
import argparse
6+
from typing import Dict
7+
8+
from isal import isal_zlib
89

9-
DATA_DIR = Path(__file__).parent / "tests"/ "data"
10+
DATA_DIR = Path(__file__).parent / "tests" / "data"
1011
COMPRESSED_FILE = DATA_DIR / "test.fastq.gz"
1112
with gzip.open(str(COMPRESSED_FILE), mode="rb") as file_h:
1213
data = file_h.read()
@@ -20,18 +21,19 @@
2021
"16kb": data[:16 * 1024],
2122
"32kb": data[:32 * 1024],
2223
"64kb": data[:64 * 1024],
23-
#"128kb": data[:128*1024],
24-
#"512kb": data[:512*1024]
24+
# "128kb": data[:128*1024],
25+
# "512kb": data[:512*1024]
2526
}
2627
compressed_sizes = {name: zlib.compress(data_block)
2728
for name, data_block in sizes.items()}
2829

2930
compressed_sizes_gzip = {name: gzip.compress(data_block)
3031
for name, data_block in sizes.items()}
3132

33+
3234
def show_sizes():
3335
print("zlib sizes")
34-
print("name\t" + "\t".join(str(level) for level in range(-1,10)))
36+
print("name\t" + "\t".join(str(level) for level in range(-1, 10)))
3537
for name, data_block in sizes.items():
3638
orig_size = max(len(data_block), 1)
3739
rel_sizes = (
@@ -44,7 +46,8 @@ def show_sizes():
4446
for name, data_block in sizes.items():
4547
orig_size = max(len(data_block), 1)
4648
rel_sizes = (
47-
str(round(len(isal_zlib.compress(data_block, level)) / orig_size, 3))
49+
str(round(len(isal_zlib.compress(data_block, level)) / orig_size,
50+
3))
4851
for level in range(0, 4))
4952
print(name + "\t" + "\t".join(rel_sizes))
5053

@@ -69,6 +72,8 @@ def benchmark(name: str,
6972
isal_nanosecs,
7073
zlib_nanosecs,
7174
ratio))
75+
76+
7277
# show_sizes()
7378

7479
def argument_parser() -> argparse.ArgumentParser:
@@ -79,6 +84,7 @@ def argument_parser() -> argparse.ArgumentParser:
7984
parser.add_argument("--gzip", action="store_true")
8085
return parser
8186

87+
8288
if __name__ == "__main__":
8389
args = argument_parser().parse_args()
8490
if args.checksums or args.all:

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ deps=flake8
1616
flake8-import-order
1717
mypy
1818
commands =
19-
flake8 src tests setup.py
20-
mypy src/isal
19+
flake8 src tests setup.py benchmark.py
2120

2221
# Documentation should build on python version 3
2322
[testenv:docs]

0 commit comments

Comments
 (0)