Skip to content

Commit

Permalink
fixes for python3
Browse files Browse the repository at this point in the history
  • Loading branch information
dmnfarrell committed Jan 13, 2018
1 parent 0447a36 commit 0fa3fb6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion epitopepredict/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
import time, io
import operator as op
import re, types
try:
unicode = unicode
except NameError:
#unicode is undefined, must be Python 3
str = str
unicode = str
basestring = (str,bytes)
import math
import subprocess
from subprocess import CalledProcessError
Expand Down Expand Up @@ -103,7 +110,7 @@ def dbscan(B=None, x=None, dist=7, minsize=4):
if len(B)==0:
return
x = sorted(B.pos.astype('int'))
X = np.array(zip(x,np.zeros(len(x))), dtype=np.int)
X = np.array(list(zip(x,np.zeros(len(x)))), dtype=np.int)
db = DBSCAN(eps=dist, min_samples=minsize)
db.fit(X)
labels = db.labels_
Expand Down
2 changes: 1 addition & 1 deletion epitopepredict/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def check_options(opts):
"""Check for missing default options in dict. Meant to handle
incomplete config files"""

sections = baseoptions.keys()
sections = list(baseoptions.keys())
for s in sections:
defaults = dict(baseoptions[s])
for i in defaults:
Expand Down

0 comments on commit 0fa3fb6

Please sign in to comment.