Skip to content

Commit 9a98329

Browse files
authored
Use find_zero instead of fzero as the latter is type unstable (#17)
* Use find_zero instead of fzero as the latter is type unstable * It doesn't seem to be documented, but the fzero method we call is type unstable. * Disabled JET in test because we used internals of JET and they changed. But we need to filter out spurious fails. So maybe fix later. Closes #16 * Fixes for newer versions of Aqua
1 parent 8a0933b commit 9a98329

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

Project.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
88
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
99

1010
[compat]
11+
Aqua = ">= 0.8"
1112
Roots = "0.8, 1, 2"
1213
SpecialFunctions = "0.8, 0.9, 0.10, 1, 2"
14+
Test = ">= 0.0"
1315
julia = "1"
1416

1517
[extras]
1618
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
17-
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
1819
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1920

2021
[targets]
21-
test = ["Aqua", "JET", "Test"]
22+
test = ["Aqua", "Test"]

src/FunctionZeros.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ for `n` = `1,2,...`.
4949
5050
`order` is passed to the function `Roots.fzero`.
5151
"""
52-
besselj_zero(nu, n; order=2) = Roots.fzero((x) -> SpecialFunctions.besselj(nu, x),
52+
besselj_zero(nu, n; order=2) = Roots.find_zero((x) -> SpecialFunctions.besselj(nu, x),
5353
bessel_zero_asymptotic(nu, n, 1); order=order)
5454

5555
"""
@@ -60,7 +60,7 @@ for `n` = `1,2,...`.
6060
6161
`order` is passed to the function `Roots.fzero`.
6262
"""
63-
bessely_zero(nu, n; order=2) = Roots.fzero((x) -> SpecialFunctions.bessely(nu, x),
63+
bessely_zero(nu, n; order=2) = Roots.find_zero((x) -> SpecialFunctions.bessely(nu, x),
6464
bessel_zero_asymptotic(nu, n, 2); order=order)
6565

6666
end # module FunctionZeros

test/aqua_test.jl

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ const PkgName = FunctionZeros
77
Aqua.test_deps_compat(PkgName)
88
end
99

10-
# This often gives false positive
11-
@testset "aqua project toml formatting" begin
12-
Aqua.test_project_toml_formatting(PkgName)
13-
end
14-
1510
@testset "aqua unbound_args" begin
1611
Aqua.test_unbound_args(PkgName)
1712
end
@@ -21,12 +16,12 @@ end
2116
end
2217

2318
# Depending on Optim causes many ambiguity errors outside our control
24-
# @testset "aqua test ambiguities" begin
25-
# Aqua.test_ambiguities([PkgName, Core, Base])
26-
# end
19+
@testset "aqua test ambiguities" begin
20+
Aqua.test_ambiguities([PkgName, Core, Base])
21+
end
2722

2823
@testset "aqua piracy" begin
29-
Aqua.test_piracy(PkgName)
24+
Aqua.test_piracies(PkgName)
3025
end
3126

3227
@testset "aqua project extras" begin

test/runtests.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
using FunctionZeros
22
using Test
33

4-
if VERSION >= v"1.7"
5-
include("jet_test.jl")
6-
end
4+
# I actually have fixed this in other packages.
5+
# Could do the same here
6+
# JET internals changed, and we use them.
7+
# if VERSION >= v"1.7"
8+
# include("jet_test.jl")
9+
# end
710

811
include("aqua_test.jl")
912

0 commit comments

Comments
 (0)