Skip to content

Update bitonic_sort with type hints, doctest, snake_case names #4016

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

Merged
merged 3 commits into from
Dec 9, 2020
Merged

Update bitonic_sort with type hints, doctest, snake_case names #4016

merged 3 commits into from
Dec 9, 2020

Conversation

joesinghh
Copy link
Contributor

Describe your change:

Fixes : #4015

  • 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}.

@joesinghh joesinghh requested a review from l3str4nge as a code owner December 7, 2020 15:41
@ghost ghost added awaiting reviews This PR is ready to be reviewed require descriptive names This PR needs descriptive function and/or variable names require tests Tests [doctest/unittest/pytest] are required require type hints https://docs.python.org/3/library/typing.html labels Dec 7, 2020
@ghost
Copy link

ghost commented Dec 7, 2020

Pull Request Report

@Joe-Sin7h Hello! I'm a bot made to check all the pull request Python files. First of all, I want to say thank you for your time and interest in this project and for opening a pull request. There seems to be missing requirements in some of the Python files submitted in this pull request. Please read through the report and make the necessary changes. You can take a look at the relevant links provided after the report.

What are node paths? 🔽

The report contains headings and a checklist where the items are paths to the class/function/parameter where the requirement is missing. Node paths are double colon :: separated names and can be in any of the following format:

  • Class path: [file_name]::[class_name]
  • Function path: [file_name]::[function_name]
  • Function parameter path: [file_name]::[function_name]::[parameter_name]
  • Method path: [file_name]::[class_name]::[function_name]
  • Method parameter path: [file_name]::[class_name]::[function_name]::[parameter_name]

Following functions require tests [doctest/unittest/pytest]:

  • sorts/bitonic_sort.py::compAndSwap
  • sorts/bitonic_sort.py::bitonic_merge
  • sorts/bitonic_sort.py::bitonic_sort
  • sorts/bitonic_sort.py::sort

Following class/functions/parameters require descriptive names:

  • sorts/bitonic_sort.py::compAndSwap::a
  • sorts/bitonic_sort.py::compAndSwap::i
  • sorts/bitonic_sort.py::compAndSwap::j
  • sorts/bitonic_sort.py::bitonic_merge::a
  • sorts/bitonic_sort.py::bitonic_sort::a
  • sorts/bitonic_sort.py::sort::a
  • sorts/bitonic_sort.py::sort::N

Following functions require return type hints:

NOTE: If the function returns None then provide the type hint as def function() -> None

  • sorts/bitonic_sort.py::compAndSwap
  • sorts/bitonic_sort.py::bitonic_merge
  • sorts/bitonic_sort.py::bitonic_sort
  • sorts/bitonic_sort.py::sort

Following function parameters require type hints:

  • sorts/bitonic_sort.py::compAndSwap::a
  • sorts/bitonic_sort.py::compAndSwap::i
  • sorts/bitonic_sort.py::compAndSwap::j
  • sorts/bitonic_sort.py::compAndSwap::dire
  • sorts/bitonic_sort.py::bitonic_merge::a
  • sorts/bitonic_sort.py::bitonic_merge::low
  • sorts/bitonic_sort.py::bitonic_merge::cnt
  • sorts/bitonic_sort.py::bitonic_merge::dire
  • sorts/bitonic_sort.py::bitonic_sort::a
  • sorts/bitonic_sort.py::bitonic_sort::low
  • sorts/bitonic_sort.py::bitonic_sort::cnt
  • sorts/bitonic_sort.py::bitonic_sort::dire
  • sorts/bitonic_sort.py::sort::a
  • sorts/bitonic_sort.py::sort::N
  • sorts/bitonic_sort.py::sort::up
Relevant links 🔽

@ghost ghost removed awaiting reviews This PR is ready to be reviewed labels Dec 7, 2020
@joesinghh
Copy link
Contributor Author

There were no doctests initially in bitonic_sort.py.

@ghost ghost added the tests are failing Do not merge until tests pass label Dec 7, 2020
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

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

If possible, can you please fix all the requirements mentioned in the comment made by the bot?

  • doctest
  • Descriptive parameter names
  • Using snake_case
  • Providing type hints

If not, then please fix the pre-commit error, and then we're good to go!

@ghost ghost added the awaiting changes A maintainer has requested changes to this PR label Dec 9, 2020
@ghost ghost removed the tests are failing Do not merge until tests pass label Dec 9, 2020
@ghost ghost removed require tests Tests [doctest/unittest/pytest] are required require descriptive names This PR needs descriptive function and/or variable names require type hints https://docs.python.org/3/library/typing.html labels Dec 9, 2020
@ghost ghost removed the awaiting changes A maintainer has requested changes to this PR label Dec 9, 2020
@dhruvmanila dhruvmanila changed the title Updated input Update bitonic_sort with type hints, doctest, snake_case names Dec 9, 2020
@dhruvmanila dhruvmanila merged commit c359768 into TheAlgorithms:master Dec 9, 2020
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
…gorithms#4016)

* Updated input
* Fix pre-commit error
* Add type hints, doctests, black, snake_case

Co-authored-by: Dhruv Manilawala <[email protected]>
peRFectBeliever pushed a commit to peRFectBeliever/Python that referenced this pull request Apr 1, 2021
…gorithms#4016)

* Updated input
* Fix pre-commit error
* Add type hints, doctests, black, snake_case

Co-authored-by: Dhruv Manilawala <[email protected]>
Panquesito7 pushed a commit to Panquesito7/Python that referenced this pull request May 13, 2021
…gorithms#4016)

* Updated input
* Fix pre-commit error
* Add type hints, doctests, black, snake_case

Co-authored-by: Dhruv Manilawala <[email protected]>
shermanhui pushed a commit to shermanhui/Python that referenced this pull request Oct 22, 2021
…gorithms#4016)

* Updated input
* Fix pre-commit error
* Add type hints, doctests, black, snake_case

Co-authored-by: Dhruv Manilawala <[email protected]>
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.

Input Text Missing
2 participants