Skip to content

Commit

Permalink
Provide a fix for #6
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydriscoll committed Jun 11, 2024
1 parent 684fae8 commit 9e7444d
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/RationalFunctionApproximation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,22 @@ include("operations.jl")
# These are overloaded by plotting extensions.
export convergenceplot, errorplot

function convergenceplot()
@error "Load the Makie or Plots package to make a convergence plot"
function convergenceplot(args...; kwargs...)
ext = Base.get_extension(@__MODULE__, :Extension)
if ext === nothing
error("Load the Makie or Plots package first.")
else
return ext.convergenceplot(args...; kwargs...)
end
end

function errorplot()
@error "Load the Makie or Plots package to make an error plot"
function errorplot(args...; kwargs...)
ext = Base.get_extension(@__MODULE__, :Extension)
if ext === nothing
error("Load the Makie or Plots package first.")
else
return ext.errorplot(args...; kwargs...)
end
end

end
end # module

0 comments on commit 9e7444d

Please sign in to comment.