|
4 | 4 | # in the LICENSE.md file or at https://opensource.org/licenses/MIT.
|
5 | 5 |
|
6 | 6 | module ModelAnalyzer
|
| 7 | + |
| 8 | +abstract type AbstractIssue end |
| 9 | + |
| 10 | +abstract type AbstractData end |
| 11 | + |
| 12 | +abstract type AbstractAnalyzer end |
| 13 | + |
| 14 | +function summarize(io::IO, ::Type{T}; verbose = true) where {T<:AbstractIssue} |
| 15 | + if verbose |
| 16 | + return _verbose_summarize(io, T) |
| 17 | + else |
| 18 | + return _summarize(io, T) |
| 19 | + end |
| 20 | +end |
| 21 | + |
| 22 | +function summarize(io::IO, issue::AbstractIssue; verbose = true) |
| 23 | + if verbose |
| 24 | + return _verbose_summarize(io, issue) |
| 25 | + else |
| 26 | + return _summarize(io, issue) |
| 27 | + end |
| 28 | +end |
| 29 | + |
| 30 | +function summarize( |
| 31 | + io::IO, |
| 32 | + issues::Vector{T}; |
| 33 | + verbose = true, |
| 34 | + max_issues = typemax(Int), |
| 35 | +) where {T<:AbstractIssue} |
| 36 | + summarize(io, T, verbose = verbose) |
| 37 | + print(io, "\n## Number of issues\n\n") |
| 38 | + print(io, "Found ", length(issues), " issues") |
| 39 | + print(io, "\n\n## List of issues\n\n") |
| 40 | + for issue in first(issues, max_issues) |
| 41 | + print(io, " * ") |
| 42 | + summarize(io, issue, verbose = verbose) |
| 43 | + print(io, "\n") |
| 44 | + end |
| 45 | + return |
| 46 | +end |
| 47 | + |
| 48 | +function summarize(data::AbstractData; kwargs...) |
| 49 | + return summarize(stdout, data; kwargs...) |
| 50 | +end |
| 51 | + |
| 52 | +function analyze end |
| 53 | +function list_of_issues end |
| 54 | +function list_of_issue_types end |
| 55 | + |
| 56 | +function _verbose_summarize end |
| 57 | +function _summarize end |
| 58 | + |
| 59 | +include("numerical.jl") |
| 60 | +include("feasibility.jl") |
| 61 | +include("infeasibility.jl") |
| 62 | + |
7 | 63 | end
|
0 commit comments