ChebyshevApprox.jl type error

Hi there!

First time here, so I’ll try to be clear and go straight to the point. I’m trying to use the ChebyshevApprox.jl package, specifically the chebyshev_weights_extrema() function. However, even when using the example provided in the README file from this very same package, a type error keeps coming up.

ERROR: MethodError: no method matching chebyshev_weights_extrema(::Vector{Float64}, ::Tuple{Vector{Float64}, Vector{Float64}}, ::Vector{Int64}, ::Matrix{Float64})

Closest candidates are:
  chebyshev_weights_extrema(::Array{T, N}, ::Tuple{Vararg{Vector{T}, N}}, ::Union{Tuple{Vararg{S, N}}, Vector{S}}, ::Any) where {T<:AbstractFloat, N, S<:Integer}
   @ ChebyshevApprox C:\Users\Ruan\.julia\packages\ChebyshevApprox\rqVxH\src\chebyshev_approx_functions.jl:621
  chebyshev_weights_extrema(::Array{T, N}, ::Array{Vector{T}, 1}, ::Union{Tuple{Vararg{S, N}}, Vector{S}}, ::Any) where {T<:AbstractFloat, N, S<:Integer}
   @ ChebyshevApprox C:\Users\Ruan\.julia\packages\ChebyshevApprox\rqVxH\src\chebyshev_approx_functions.jl:1819
  chebyshev_weights_extrema(::Vector{T}, ::Vector{T}, ::Union{Vector{S}, S}, ::Any) where {T<:AbstractFloat, S<:Integer}
   @ ChebyshevApprox C:\Users\Ruan\.julia\packages\ChebyshevApprox\rqVxH\src\chebyshev_approx_functions.jl:1808

The second entry is taken directly from the example, where nodes_x1 = chebyshev_extrema(11) and nodes_x2 = chebyshev_extrema(15), therefore the entry to chebyshev_weights_extrema() function being nodes = (nodes_x1,nodes_x2). I’ve tried also nodes = [nodes_x1,nodes_x2] as it seemingly indicate it’s possible at chebyshev_approx_functions.jl:1819.

Hope this is a relevant question, I couldn’t find any answers elsewhere.

1 Like

Welcome! @RJDennis is on this forum, maybe they can weigh in.
When the examples on a README page are not run as part of CI, they can become out of date compared to the actual package code. You may want to look at what is done in the test folder?

1 Like

Thanks, @gdalle! It really seems that the test folder had the answer. When using the nodes function, you should put the domain as a second entry. I’ve tried running the example with this modification and it went out smoothly. Although this didn’t workout (yet) out of the example code, I’ll try some more and update this topic.

2 Likes

Can you please raise an issue on the package site and provide the exact code you ran to generate the error. Thanks.

2 Likes

I have updated the code snippets in the readme file and I think the problem there has now been fixed. Thanks.

If you want to prevent if from happening again, you might be interested in GitHub - thchr/TestReadme.jl: Test the code-contents of a README file for a Julia project automatically

2 Likes

Thanks @RJDennis ! Should I still raise the on the package site? I’ll also take a look at that link, thank you so much @gdalle .

If the changes I made to the readme fix the problem for you, then there is no need to. If you are still having a problem, then, yes, raise an issue.