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

Documentation, Typing and Refactors #431

Merged
merged 10 commits into from
Jul 17, 2023
Merged

Documentation, Typing and Refactors #431

merged 10 commits into from
Jul 17, 2023

Conversation

Jeadie
Copy link
Contributor

@Jeadie Jeadie commented Jun 27, 2023

Changeset

  • Add typing to functions
  • Add docstrings to most functions
  • Change Definition from a collections.namedtuple to a dataclass
  • Simplify ann_benchmarks.definitions.create_definitions_from_algorithm by decomposing into separate functions.
  • Create a named tuple for Metric
    class Metric(NamedTuple):
        distance: Callable[[np.ndarray, np.ndarray], float]
        distance_valid: Callable[[float], bool]
  • Simplify main function in ann_benchmarks/main.py by moving filter functions (e.g. filter_disabled_algorithms) to separate python functions.
  • NOTE: The above refactors should not alter the underlying logic of ann-benchmarks.

Motivation

I started working on specific changes to ann-benchmarks (e.g. adding new ANN algorithms, extending ann-benchmarks to be used as a performance testing library), and found the codebase hard to understand as a new user. This PR attempts to make the codebase easier to understand and well documented.

@maumueller
Copy link
Collaborator

Thanks @Jeadie, never got around to do this super useful work!

Any reason not to merge this @erikbern?

@erikbern
Copy link
Owner

Hi, sorry, let's ship this. Thank you so much for the contribution @Jeadie !!!

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

Successfully merging this pull request may close these issues.

3 participants