Manually update operator in a SplitODEProblem

Hello, I have some library code which constructs a SplitODEProblem with a DiagonalOperator as f1, and I’m trying to write a function to remake the problem with problem.f.f1.A updated according to new parameter values.

I have tried passing an update_func! to DiagonalOperator but the problem is that it gets called automatically at every time step which isn’t what I want.

Is there any thing else I can do short of bundling all the arguments passed to SplitODEProblem into a struct and rebuilding the problem from scratch every time?

I’ve think found a workaround. DiagonalOperator has an accepted_kwargs option which can be used to pass an update flag to update_func!:

update_func!(λ,u,p,t; update=false) = update && f!(λ, p)
DiagonalOperator(λ0; update_func!, accepted_kwargs=Val((:update,)))