Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompilation of plotting extension fails #6

Closed
jagot opened this issue May 7, 2024 · 1 comment
Closed

Precompilation of plotting extension fails #6

jagot opened this issue May 7, 2024 · 1 comment

Comments

@jagot
Copy link

jagot commented May 7, 2024

Thank you for this beautiful package!

When loading RationalFunctionApproximation.jl after having loaded GLMakie, the RFAMakiExt extension kicks in. However, it fails to precompile with the following message:

WARNING: Method definition errorplot(RationalFunctionApproximation.Approximation{T, S} where S where T) in module RationalFunctionApproximation at /Users/jagot/.julia/packages/RationalFunctionApproximation/9jY5B/src/RationalFunctionApproximation.jl:31 overwritten in module RFAMakieExt at /Users/jagot/.julia/packages/RationalFunctionApproximation/9jY5B/ext/RFAMakieExt.jl:34.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.

i.e.

function errorplot(r::Approximation; args...)
@error "Load the Makie package to make an error plot"
end

is overwritten by

"""
errorplot(r; use_abs=false)
Plot the pointwise error of an `Approximation` on (the boundary of) its domain. If the error is not real, then the real and imaginary parts are plotted separately, unless `use_abs=true`.
"""
function RFA.errorplot(r::RFA.Approximation; use_abs=false)
fig = Figure( )
ax = Axis(
fig[1,1], xlabel="boundary parameter", ylabel="error"
)
p = r.domain isa RFA.ComplexSCRegion ? r.domain.boundary : r.domain
t, τ = RFA.refine(p, r.prenodes, max(30, ceil(Int,600/degree(r))))
idx = sortperm(t)
t = t[idx]; τ = τ[idx];
err = @. r.original(τ) - r.fun.(τ)
if use_abs
lines!(ax, t, abs.(err))
ax.ylabel = "| error |"
elseif isreal(err)
lines!(ax, t, err)
else
lines!(ax, t, real.(err))
lines!(ax, t, imag.(err))
ax.ylabel = "Re, Im error"
end
return fig
end

Maybe it is better to replace the function stub by an empty function?

function errorplot end

and similarly for convergenceplot?

@zinkkkk
Copy link

zinkkkk commented May 9, 2024

I don't have much to add other than having the same issues when trying to follow most of the examples walkthrough page

tobydriscoll added a commit that referenced this issue Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants