pixelogik / NearPy

Python framework for fast (approximated) nearest neighbour search in large, high-dimensional data sets using different locality-sensitive hashes.
MIT License
759 stars 152 forks source link

A bug in class Engine __init__() function #24

Closed shixing closed 9 years ago

shixing commented 9 years ago

In engine.py, the class Engine __init__() function, the default value for storage is MemoryStorage(). However, in this case, if I create two Engine instances without passing storage instance (i.e. using the default value), the two engine instances would share the same storage instance. I am not sure if you want that behavior, but to me, it's a little bit awkward.

I recommend change to this :

def __init__(...,storage = None):
    if storage == None : 
         self.storage = MemoryStorage()
pixelogik commented 9 years ago

This should not be the case, I will check that. Thanks for spotting that!

pixelogik commented 9 years ago

Fixed with last commit in develop branch