Skip to content

Commit 2f11b0e

Browse files
authored
Updates for Julia 1.0+ (#22)
This drops support for Julia versions prior to 1.0, allowing us to simplify version checking logic and drop the dependency on Compat. This also updates the documentation setup.
1 parent e95d5ce commit 2f11b0e

File tree

10 files changed

+44
-54
lines changed

10 files changed

+44
-54
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ deps/usr
77
deps/src
88
docs/build
99
docs/site
10+
Manifest.toml

.travis.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ language: julia
33
os:
44
- linux
55
julia:
6-
- 0.6
6+
- 1.0
7+
- 1.1
78
- nightly
89
notifications:
910
email: false
@@ -12,5 +13,13 @@ notifications:
1213
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
1314
# - julia -e 'Pkg.clone(pwd()); Pkg.build("AbstractFFTs"); Pkg.test("AbstractFFTs"; coverage=true)'
1415
after_success:
15-
- julia -e 'VERSION >= v"0.7-" && (Pkg.add("Coverage"); cd(Pkg.dir("AbstractFFTs")); using Coverage; Coveralls.submit(Coveralls.process_folder()))'
16-
- julia -e 'VERSION >= v"0.7-" && (Pkg.add("Documenter"); cd(Pkg.dir("AbstractFFTs")); include(joinpath("docs", "make.jl")))'
16+
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())';
17+
jobs:
18+
include:
19+
- stage: "Documentation"
20+
julia: 1.0
21+
os: linux
22+
script:
23+
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
24+
- julia --project=docs/ docs/make.jl
25+
after_success: skip

Project.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name = "AbstractFFTs"
2+
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
3+
4+
[deps]
5+
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
6+
7+
[compat]
8+
julia = "^1.0"
9+
10+
[extras]
11+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
12+
13+
[targets]
14+
test = ["Test"]

REQUIRE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
julia 0.6 0.7.0-DEV.602 0.7.0-DEV.3449
2-
Compat 0.59.0
1+
julia 1.0

docs/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
4+
[compat]
5+
Documenter = "~0.21"

docs/make.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ using Documenter, AbstractFFTs
22

33
makedocs(
44
modules = [AbstractFFTs],
5-
clean = false,
6-
format = :html,
75
sitename = "AbstractFFTs.jl",
86
pages = Any[
97
"Home" => "index.md",
@@ -13,9 +11,6 @@ makedocs(
1311
)
1412

1513
deploydocs(
16-
julia = "nightly",
1714
repo = "github.com/JuliaMath/AbstractFFTs.jl.git",
1815
target = "build",
19-
deps = nothing,
20-
make = nothing,
2116
)

docs/src/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
```@meta
2+
DocTestSetup = :(using AbstractFFTs)
3+
CurrentModule = AbstractFFTs
4+
```
5+
16
# AbstractFFTs.jl
27

38
This package provides a generic framework for defining

src/AbstractFFTs.jl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,10 @@
1-
VERSION < v"0.7.0-beta2.199" && __precompile__()
2-
31
module AbstractFFTs
42

5-
using Compat
6-
7-
# After this version, the bindings can overwrite deprecated bindings in Base safely, but
8-
# prior to it we want to extend/reexport the Base definitions
9-
if VERSION < v"0.7.0-DEV.602"
10-
import Base: fft, ifft, bfft, fft!, ifft!, bfft!,
11-
plan_fft, plan_ifft, plan_bfft, plan_fft!, plan_ifft!, plan_bfft!,
12-
rfft, irfft, brfft, plan_rfft, plan_irfft, plan_brfft,
13-
fftshift, ifftshift
14-
import Base.DFT: Plan, ScaledPlan, plan_inv, pinv_type, normalization,
15-
rfft_output_size, brfft_output_size, realfloat, complexfloat
16-
end
17-
# Reexport the Base bindings unchanged for versions before FFTW was removed, or export the
18-
# new definitions after overwritable deprecation bindings were introduced
193
export fft, ifft, bfft, fft!, ifft!, bfft!,
204
plan_fft, plan_ifft, plan_bfft, plan_fft!, plan_ifft!, plan_bfft!,
215
rfft, irfft, brfft, plan_rfft, plan_irfft, plan_brfft,
226
fftshift, ifftshift
237

24-
# Only define things if we aren't using the existing Base bindings
25-
VERSION >= v"0.7.0-DEV.602" && include("definitions.jl")
8+
include("definitions.jl")
269

2710
end # module

src/definitions.jl

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,7 @@ size(p::ScaledPlan) = size(p.p)
246246
show(io::IO, p::ScaledPlan) = print(io, p.scale, " * ", p.p)
247247
summary(p::ScaledPlan) = string(p.scale, " * ", summary(p.p))
248248

249-
if VERSION >= v"0.7.0-DEV.3665"
250-
*(p::ScaledPlan, x::AbstractArray) = LinearAlgebra.rmul!(p.p * x, p.scale)
251-
elseif VERSION >= v"0.7.0-DEV.3563"
252-
*(p::ScaledPlan, x::AbstractArray) = LinearAlgebra.mul1!(p.p * x, p.scale)
253-
else
254-
*(p::ScaledPlan, x::AbstractArray) = scale!(p.p * x, p.scale)
255-
end
249+
*(p::ScaledPlan, x::AbstractArray) = LinearAlgebra.rmul!(p.p * x, p.scale)
256250

257251
*::Number, p::Plan) = ScaledPlan(p, α)
258252
*(p::Plan, α::Number) = ScaledPlan(p, α)
@@ -272,16 +266,8 @@ plan_ifft!(x::AbstractArray, region; kws...) =
272266

273267
plan_inv(p::ScaledPlan) = ScaledPlan(plan_inv(p.p), inv(p.scale))
274268

275-
if VERSION >= v"0.7.0-DEV.3665"
276-
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
277-
LinearAlgebra.lmul!(p.scale, LinearAlgebra.mul!(y, p.p, x))
278-
elseif VERSION >= v"0.7.0-DEV.3563"
279-
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
280-
LinearAlgebra.mul2!(p.scale, LinearAlgebra.mul!(y, p.p, x))
281-
else
282-
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
283-
scale!(p.scale, LinearAlgebra.mul!(y, p.p, x))
284-
end
269+
LinearAlgebra.mul!(y::AbstractArray, p::ScaledPlan, x::AbstractArray) =
270+
LinearAlgebra.lmul!(p.scale, LinearAlgebra.mul!(y, p.p, x))
285271

286272
##############################################################################
287273
# Real-input DFTs are annoying because the output has a different size

test/runtests.jl

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22

33
using AbstractFFTs
44
using AbstractFFTs: Plan
5-
using Compat
6-
using Compat.LinearAlgebra
7-
using Compat.Test
8-
9-
if VERSION < v"0.7.0-DEV.3204"
10-
const mul! = Base.A_mul_B!
11-
else
12-
const mul! = LinearAlgebra.mul!
13-
end
5+
using LinearAlgebra
6+
using Test
147

158
mutable struct TestPlan{T} <: Plan{T}
169
region

0 commit comments

Comments
 (0)