Skip to content

Commit 57d7da1

Browse files
Revert "fix: use remake to promote intialization problem"
This reverts commit 27e7efb.
1 parent 38724b2 commit 57d7da1

File tree

3 files changed

+12
-36
lines changed

3 files changed

+12
-36
lines changed

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,7 @@ function DiffEqBase.ODEProblem{iip, specialize}(sys::AbstractODESystem, u0map =
817817
end
818818

819819
# Call `remake` so it runs initialization if it is trivial
820-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
821-
# u0 and p of initializeprob
822-
return remake(ODEProblem{iip}(f, u0, tspan, p, pt; kwargs1..., kwargs...); u0, p)
820+
return remake(ODEProblem{iip}(f, u0, tspan, p, pt; kwargs1..., kwargs...))
823821
end
824822
get_callback(prob::ODEProblem) = prob.kwargs[:callback]
825823

@@ -1042,14 +1040,9 @@ function DiffEqBase.DAEProblem{iip}(sys::AbstractODESystem, du0map, u0map, tspan
10421040
end
10431041

10441042
# Call `remake` so it runs initialization if it is trivial
1045-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
1046-
# u0 and p of initializeprob
1047-
return remake(
1048-
DAEProblem{iip}(
1049-
f, du0, u0, tspan, p; differential_vars = differential_vars,
1050-
kwargs..., kwargs1...);
1051-
u0,
1052-
p)
1043+
return remake(DAEProblem{iip}(
1044+
f, du0, u0, tspan, p; differential_vars = differential_vars,
1045+
kwargs..., kwargs1...))
10531046
end
10541047

10551048
function generate_history(sys::AbstractODESystem, u0; expression = Val{false}, kwargs...)
@@ -1095,9 +1088,7 @@ function DiffEqBase.DDEProblem{iip}(sys::AbstractODESystem, u0map = [],
10951088
kwargs1 = merge(kwargs1, (callback = cbs,))
10961089
end
10971090
# Call `remake` so it runs initialization if it is trivial
1098-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
1099-
# u0 and p of initializeprob
1100-
return remake(DDEProblem{iip}(f, u0, h, tspan, p; kwargs1..., kwargs...); u0, p)
1091+
return remake(DDEProblem{iip}(f, u0, h, tspan, p; kwargs1..., kwargs...))
11011092
end
11021093

11031094
function DiffEqBase.SDDEProblem(sys::AbstractODESystem, args...; kwargs...)
@@ -1148,14 +1139,9 @@ function DiffEqBase.SDDEProblem{iip}(sys::AbstractODESystem, u0map = [],
11481139
noise_rate_prototype = zeros(eltype(u0), size(noiseeqs))
11491140
end
11501141
# Call `remake` so it runs initialization if it is trivial
1151-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
1152-
# u0 and p of initializeprob
1153-
return remake(
1154-
SDDEProblem{iip}(f, f.g, u0, h, tspan, p;
1155-
noise_rate_prototype =
1156-
noise_rate_prototype, kwargs1..., kwargs...);
1157-
u0,
1158-
p)
1142+
return remake(SDDEProblem{iip}(f, f.g, u0, h, tspan, p;
1143+
noise_rate_prototype =
1144+
noise_rate_prototype, kwargs1..., kwargs...))
11591145
end
11601146

11611147
"""

src/systems/diffeqs/sdesystem.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -818,13 +818,8 @@ function DiffEqBase.SDEProblem{iip, specialize}(
818818
kwargs = filter_kwargs(kwargs)
819819

820820
# Call `remake` so it runs initialization if it is trivial
821-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
822-
# u0 and p of initializeprob
823-
return remake(
824-
SDEProblem{iip}(f, u0, tspan, p; callback = cbs, noise,
825-
noise_rate_prototype = noise_rate_prototype, kwargs...);
826-
u0,
827-
p)
821+
return remake(SDEProblem{iip}(f, u0, tspan, p; callback = cbs, noise,
822+
noise_rate_prototype = noise_rate_prototype, kwargs...))
828823
end
829824

830825
function DiffEqBase.SDEProblem(sys::ODESystem, args...; kwargs...)

src/systems/nonlinear/nonlinearsystem.jl

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,7 @@ function DiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem, u0map,
557557
check_length, kwargs...)
558558
pt = something(get_metadata(sys), StandardNonlinearProblem())
559559
# Call `remake` so it runs initialization if it is trivial
560-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
561-
# u0 and p of initializeprob
562-
return remake(NonlinearProblem{iip}(f, u0, p, pt; filter_kwargs(kwargs)...); u0, p)
560+
return remake(NonlinearProblem{iip}(f, u0, p, pt; filter_kwargs(kwargs)...))
563561
end
564562

565563
function DiffEqBase.NonlinearProblem(sys::AbstractODESystem, args...; kwargs...)
@@ -593,10 +591,7 @@ function DiffEqBase.NonlinearLeastSquaresProblem{iip}(sys::NonlinearSystem, u0ma
593591
check_length, kwargs...)
594592
pt = something(get_metadata(sys), StandardNonlinearProblem())
595593
# Call `remake` so it runs initialization if it is trivial
596-
# Pass `u0` and `p` to run `ReconstructInitializeprob` which will promote
597-
# u0 and p of initializeprob
598-
return remake(
599-
NonlinearLeastSquaresProblem{iip}(f, u0, p; filter_kwargs(kwargs)...); u0, p)
594+
return remake(NonlinearLeastSquaresProblem{iip}(f, u0, p; filter_kwargs(kwargs)...))
600595
end
601596

602597
const TypeT = Union{DataType, UnionAll}

0 commit comments

Comments
 (0)