-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Readable code, function docstring and doctests #10888
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
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.
This is checked on the commit message but these changes do NOT comply.
Please avoid changing both code and tests in a single pull request.
I have removed the added doctests. Now, there is only one change - the code. |
Great. Please open another pull request with the doctests and we can merge that one before this one. |
I have opened the PR #10891 which has the added doctests. Thanks! |
OK. Please add the tests that have been merged to |
Added the tests that have been merged to master. |
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: Christian Clauss <cclauss@me.com>
for more information, see https://pre-commit.ci
… into fractional-knapsack
Renamed the variables. |
05d92c0
to
aa93e55
Compare
for more information, see https://pre-commit.ci
I'll add the changes tomorrow. Thanks for highlighting the issues. |
I have added the input validation check for |
I have corrected the algorithm. |
Improved code readability by using separate if-elif statements for conditional checks.
Added inline comments to describe the procedure steps.
Enhanced function documentation for clarity.
Incorporated additional function doctests for thorough testing.
Added Wikipedia reference link for the Fractional Knapsack algorithm.
Checklist: