Skip to content

Pure, immutable ParametrizedFunction #568

Description

@redeboer

Replace the stateful parameter contract of ParametrizedFunction with pure evaluation:

  • function(data, parameters): parameter values are merged with the construction-time defaults per call and are never sticky.
  • with_parameters(): returns a new function with updated defaults (for post-fit plotting, data generation, etc.). The compiled backend function is shared, so this is cheap.
  • update_parameters() is removed and ParametrizedBackendFunction becomes immutable (frozen).

This makes functions thread-safe and free of hidden side effects: estimators no longer mutate the user's function on every call. Estimator internals switch to the pure call and the documentation notebooks migrate to the new idioms in the same PR.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions