Skip to content

Commit 66cfb9c

Browse files
authored
Move DualNumbers to an extension (#565)
1 parent cf27073 commit 66cfb9c

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

Project.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.9.10"
3+
version = "0.9.11"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
@@ -11,7 +11,6 @@ Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
1111
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
1212
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
1313
DomainSets = "5b8099bc-c8ec-5219-889f-1d9e522a28bf"
14-
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
1514
FFTW = "7a1cc6ca-52ef-59f5-83cd-3a7055c09341"
1615
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
1716
InfiniteArrays = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
@@ -20,14 +19,15 @@ LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
2019
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2120
LowRankMatrices = "e65ccdef-c354-471a-8090-89bec1c20ec3"
2221
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
23-
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2422
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2523
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2624

2725
[weakdeps]
26+
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
2827
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
2928

3029
[extensions]
30+
ApproxFunBaseDualNumbersExt = "DualNumbers"
3131
ApproxFunBaseSpecialFunctionsExt = "SpecialFunctions"
3232

3333
[compat]
@@ -54,10 +54,11 @@ julia = "1.9"
5454

5555
[extras]
5656
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
57+
DualNumbers = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
5758
Infinities = "e1ba4f0e-776d-440f-acd9-e1d2e9742647"
5859
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
5960
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
6061
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6162

6263
[targets]
63-
test = ["Aqua", "Random", "Infinities", "Test", "SpecialFunctions"]
64+
test = ["Aqua", "Random", "Infinities", "Test", "SpecialFunctions", "DualNumbers"]

ext/ApproxFunBaseDualNumbersExt.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module ApproxFunBaseDualNumbersExt
2+
3+
using ApproxFunBase
4+
using DualNumbers
5+
import ApproxFunBase: eps
6+
7+
eps(::Type{Dual{Complex{T}}}) where {T<:Real} = eps(real(T))
8+
eps(z::Dual{Complex{T}}) where {T<:Real} = eps(abs(z))
9+
10+
end

src/ApproxFunBase.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ import Calculus
88
import Combinatorics: multiexponents
99
using DSP
1010
using DomainSets
11-
using DualNumbers
1211
using FFTW
1312
using FillArrays
1413
using InfiniteArrays
1514
using IntervalSets
1615
using LinearAlgebra
1716
using LowRankMatrices
1817
using SparseArrays
19-
# using SpecialFunctions
2018
using StaticArrays: SVector, @SArray, SArray
2119
import Statistics: mean
2220

src/LinearAlgebra/helper.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,6 @@ eps(::T) where T<:Integer = eps(T)
7676

7777
eps(::Type{Complex{T}}) where {T<:Real} = eps(real(T))
7878
eps(z::Complex{T}) where {T<:Real} = eps(abs(z))
79-
eps(::Type{Dual{Complex{T}}}) where {T<:Real} = eps(real(T))
80-
eps(z::Dual{Complex{T}}) where {T<:Real} = eps(abs(z))
81-
8279

8380
eps(::Type{Vector{T}}) where {T<:Number} = eps(T)
8481
eps(::Type{SVector{k,T}}) where {k,T<:Number} = eps(T)

src/specialfunctions.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ for OP in (:(Base.max),:(Base.min))
418418
end
419419
end
420420

421-
# from DualNumbers
422421
for (funsym, exp) in Calculus.symbolic_derivatives_1arg()
423422
funsym == :abs && continue
424423
funsym == :sign && continue

test/runtests.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ using SpecialFunctions
1515
using Test
1616

1717
@testset "Project quality" begin
18-
Aqua.test_all(ApproxFunBase, ambiguities=false, piracy = false,
19-
# only test formatting on VERSION >= v1.7
20-
# https://github.com/JuliaTesting/Aqua.jl/issues/105#issuecomment-1551405866
21-
project_toml_formatting = VERSION >= v"1.9")
18+
Aqua.test_all(ApproxFunBase, ambiguities=false, piracy = false)
2219
end
2320

2421
@testset "Helper" begin
@@ -775,6 +772,12 @@ end
775772
@time include("ETDRK4Test.jl")
776773
include("show.jl")
777774

775+
@testset "Dual" begin
776+
z = complex(1,1)
777+
@test ApproxFunBase.eps(Dual(z, zero(z))) == ApproxFunBase.eps(z)
778+
@test ApproxFunBase.eps(Dual{ComplexF64}) == ApproxFunBase.eps(ComplexF64)
779+
end
780+
778781
@testset "chebyshev_clenshaw" begin
779782
@test @inferred(chebyshev_clenshaw(Int[], 1)) == 0
780783
@test @inferred(chebyshev_clenshaw(Int[], Dual(0,1))) == Dual(0,0)

0 commit comments

Comments
 (0)