Skip to content

Update volume.py - #14291

Merged
cclauss merged 8 commits into
TheAlgorithms:masterfrom
kvadrik:patch-1
Sep 5, 2026
Merged

Update volume.py#14291
cclauss merged 8 commits into
TheAlgorithms:masterfrom
kvadrik:patch-1

Conversation

@kvadrik

Copy link
Copy Markdown
Contributor

Describe your change:

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • Add or change doctests? -- Note: Please avoid changing both code and tests in a single pull request.
  • Documentation change?

Checklist:

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized.
  • I know that pull requests will not be merged if they fail the automated tests.
  • This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
  • All new Python files are placed inside an existing directory.
  • All filenames are in all lowercase characters with no spaces or dashes.
  • All functions and variable names follow Python naming conventions.
  • All function parameters and return values are annotated with Python type hints.
  • All functions have doctests that pass the automated testing.
  • All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
  • If this pull request resolves one or more open issues then the description above includes the issue number(s) with a closing keyword: "Fixes #ISSUE-NUMBER".

@algorithms-keeperalgorithms-keeperBot added awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files tests are failing Do not merge until tests pass labels Feb 18, 2026
@kvadrik

Copy link
Copy Markdown
ContributorAuthor

The CI errors are not related to my changes - they're
in other files (hash_table_with_linked_list.py,
linear_discriminant_analysis.py, jump_search.py).
My code runs correctly as shown when tested separately.

@mindauglmindaugl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is likely more efficient to replace 2**0.5 with math.sqrt(2)

@kvadrik

Copy link
Copy Markdown
ContributorAuthor

It is likely more efficient to replace 2**0.5 with math.sqrt(2)

But how can I do this after I have committed my change?

Clean up trailing whitespace and empty list in deque initialization to satisfy Ruff linting rules.
Applied PEP 695 syntax to the valid_input function by moving the 'num' generic into brackets. This resolves the UP047 error in the machine_learning directory.
Refactor jump_search to use PEP 695 type parameters [T] as required by the latest Ruff configuration.
@algorithms-keeperalgorithms-keeperBot removed the tests are failing Do not merge until tests pass label Feb 27, 2026
Updated the PEP 695 type parameter syntax to include the 'Comparable' bound. This resolves the Mypy error regarding unsupported left operand types for the '<' operator, ensuring that the generic type T supports comparisons.
@algorithms-keeperalgorithms-keeperBot mentioned this pull request Mar 11, 2026
15 tasks
Comment threaddata_structures/hashing/hash_table_with_linked_list.py
Comment threadmachine_learning/linear_discriminant_analysis.py
Comment threadsearches/jump_search.py
@algorithms-keeperalgorithms-keeperBot added awaiting changes A maintainer has requested changes to this PR and removed awaiting reviews This PR is ready to be reviewed labels Sep 5, 2026
Co-authored-by: Christian Clauss <cclauss@me.com>
@algorithms-keeperalgorithms-keeperBot added awaiting reviews This PR is ready to be reviewed and removed awaiting changes A maintainer has requested changes to this PR labels Sep 5, 2026
@algorithms-keeperalgorithms-keeperBot removed the awaiting reviews This PR is ready to be reviewed label Sep 5, 2026
@algorithms-keeperalgorithms-keeperBot added the awaiting reviews This PR is ready to be reviewed label Sep 5, 2026
@cclauss
cclauss merged commit ced4c09 into TheAlgorithms:masterSep 5, 2026
5 checks passed
@algorithms-keeperalgorithms-keeperBot removed the awaiting reviews This PR is ready to be reviewed label Sep 5, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancementThis PR modified some existing filesgit merge conflict

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@kvadrik@cclauss@mindaugl