Skip to content
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

BudgetOptimizer.allocate_budget() doc string doesn't specify default value of x0 #1564

Open
cluhmann opened this issue Mar 16, 2025 · 0 comments · May be fixed by #1565
Open

BudgetOptimizer.allocate_budget() doc string doesn't specify default value of x0 #1564

cluhmann opened this issue Mar 16, 2025 · 0 comments · May be fixed by #1565

Comments

@cluhmann
Copy link
Contributor

The BudgetOptimizer.allocate_budget() doc string includes the argument minimize_kwargs which is described as consisting of "Extra kwargs for scipy.optimize.minimize". The "extra" is because the BudgetOptimizer.allocate_budget() argument budget_bounds gets passed to scipy.optimize.minimize (though it is processed first. No mention of this in the docstring). But the x0 argument is also passed into scipy.optimize.minimize but there is no mention of this. As a result, the following fails:

BudgetOptimizer.allocate_budget(total_budget=100_000, x0=[50_000, 50_000])` 

with the following error:

TypeError: scipy.optimizer_minimize.minimize() got multiple values for keyword argument `x0`

Docstring should be updated or BudgetOptimizer.allocate_budget() should handle x0 as an argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant