Skip to content

Commit 6c4dfb5

Browse files
committed
Adds a skip list to the profiler for replays known to not parse correctly
1 parent 6c43e78 commit 6c4dfb5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

profile.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
import os,sys
66
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
7-
from sc2reader import Replay
7+
import sc2reader
8+
9+
skipnames = ('empty','footman')
810

911
def parse_replays():
1012
# Run four times to dampen noise
@@ -14,12 +16,12 @@ def parse_replays():
1416
for root, sub_folders, files in os.walk(rootdir):
1517
for file in files:
1618
basename, extension = os.path.splitext(file)
17-
if (basename != "empty" and extension.lower() == ".sc2replay"):
19+
if (basename not in skipnames and extension.lower() == ".sc2replay"):
1820
file_list.append(os.path.join(root,file))
1921

2022
for file in file_list:
2123
print file
22-
replay = Replay(file)
24+
replay = sc2reader.read(file)
2325

2426
# Use the results of this function when comparing performance with other libraries.
2527
def benchmark_with_timetime():
@@ -34,5 +36,5 @@ def profile():
3436
stats.strip_dirs().sort_stats("time").print_stats(30)
3537

3638

37-
benchmark_with_timetime()
38-
#profile()
39+
#benchmark_with_timetime()
40+
profile()

0 commit comments

Comments
 (0)