-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
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
Add doctests for fractional knapsack #10891
Add doctests for fractional knapsack #10891
Conversation
Co-authored-by: Christian Clauss <cclauss@me.com>
On your computer do |
I have successfully executed the doctests, yielding the following output: 11 tests in fractional_knapsack.frac_knapsack |
Co-authored-by: Christian Clauss <cclauss@me.com>
After adding this test case, this is the output: 1 items had failures: This suggests that the existing code cannot handle the case when the input parameters are of another unexpected type (string). |
* Add doctests for fractional knapsack * Update greedy_methods/fractional_knapsack.py Co-authored-by: Christian Clauss <cclauss@me.com> * Run doctests * Update greedy_methods/fractional_knapsack.py Co-authored-by: Christian Clauss <cclauss@me.com> * Update greedy_methods/fractional_knapsack.py --------- Co-authored-by: Christian Clauss <cclauss@me.com>
Added doctests for the Fractional Knapsack algorithm, as requested in PR #10888
Checklist: