Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch between docstring and functionality #62

Open
braingineer opened this issue Mar 10, 2017 · 1 comment
Open

Mismatch between docstring and functionality #62

braingineer opened this issue Mar 10, 2017 · 1 comment

Comments

@braingineer
Copy link

braingineer commented Mar 10, 2017

There is at least one mismatch that I'm noticing right now. Specifically, the functionality specified in the docstring of Engine doesn't match what happens.

For example, in engine.py, you say:

There are four different modes of the engine:

. . .

2) No distance - The distance argument is None.
                In this case only the vector filters are applied to
                the bucket contents and the result is a list of
                filtered (vector, data) tuples.

But you're specifically replacing all incoming None arguments with default values:

def __init__(self, ...):
    #. . .
    if distance is None: distance = CosineDistance()
    self.distance = distance

Then, in Engine.neighbors, you check for self.distance being None and execute based on that:

def neighbors(self, v):
    #. . .
    # Apply distance implementation if specified
    if self.distance:
        candidates = self._append_distances(v, self.distance, candidates)
@pixelogik
Copy link
Owner

@braingineer Yeah that's weird. Will check where that line with CosineDistance() is coming from

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants