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

Simplify :alg extraction #945

Merged
merged 12 commits into from
Oct 19, 2023
Merged

Simplify :alg extraction #945

merged 12 commits into from
Oct 19, 2023

Conversation

prbzrg
Copy link
Member

@prbzrg prbzrg commented Oct 7, 2023

No description provided.

@prbzrg prbzrg closed this Oct 7, 2023
@prbzrg prbzrg reopened this Oct 7, 2023
@prbzrg
Copy link
Member Author

prbzrg commented Oct 7, 2023

There was a CI failing related to "Steady State Adjoint".
https://github.com/SciML/DiffEqBase.jl/actions/runs/6437743171/job/17483353413#step:6:1071

Based on
https://github.com/SciML/SciMLBase.jl/blob/master/src/deprecated.jl
I replaced types, maybe this fix it.

@prbzrg
Copy link
Member Author

prbzrg commented Oct 7, 2023

Why doesn't this test have an alg? also it doesn't have DifferentialEquations!
https://github.com/SciML/SciMLSensitivity.jl/blob/282c24ef282d50d431913bfac2a83b025d34ae76/test/steady_state.jl#L411

@ChrisRackauckas
Copy link
Member

It's just using the default.

@prbzrg
Copy link
Member Author

prbzrg commented Oct 9, 2023

It's just using the default.

how does it access to defaults when DifferentialEquations isn't imported?

https://github.com/SciML/SciMLSensitivity.jl/blob/master/test/steady_state.jl

@ChrisRackauckas
Copy link
Member

@ChrisRackauckas
Copy link
Member

@avik-pal do you know why this works in SciMLSensitivity but not here? https://github.com/SciML/DiffEqBase.jl/actions/runs/6455307402/job/17563616620?pr=945#step:6:1405 . Is this something solved in SciML/SciMLSensitivity.jl#905 or did it break here?

@prbzrg prbzrg closed this Oct 18, 2023
@prbzrg prbzrg reopened this Oct 18, 2023
@avik-pal
Copy link
Member

I fixed it in 2f0a9a4

@avik-pal
Copy link
Member

Are nonlinear solvers AbstractDEAlgorithm?

elseif solve_args[1] isa AbstractDEAlgorithm

@prbzrg
Copy link
Member Author

prbzrg commented Oct 18, 2023

julia> supertypes(DynamicSS)
(DynamicSS, SteadyStateDiffEq.SteadyStateDiffEqAlgorithm, SciMLBase.AbstractSteadyStateAlgorithm, SciMLBase.AbstractDEAlgorithm, SciMLBase.AbstractSciMLAlgorithm, Any)

@avik-pal
Copy link
Member

Yeah but here the dispatch is failing for the discrete solvers.

julia> supertypes(NewtonRaphson)
(NewtonRaphson, NonlinearSolve.AbstractNewtonAlgorithm, NonlinearSolve.AbstractNonlinearSolveAlgorithm, SciMLBase.AbstractNonlinearAlgorithm, SciMLBase.AbstractSciMLAlgorithm, Any)

Dispatch on AbstractSciMLAlgorithm?

@prbzrg
Copy link
Member Author

prbzrg commented Oct 18, 2023

Is it intended to ignore types of EnsembleAlgorithm and use nothing in

DiffEqBase.jl/src/solve.jl

Lines 1050 to 1051 in 301dd29

if isempty(args) || length(args) == 1 && typeof(args[1]) <: EnsembleAlgorithm
__solve(prob, nothing, args...; kwargs...)

?

@ChrisRackauckas
Copy link
Member

That looks to me like a bug . It would be good to try and find a code that hits that branch.

else
__solve(prob, args...; kwargs...)
__solve(prob, alg; kwargs...)
Copy link
Member

Choose a reason for hiding this comment

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

this is dropping the rest of the args?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, there isn't any other args, the length check assures us.

Copy link
Member

Choose a reason for hiding this comment

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

oh I see

@ChrisRackauckas
Copy link
Member

Can you add tests for the cases which were fixed?

@prbzrg
Copy link
Member Author

prbzrg commented Oct 19, 2023

Most of the errors were caused by simplifying the alg extractions, and some of them needed changes elsewhere. like adding kwargs to EnsembleProblem or having a default isadaptive for non-AbstractDEAlgorithm. Here, I just imitated previous behaviour but IMO, the needed tests should happen elsewhere. like in SciMLBase.

@ChrisRackauckas ChrisRackauckas merged commit d9c3e74 into SciML:master Oct 19, 2023
@prbzrg prbzrg deleted the have-algext branch October 25, 2023 07:55
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.

3 participants