Skip to content

Conversation

@asukaminato0721
Copy link
Contributor

Describe your change:

Add typing for bfs and make the code more brief.

  • 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}.
@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 199a2480-b6f0-11ea-bb0d-6965ce86ea0c
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: a5cfeeb0-b6f2-11ea-bb0d-6965ce86ea0c
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Fix several hidden troubles.

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: f9755aa0-b6f2-11ea-bb0d-6965ce86ea0c
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Fix the type of return value of bfs.

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 760f6510-b6f3-11ea-bb0d-6965ce86ea0c
@cclauss
Copy link
Member

cclauss commented Jun 25, 2020

You will need to change all instances of bfs() to breadth_first_search().

change all instances of bfs() to breadth_first_search().
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Change all instances of bfs() to breadth_first_search().

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 76d334d0-b6f4-11ea-bb0d-6965ce86ea0c
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Change the function name in annotate.

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: eb9c0e90-b6f4-11ea-bb0d-6965ce86ea0c
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Add one more blank line.

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 484d58a0-b6f6-11ea-bb0d-6965ce86ea0c
Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Delete one blank line.

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 54857070-b6f7-11ea-bb0d-6965ce86ea0c
I've read the https://www.flake8rules.com/rules/W391.html, and still don't know how to do it. I've tried using 0 ,1,2 blank lines...
@cclauss
Copy link
Member

cclauss commented Jun 25, 2020

Do not worry about Euler 47

Copy link
Contributor Author

@asukaminato0721 asukaminato0721 left a comment

Choose a reason for hiding this comment

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

Delete one blank line.
Confused with this https://www.flake8rules.com/rules/W391.html

@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 1ffbf7a0-b6f9-11ea-bb0d-6965ce86ea0c
wuyudi and others added 2 commits June 25, 2020 23:33
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: a51fad50-b6f9-11ea-bb0d-6965ce86ea0c
@cclauss
Copy link
Member

cclauss commented Jun 25, 2020

We already have a breadth_first_search.py. Should this file be deleted??

@cclauss cclauss merged commit d2fa91b into TheAlgorithms:master Jun 25, 2020
@TravisBuddy
Copy link

Hey @wuyudi,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: 4ac8aa20-b6fc-11ea-bb0d-6965ce86ea0c
stokhos pushed a commit to stokhos/Python that referenced this pull request Jan 3, 2021
* Add typing for bfs * Add url for BFS * rename the function Co-authored-by: Christian Clauss <cclauss@me.com> * Update graphs/bfs.py Co-authored-by: Christian Clauss <cclauss@me.com> * Change the return value type of bfs * change the function name. change all instances of bfs() to breadth_first_search(). * change the function name in annotate * Add one more blank line. * Delete one blank line. * Delete one blank line. I've read the https://www.flake8rules.com/rules/W391.html, and still don't know how to do it. I've tried using 0 ,1,2 blank lines... * Update graphs/bfs.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update graphs/bfs.py Co-authored-by: Christian Clauss <cclauss@me.com> * Rename bfs.py to breadth_first_search_2.py Co-authored-by: Christian Clauss <cclauss@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants