Skip to content

Commit 0fa3fb6

Browse files
committed
fixes for python3
1 parent 0447a36 commit 0fa3fb6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

epitopepredict/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@
1212
import time, io
1313
import operator as op
1414
import re, types
15+
try:
16+
unicode = unicode
17+
except NameError:
18+
#unicode is undefined, must be Python 3
19+
str = str
20+
unicode = str
21+
basestring = (str,bytes)
1522
import math
1623
import subprocess
1724
from subprocess import CalledProcessError
@@ -103,7 +110,7 @@ def dbscan(B=None, x=None, dist=7, minsize=4):
103110
if len(B)==0:
104111
return
105112
x = sorted(B.pos.astype('int'))
106-
X = np.array(zip(x,np.zeros(len(x))), dtype=np.int)
113+
X = np.array(list(zip(x,np.zeros(len(x)))), dtype=np.int)
107114
db = DBSCAN(eps=dist, min_samples=minsize)
108115
db.fit(X)
109116
labels = db.labels_

epitopepredict/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def check_options(opts):
134134
"""Check for missing default options in dict. Meant to handle
135135
incomplete config files"""
136136

137-
sections = baseoptions.keys()
137+
sections = list(baseoptions.keys())
138138
for s in sections:
139139
defaults = dict(baseoptions[s])
140140
for i in defaults:

0 commit comments

Comments
 (0)