Skip to content

refactor(mmm): rename optimize_budget **minimize_kwargs to **allocate_budget_kwargs#2563

Open
anevolbap wants to merge 6 commits into
pymc-labs:mainfrom
anevolbap:fix/1660-allocate-budget-kwargs
Open

refactor(mmm): rename optimize_budget **minimize_kwargs to **allocate_budget_kwargs#2563
anevolbap wants to merge 6 commits into
pymc-labs:mainfrom
anevolbap:fix/1660-allocate-budget-kwargs

Conversation

@anevolbap
Copy link
Copy Markdown
Contributor

@anevolbap anevolbap commented May 12, 2026

Closes #1660.

BudgetOptimizerWrapper.optimize_budget's variadic relays every keyword to BudgetOptimizer.allocate_budget (x0, minimize_kwargs, return_if_fail, ...), not only the scipy minimize options, so the previous name was misleading. Renaming to **allocate_budget_kwargs matches what the parameter actually does and avoids the awkward minimize_kwargs={"minimize_kwargs": {...}} reading.

User-facing calls are unaffected: callers pass minimize_kwargs=, x0=, return_if_fail= as named kwargs that the variadic absorbs and re-forwards by name.


📚 Documentation preview 📚: https://pymc-marketing--2563.org.readthedocs.build/en/2563/

@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.90%. Comparing base (1a3f0d0) to head (0bf5300).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2563   +/-   ##
=======================================
  Coverage   93.90%   93.90%           
=======================================
  Files          92       92           
  Lines       14089    14089           
=======================================
  Hits        13230    13230           
  Misses        859      859           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…_budget_kwargs

The variadic on BudgetOptimizerWrapper.optimize_budget relays every
keyword to BudgetOptimizer.allocate_budget, not only the scipy
minimize options, so the previous name was misleading (callers could
end up passing minimize_kwargs={...} inside **minimize_kwargs).

Closes pymc-labs#1660
@anevolbap anevolbap force-pushed the fix/1660-allocate-budget-kwargs branch from e39d5d1 to 734acea Compare May 12, 2026 20:24
Copy link
Copy Markdown
Collaborator

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

WDYT @cetagostini ?

@juanitorduz juanitorduz enabled auto-merge (squash) May 15, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Be explicit about the kwargs going to allocate_budget

3 participants