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

RFC: INITIALIZE_DEFAULT / FINALIZE_DEFAULT => initialize! / finalize! #597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 21, 2020

  1. INITIALIZE_DEFAULT / FINALIZE_DEFAULT => initialize! / finalize!

    We want to be able to define callbacks that have predefined initializer/finalizers, e.g.
    ```
    struct Diagnostics
      # some stuff
    end
    DiffEqBase.initialize!(d::Diagnostics, u, t, integrator) = # set up stuff
    DiffEqBase.finalize!(d::Diagnostics, u, t, integrator) = # finalize stuff
    
    DiscreteCallback(mycond, Diagnostics(details)) # don't need to pass explicit initializer / finalizer functions
    ```
    
    We could do this now by defining additional methods for `INITIALIZE_DEFAULT` / `FINALIZE_DEFAULT`, but this seems a bit clearer.
    
    If you're on board, I can add some docs.
    simonbyrne authored Oct 21, 2020
    Configuration menu
    Copy the full SHA
    3b85fd3 View commit details
    Browse the repository at this point in the history