Skip to content

Commit

Permalink
Fix the remake issue with problem_type
Browse files Browse the repository at this point in the history
  • Loading branch information
Avik Pal committed Sep 21, 2023
1 parent 04c8edf commit ee4931c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/problems/bvp_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,16 @@ struct BVProblem{uType, tType, isinplace, P, F, BF, PT, K} <:
kwargs::K

@add_kwonly function BVProblem{iip}(f::AbstractBVPFunction{iip, TP}, bc, u0, tspan,

Check warning on line 111 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L111

Added line #L111 was not covered by tests
p = NullParameters(); kwargs...) where {iip, TP}
p = NullParameters(); problem_type=nothing, kwargs...) where {iip, TP}
_tspan = promote_tspan(tspan)
warn_paramtype(p)
problem_type = TP ? TwoPointBVProblem() : StandardBVProblem()
prob_type = TP ? TwoPointBVProblem() : StandardBVProblem()

Check warning on line 115 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L115

Added line #L115 was not covered by tests
# Needed to ensure that `problem_type` doesn't get passed in kwargs
if problem_type === nothing
problem_type = prob_type

Check warning on line 118 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L117-L118

Added lines #L117 - L118 were not covered by tests
else
@assert prob_type === problem_type "This indicates incorrect problem type specification! Users should never pass in `problem_type` kwarg, this exists exclusively for internal use."

Check warning on line 120 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L120

Added line #L120 was not covered by tests
end
return new{typeof(u0), typeof(_tspan), iip, typeof(p), typeof(f), typeof(bc),

Check warning on line 122 in src/problems/bvp_problems.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/bvp_problems.jl#L122

Added line #L122 was not covered by tests
typeof(problem_type), typeof(kwargs)}(f, bc, u0, _tspan, p, problem_type,
kwargs)
Expand Down

0 comments on commit ee4931c

Please sign in to comment.