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

Fix SDEProblem constructor issue #2281

Closed
wants to merge 1 commit into from

Conversation

ErikQQY
Copy link
Member

@ErikQQY ErikQQY commented Sep 25, 2023

Should fix the problems in StochasticDiffEq

@@ -583,7 +583,7 @@ function DiffEqBase.SDEProblem{iip}(sys::SDESystem, u0map = [], tspan = get_tspa
noise_rate_prototype = zeros(eltype(u0), size(noiseeqs))
end

SDEProblem{iip}(f, u0, tspan, p; callback = cbs,
SDEProblem{iip}(f, f.g, u0, tspan, p; callback = cbs,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasn't this removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but from testing locally

f, u0, p = process_DEProblem(SDEFunction{iip}, sys, u0map, parammap; check_length, kwargs...)
SDEProbelm(f, u0, tspan, p; ...)

would cause the same error in CI
but if we changed to

f, u0, p = process_DEProblem(SDEFunction{iip}, sys, u0map, parammap; check_length, kwargs...)
SDEProbelm(f, f.g u0, tspan, p; ...) # or SDEProbelm(f.f, f.g u0, tspan, p; ...)

working fine

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that's the constructor you deleted? Why not just use the SDEProblem(::SDEFunction, u0, tspan, p) dispatch?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the f generated from process_DEProblem here? I think it should be working fine with the v2.0 SciMLBase, which directly build SDEProblem on SDEFunction by using SDEProblem(f, u0, tspan, p).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's generating an SDEFunction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's strange here, I tested f here and indeed I got an SDEFunction, but the constructor SDEProblem(f::SDEFunction, u0, tspan, p; ...) still error here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's what I was asking before merge that you were testing. Did you @which see that everything is going to the right dispatches? I thought you needed tspan::Tuple or something so that it could dispatch correctly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't sure if this guess is right, I am wondering since this is a DiffEqBase.SDEProblem dispatch for SDESystem type, what is the "version" of SDEProblem used here(MTK is still use 1.103.0 version DiffEqBase)?

SDEProblem{iip}(f, u0, tspan, p; callback = cbs,
noise_rate_prototype = noise_rate_prototype, kwargs...)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's forcing SciMLBase v2. The StochasticDiffEq issues are the same problem without MTK involved. I don't think they are hitting the correct dispatches.

@ErikQQY ErikQQY closed this Sep 29, 2023
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.

2 participants