Skip to content

Documentation for sage.numerical.knapsack.knapsack incorrectly specifies default values for the arguments #40115

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

Closed
maxale opened this issue May 16, 2025 · 2 comments

Comments

@maxale
Copy link
Contributor

maxale commented May 16, 2025

Documentation says:

sage.numerical.knapsack.knapsack(seq, binary, max=True, value_only=1, solver=False, verbose=None, integrality_tolerance=0)

while in the source code we see:

def knapsack(seq, binary=True, max=1, value_only=False, solver=None, verbose=0,
             *, integrality_tolerance=1e-3):

Discrepancies:

  • No default value for binary is specified.
  • max=1 vs max=True
  • value_only=1 vs value_only=False
  • solver=False vs solver=None
  • verbose=None vs verbose=0
  • integrality_tolerance=0 vs integrality_tolerance=1e-3
@DaveWitteMorris
Copy link
Member

This is a duplicate of #39627. Default values in the documentation get messed up (shifted to the wrong place) whenever there are keyword-only arguments.

@maxale
Copy link
Contributor Author

maxale commented May 16, 2025

Indeed, thanks!

@maxale maxale closed this as completed May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants