Script (just modified to add the print statements from before): http://kmdaily.pastebin.com/m7cefb266
My output: annotation_db.itervalues = 247912 annotation_db.values = 247912 annotation_db.sliceDB.iteritems = 247912 annotation_db.sliceDB.items = 247912 So it's not that! When I comment out building the mapping.Mapping from the iteration I'm doing, I get the correct counts using itervalues: # use itervalues...doesn't iterate through all events! n = 0 x = 0 for (n, event) in enumerate(events.itervalues()): if event.clusterid: x += 1 # cluster = clusters[event.clusterid + 1] # es = M.get(cluster, []) # es.append(event) # M[cluster] = es print "With itervalues, number of events seen: = %s, x = %s" % (n,x) M.close() Output: With itervalues, number of events seen: = 247911, x = 247910 On Jun 15, 5:29 pm, Christopher Lee <l...@chem.ucla.edu> wrote: > Hi Kenny, > if annotation_db.itervalues() and annotation_db.values() return > different iteration counts, I'd strongly expect > annotation_db.sliceDB.iteritems() and annotation_db.sliceDB.items() to > also return different iteration counts. Could you check that, > please? And please post the code that checks the counts immediately > after creating the AnnotationDB (i.e. no worldbase), so we can see > exactly how you're counting from the iterator. > > Thanks! > > Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pygr-dev" group. To post to this group, send email to pygr-dev@googlegroups.com To unsubscribe from this group, send email to pygr-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/pygr-dev?hl=en -~----------~----~----~----~------~----~------~--~---