The Wayback Machine - https://web.archive.org/web/20220526214905/https://github.com/TheAlgorithms/Python/pull/5892
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

Remove duplicate is_prime related functions #5892

Merged
merged 9 commits into from Apr 8, 2022

Conversation

paulosgf
Copy link
Contributor

@paulosgf paulosgf commented Dec 29, 2021

Fixes (#5434)

  • Update ciphers.rabin_miller.py
    maths.miller_rabin.py

Describe your change:

Remove duplicate is_prime related functions

  • Add an algorithm?
  • Fix a bug or typo in an existing algorithm?
  • 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 have a URL in its comments that points to Wikipedia or other similar explanation.
  • If this pull request resolves one or more open issues then the commit message contains Fixes: #{$ISSUE_NO}.

* Update ciphers.rabin_miller.py
         maths.miller_rabin.py
@paulosgf paulosgf requested a review from Kush1101 as a code owner Dec 29, 2021
@algorithms-keeper algorithms-keeper bot added enhancement awaiting reviews labels Dec 29, 2021
@paulosgf
Copy link
Contributor Author

@paulosgf paulosgf commented Jan 5, 2022

Hi @Kush1101!
Can you verify my PR, please!

@paulosgf paulosgf changed the title Fixes (#5434) Remove duplicate is_prime related functions Jan 5, 2022
@paulosgf
Copy link
Contributor Author

@paulosgf paulosgf commented Jan 11, 2022

Hi @Kush1101!

Can you review my PR #5892, please?

@poyea poyea self-requested a review Jan 26, 2022
@algorithms-keeper algorithms-keeper bot added the tests are failing label Jan 26, 2022
… project_euler's isPrime to is_prime function names
@paulosgf paulosgf requested a review from dhruvmanila as a code owner Feb 3, 2022
Copy link
Contributor Author

@paulosgf paulosgf left a comment

@poyea, I solved the pro-commit hook problem and I'm submitting the changes that you requested, for review now.

@paulosgf
Copy link
Contributor Author

@paulosgf paulosgf commented Feb 14, 2022

@poyea, I guess that we have the egg and chicken problem here... This pre-commit workflow is breaking on this definition primes: list[int] = [] and returns this error:

pyupgrade................................................................Passed
flake8...................................................................Passed
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

project_euler/problem_007/sol2.py:76: error: "list" is not subscriptable, use "typing.List" instead
Found 1 error in 1 file (checked 1 source file)

codespell................................................................Passed
Validate filenames......................................................Skipped

Then, when I change the code, the pyupgrade module revert it to the original and the flake8 module returns the same error:

pyupgrade................................................................Failed
- hook id: pyupgrade
- duration: 2.83s
- exit code: 1
- files were modified by this hook

Rewriting project_euler/problem_007/sol2.py

flake8...................................................................Failed
- hook id: flake8
- duration: 9.87s
- exit code: 1

project_euler/problem_007/sol2.py:14:1: F401 'typing.List' imported but unused

But I didn't even need to move this part. When I fixed the other files, this new problem has arisen.
What now?

@algorithms-keeper algorithms-keeper bot removed the tests are failing label Mar 24, 2022
@poyea
Copy link
Member

@poyea poyea commented Mar 24, 2022

@paulosgf Let's check if this works?

@paulosgf
Copy link
Contributor Author

@paulosgf paulosgf commented Apr 4, 2022

Yes, @poyea! Now it's Ok to merge.
Awaiting approval!

poyea
poyea approved these changes Apr 8, 2022
Copy link
Member

@poyea poyea left a comment

Thank you for your pull request!🤩

@algorithms-keeper algorithms-keeper bot removed the awaiting reviews label Apr 8, 2022
@poyea poyea merged commit 1400cb8 into TheAlgorithms:master Apr 8, 2022
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants