Skip to content

Commit

Permalink
Fixed indexer: prevCount was not set
Browse files Browse the repository at this point in the history
  • Loading branch information
swarris committed Jul 22, 2015
1 parent b1488ed commit c70513a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyPaSWAS/Core/Indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def indicesToProcessLeft(self):

def createIndex(self, sequence, fileName = None, retainInMemory=True):
currentTupleSet = {}
self.prevCount = self.indexCount
self.indexCount = 0
for window in self.wSize:
if not os.path.isfile(self.pickleName(fileName, window)):
Expand Down Expand Up @@ -139,15 +140,15 @@ def pickle(self, fileName, window = None):

def unpickleWindow(self, fileName, selectedWindow):
self.logger.debug("unpickle file: "+ self.pickleName(fileName, selectedWindow))
try:
if True:#try:
dump = open(self.pickleName(fileName, selectedWindow), "r")
tSet = cPickle.loads(zlib.decompress(dump.read()))
for t in tSet:
self.indexCount+= len(tSet[t])
self.indexCount += 1 + self.prevCount if self.prevCount == 0 else self.prevCount
self.tupleSet.update(tSet)
dump.close()
except:
else: #except:
self.logger.warning("Could not open pickle file: "+ self.pickleName(fileName, selectedWindow))
self.logger.warning("Error: " + str(sys.exc_info()[0]))
return False
Expand Down

0 comments on commit c70513a

Please sign in to comment.