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

Refactor heap operations #24

Merged
merged 10 commits into from
Feb 13, 2024
Merged

Refactor heap operations #24

merged 10 commits into from
Feb 13, 2024

Conversation

nvictus
Copy link
Owner

@nvictus nvictus commented Jul 4, 2023

  • Factor out heap operations to reduce redundancy
  • Introduce an Empty exception for operations that attempt to pull from an empty pqdict, instead of raising a KeyError. We derive Empty from KeyError for subclass compatibility with Mapping.popitem and Mapping.clear which require a KeyError.
  • Make internal heap nodes immutable and fast copy as in Make internal nodes immutables, and add very fast copy. #14
  • Pydocstyle compliant docstrings
  • Remove deprecated module minpq and maxpq in favor of classmethods.
  • Refine type annotations

To-do:

  • Update Dijkstra example to use pqdict.minpq classmethod instead of module function.

@nvictus nvictus merged commit 788179b into master Feb 13, 2024
7 checks passed
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.

1 participant