-
-
Notifications
You must be signed in to change notification settings - Fork 47k
Create graphs/dijkstra_alternate.py #7405
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
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all set , all functions work well
@AtulRajput01 check pre-commit details and fix the issues. |
Instead of deleting someone else's work, let's move this to a separate file |
okay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
code fix . |
graphs/dijkstra.py:6:10: N802 function name 'printSolution' should be lowercase |
done sir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to CONTRBUTING.md there needs to be at least one algorithmic function that takes in one or more parameters and returns one or more values. Algorithmic functions should not print().
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
okay sir ,i understood very well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- In line 30, during function call, it should be
self.minimum_distance
- All
dist
should bedistances
or vice versa. - All
sptset
should bespt_set
or vice versaor a more self-documenting name. printsolution
should beprint_solution
or vice versa.- Include doctests.
- Provide some comments in algorithm execution.
A general advice is to execute the code online/locally to fix the compilation(interpreter) errors. 👍🏻 |
for more information, see https://pre-commit.ci
it's working on my machine as well, then why pre-commit failure accur |
graphs/dijkstra.py:22:48: E712 comparison to False should be 'if cond is False:' or 'if not cond:' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moreover, check my comment above which Christian has edited. Use distances
, spt_set
and print_solution
.
OK. I changed the filename, used self-documenting names for functions and variables, added type hints, and docstrings with doctests. I still have no clue what a better name for |
@cclauss |
Did you run the tests as mentioned in the contributing guideline? |
ok
…On Thu, Oct 20, 2022 at 9:15 AM Paul ***@***.***> wrote:
A general advice is to execute the code online/locally to fix the
compilation(interpreter) errors. 👍🏻
it's working on my machine as well, then why pre-commit failure accur
Did you run the tests as mentioned in the contributing guideline?
—
Reply to this email directly, view it on GitHub
<#7405 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AWC54XNGECL7KXCONOD75ZDWEC57DANCNFSM6AAAAAARIJNPRI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.