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

Add name argument to all cost functions #1017

Merged
merged 3 commits into from
Aug 1, 2024

Conversation

HDembinski
Copy link
Member

@HDembinski HDembinski commented Aug 1, 2024

Closes #941

So far the iminuit.cost functions only support models that pass each parameter as a positional argument. This makes it difficult to use models whose number of arguments should be easy to vary.

To make working with the latter easier, the cost functions now support models with a variable number of arguments in the form def model(x, *par). The actual number of arguments and their names are then passed with the new keyword name, which can also be used to override the model parameter names found by inspecting the model signature.

  • Template
  • BinnedNLL
  • ExtendedBinnedNLL
  • LeastSquares
  • UnbinnedNLL
  • ExtendedUnbinnedNLL

@HDembinski HDembinski merged commit 06bdc27 into develop Aug 1, 2024
8 checks passed
@HDembinski HDembinski deleted the support_name_in_all_cost_functions branch August 1, 2024 14:54
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

Successfully merging this pull request may close these issues.

CostSum support for cost functions accepting a parameter array
1 participant