Skip to content

Commit

Permalink
overload 2 arg show for probs and sols
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Jul 13, 2023
1 parent f2eab6b commit 73f86a3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
19 changes: 10 additions & 9 deletions src/problems/problem_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function Base.summary(io::IO, prob::AbstractLinearProblem)
type_color, isinplace(prob),
no_color)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractLinearProblem)
Base.show(io::IO, mime::MIME"text/plain", A::AbstractSciMLProblem) = show(io, A)
function Base.show(io::IO, A::AbstractLinearProblem)

Check warning on line 43 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L42-L43

Added lines #L42 - L43 were not covered by tests
summary(io, A)
println(io)
print(io, "b: ")
Expand All @@ -56,14 +57,14 @@ function Base.summary(io::IO, prob::AbstractNonlinearProblem{uType, iip}) where
type_color, isinplace(prob),
no_color)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractNonlinearProblem)
function Base.show(io::IO, A::AbstractNonlinearProblem)

Check warning on line 60 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L60

Added line #L60 was not covered by tests
summary(io, A)
println(io)
print(io, "u0: ")
show(io, mime, A.u0)
end

function Base.show(io::IO, mime::MIME"text/plain", A::IntervalNonlinearProblem)
function Base.show(io::IO, A::IntervalNonlinearProblem)

Check warning on line 67 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L67

Added line #L67 was not covered by tests
summary(io, A)
println(io)
print(io, "Interval: ")
Expand All @@ -78,7 +79,7 @@ function Base.summary(io::IO, prob::AbstractOptimizationProblem)
type_color, isinplace(prob),
no_color)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractOptimizationProblem)
function Base.show(io::IO, A::AbstractOptimizationProblem)

Check warning on line 82 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L82

Added line #L82 was not covered by tests
summary(io, A)
println(io)
print(io, "u0: ")
Expand All @@ -93,7 +94,7 @@ function Base.summary(io::IO, prob::AbstractIntegralProblem)
type_color, isinplace(prob),
no_color)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractIntegralProblem)
function Base.show(io::IO, A::AbstractIntegralProblem)

Check warning on line 97 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L97

Added line #L97 was not covered by tests
summary(io, A)
println(io)
end
Expand All @@ -103,7 +104,7 @@ function Base.summary(io::IO, prob::AbstractNoiseProblem)
nameof(typeof(prob)), " with WType ", typeof(prob.noise.curW), " and tType ",
typeof(prob.tspan[1]), ". In-place: ", isinplace(prob))
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractDEProblem)
function Base.show(io::IO, A::AbstractDEProblem)

Check warning on line 107 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L107

Added line #L107 was not covered by tests
summary(io, A)
println(io)
print(io, "timespan: ")
Expand All @@ -112,14 +113,14 @@ function Base.show(io::IO, mime::MIME"text/plain", A::AbstractDEProblem)
print(io, "u0: ")
show(io, mime, A.u0)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractNoiseProblem)
function Base.show(io::IO, A::AbstractNoiseProblem)

Check warning on line 116 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L116

Added line #L116 was not covered by tests
summary(io, A)
println(io)
print(io, "timespan: ")
show(io, mime, A.tspan)
println(io)
end
function Base.show(io::IO, mime::MIME"text/plain", A::AbstractDAEProblem)
function Base.show(io::IO, A::AbstractDAEProblem)

Check warning on line 123 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L123

Added line #L123 was not covered by tests
summary(io, A)
println(io)
print(io, "timespan: ")
Expand Down Expand Up @@ -169,7 +170,7 @@ function Base.iterate(::NullParameters)
throw(NullParameterIndexError())
end

function Base.show(io::IO, mime::MIME"text/plain", A::AbstractPDEProblem)
function Base.show(io::IO, A::AbstractPDEProblem)

Check warning on line 173 in src/problems/problem_utils.jl

View check run for this annotation

Codecov / codecov/patch

src/problems/problem_utils.jl#L173

Added line #L173 was not covered by tests
summary(io, A.prob)
println(io)
end
Expand Down
5 changes: 3 additions & 2 deletions src/solutions/solution_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ function Base.summary(io::IO, A::AbstractTimeseriesSolution)
type_color, eltype(A.t), no_color)
end

function Base.show(io::IO, m::MIME"text/plain", A::AbstractTimeseriesSolution)
Base.show(io::IO, mime::MIME"text/plain", A::AbstractSciMLSolution) = show(io, A)
function Base.show(io::IO, A::AbstractTimeseriesSolution)

Check warning on line 204 in src/solutions/solution_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/solutions/solution_interface.jl#L203-L204

Added lines #L203 - L204 were not covered by tests
println(io, string("retcode: ", A.retcode))
println(io, string("Interpolation: "), interp_summary(A.interp))
print(io, "t: ")
Expand All @@ -218,7 +219,7 @@ function Base.iterate(sol::AbstractTimeseriesSolution, state = 0)
return (solution_new_tslocation(sol, state), state)
end

function Base.show(io::IO, m::MIME"text/plain", A::AbstractPDESolution)
function Base.show(io::IO, A::AbstractPDESolution)

Check warning on line 222 in src/solutions/solution_interface.jl

View check run for this annotation

Codecov / codecov/patch

src/solutions/solution_interface.jl#L222

Added line #L222 was not covered by tests
println(io, string("retcode: ", A.retcode))
print(io, "t: ")
show(io, m, A.t)
Expand Down

0 comments on commit 73f86a3

Please sign in to comment.