# ChebyshevApprox.jl type error

**URL:** <https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022>\
**Category:** General Usage\
**Tags:** package\
**Created:** [October 7, 2024, 7:17pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022 "2024-10-07T19:17:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![RuanCoelho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ruancoelho/32/210977_2.png) [@RuanCoelho](https://discourse.julialang.org/u/RuanCoelho)\
**Post date:** [October 7, 2024, 7:17pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/1 "2024-10-07T19:17:55Z")

</div>

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.

```julia
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.

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/224680_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [October 7, 2024, 7:43pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/2 "2024-10-07T19:43:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![RuanCoelho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ruancoelho/32/210977_2.png) [@RuanCoelho](https://discourse.julialang.org/u/RuanCoelho)\
**Post date:** [October 7, 2024, 8:48pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/3 "2024-10-07T20:48:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RJDennis](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@RJDennis](https://discourse.julialang.org/u/RJDennis)\
**Post date:** [October 7, 2024, 10:25pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/4 "2024-10-07T22:25:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![RJDennis](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@RJDennis](https://discourse.julialang.org/u/RJDennis)\
**Post date:** [October 8, 2024, 2:37pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/5 "2024-10-08T14:37:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/224680_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [October 8, 2024, 3:58pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/6 "2024-10-08T15:58:06Z")

</div>

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](https://github.com/thchr/TestReadme.jl)

---

<div class="post-metadata">

**Author:** ![RuanCoelho](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ruancoelho/32/210977_2.png) [@RuanCoelho](https://discourse.julialang.org/u/RuanCoelho)\
**Post date:** [October 8, 2024, 8:02pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/7 "2024-10-08T20:02:18Z")

</div>

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 .

---

<div class="post-metadata">

**Author:** ![RJDennis](https://avatars.discourse-cdn.com/v4/letter/r/90db22/32.png) [@RJDennis](https://discourse.julialang.org/u/RJDennis)\
**Post date:** [October 8, 2024, 9:30pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022/8 "2024-10-08T21:30:57Z")

</div>

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.
