Skip to content

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

Merged
dhruvmanila merged 3 commits into
TheAlgorithms:masterfrom
joesinghh:master
Dec 9, 2020
Merged

Update bitonic_sort with type hints, doctest, snake_case names#4016
dhruvmanila merged 3 commits into
TheAlgorithms:masterfrom
joesinghh:master

Conversation

@joesinghh

Copy link
Copy Markdown
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}.

@ghostghost 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

ghost commented Dec 7, 2020

Copy link
Copy Markdown

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 🔽

@ghostghost removed awaiting reviews This PR is ready to be reviewed labels Dec 7, 2020
@joesinghh

Copy link
Copy Markdown
ContributorAuthor

There were no doctests initially in bitonic_sort.py.

@ghostghost added the tests are failing Do not merge until tests pass label Dec 7, 2020

@dhruvmaniladhruvmanila left a comment

Copy link
Copy Markdown
Member

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!

@ghostghost added the awaiting changes A maintainer has requested changes to this PR label Dec 9, 2020
@ghostghost removed the tests are failing Do not merge until tests pass label Dec 9, 2020
@ghostghost 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
@ghostghost removed the awaiting changes A maintainer has requested changes to this PR label Dec 9, 2020
@dhruvmaniladhruvmanila changed the title Updated inputUpdate bitonic_sort with type hints, doctest, snake_case namesDec 9, 2020
@dhruvmanila
dhruvmanila merged commit c359768 into TheAlgorithms:masterDec 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 <dhruvmanila@gmail.com>
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 <dhruvmanila@gmail.com>
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 <dhruvmanila@gmail.com>
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 <dhruvmanila@gmail.com>
Sign up for freeto 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

@joesinghh@dhruvmanila