Skip to content

Pure, immutable ParametrizedFunction #568

Open

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.

Activity

  1. self-assigned this
    on Jul 6, 2026
  2. changed the title [-]Pure, immutable ParametrizedFunction[/-] [+]Pure, immutable `ParametrizedFunction`[/+] on Jul 6, 2026
  3. added this to the 0.5.0 milestone on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions