From d20d707962c573bc47ee2e108c9837ebedee5858 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 18 Apr 2019 10:02:22 +0200 Subject: [PATCH 1/3] Drop 0.7 for CI. --- .travis.yml | 8 ++------ appveyor.yml | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c706de5..58d84db3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,8 @@ os: - linux - osx julia: - - 0.7 - 1.0 + - 1.1 - nightly notifications: email: false @@ -17,12 +17,8 @@ branches: # allow_failures: # - julia: nightly # - os: osx -# uncomment the following lines to override the default test script -#script: -# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi -# - julia -e 'Pkg.clone(pwd()); Pkg.build("StaticArrays"); Pkg.test("StaticArrays"; coverage=true)' after_success: - - if [ $TRAVIS_JULIA_VERSION = "0.7" ] && [ $TRAVIS_OS_NAME = "linux" ]; then + - if [ $TRAVIS_JULIA_VERSION = "1.1" ] && [ $TRAVIS_OS_NAME = "linux" ]; then julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder()); Codecov.submit(Codecov.process_folder())'; fi - julia -e 'using Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps)' diff --git a/appveyor.yml b/appveyor.yml index c3acffe7..0ea4f043 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ environment: matrix: - - julia_version: 0.7 - julia_version: 1.0 + - julia_version: 1.1 - julia_version: latest platform: From 972246e1856cdf88aeb2b51a616944c08f54a9c9 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 18 Apr 2019 10:02:50 +0200 Subject: [PATCH 2/3] Remove rest of deprecations. --- src/MArray.jl | 4 +--- src/SArray.jl | 4 +--- src/SizedArray.jl | 4 +--- src/matrix_multiply.jl | 34 ++++++++++------------------------ test/MArray.jl | 14 +++++--------- test/SArray.jl | 4 +--- test/SizedArray.jl | 26 ++++++++++++-------------- test/linalg.jl | 40 +++++++++++++++------------------------- test/mapreduce.jl | 4 +--- test/triangular.jl | 14 ++++---------- 10 files changed, 51 insertions(+), 97 deletions(-) diff --git a/src/MArray.jl b/src/MArray.jl index b3712f24..610efe49 100644 --- a/src/MArray.jl +++ b/src/MArray.jl @@ -114,9 +114,7 @@ end @inline Tuple(v::MArray) = v.data -if isdefined(Base, :dataids) # v0.7- - Base.dataids(ma::MArray) = (UInt(pointer(ma)),) -end +Base.dataids(ma::MArray) = (UInt(pointer(ma)),) @inline function Base.unsafe_convert(::Type{Ptr{T}}, a::MArray{S,T}) where {S,T} Base.unsafe_convert(Ptr{T}, pointer_from_objref(a)) diff --git a/src/SArray.jl b/src/SArray.jl index a4e1e75a..767dad8b 100644 --- a/src/SArray.jl +++ b/src/SArray.jl @@ -72,9 +72,7 @@ end @inline Tuple(v::SArray) = v.data -if isdefined(Base, :dataids) # v0.7- - Base.dataids(::SArray) = () -end +Base.dataids(::SArray) = () # See #53 Base.cconvert(::Type{Ptr{T}}, a::SArray) where {T} = Base.RefValue(a) diff --git a/src/SizedArray.jl b/src/SizedArray.jl index 61a5cd5c..1805f4d5 100644 --- a/src/SizedArray.jl +++ b/src/SizedArray.jl @@ -72,9 +72,7 @@ SizedMatrix{S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M} @inline SizedMatrix{S1,S2}(a::Array{T,M}) where {S1,S2,T,M} = SizedArray{Tuple{S1,S2},T,2,M}(a) @inline SizedMatrix{S1,S2}(x::NTuple{L,T}) where {S1,S2,T,L} = SizedArray{Tuple{S1,S2},T,2,2}(x) -if isdefined(Base, :dataids) # v0.7- - Base.dataids(sa::SizedArray) = Base.dataids(sa.data) -end +Base.dataids(sa::SizedArray) = Base.dataids(sa.data) """ Size(dims)(array) diff --git a/src/matrix_multiply.jl b/src/matrix_multiply.jl index 4440c16b..15996b05 100644 --- a/src/matrix_multiply.jl +++ b/src/matrix_multiply.jl @@ -303,30 +303,16 @@ end gemm = :cgemm_ end - if VERSION < v"0.7-" - blascall = quote - ccall((Base.BLAS.@blasfunc($gemm), Base.BLAS.libblas), Nothing, - (Ref{UInt8}, Ref{UInt8}, Ref{Base.BLAS.BlasInt}, Ref{Base.BLAS.BlasInt}, - Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{Base.BLAS.BlasInt}, - Ptr{$T}, Ref{Base.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, - Ref{Base.BLAS.BlasInt}), - transA, transB, m, n, - ka, alpha, a, strideA, - b, strideB, beta, c, - strideC) - end - else - blascall = quote - ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing, - (Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt}, - Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, - Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, - Ref{LinearAlgebra.BLAS.BlasInt}), - transA, transB, m, n, - ka, alpha, a, strideA, - b, strideB, beta, c, - strideC) - end + blascall = quote + ccall((LinearAlgebra.BLAS.@blasfunc($gemm), LinearAlgebra.BLAS.libblas), Nothing, + (Ref{UInt8}, Ref{UInt8}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{LinearAlgebra.BLAS.BlasInt}, + Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, + Ptr{$T}, Ref{LinearAlgebra.BLAS.BlasInt}, Ref{$T}, Ptr{$T}, + Ref{LinearAlgebra.BLAS.BlasInt}), + transA, transB, m, n, + ka, alpha, a, strideA, + b, strideB, beta, c, + strideC) end return quote diff --git a/test/MArray.jl b/test/MArray.jl index ed65eb64..84e7642b 100644 --- a/test/MArray.jl +++ b/test/MArray.jl @@ -116,15 +116,11 @@ @test length(m) === 4 - if isdefined(Base, :mightalias) # v0.7- - @test Base.mightalias(m, m) - @test !Base.mightalias(m, copy(m)) - @test Base.mightalias(m, view(m, :, 1)) - end - - if isdefined(Base, :dataids) # v0.7- - @test Base.dataids(m) == (UInt(pointer(m)),) - end + @test Base.mightalias(m, m) + @test !Base.mightalias(m, copy(m)) + @test Base.mightalias(m, view(m, :, 1)) + + @test Base.dataids(m) == (UInt(pointer(m)),) end @testset "setindex!" begin diff --git a/test/SArray.jl b/test/SArray.jl index 76859992..1b7572e7 100644 --- a/test/SArray.jl +++ b/test/SArray.jl @@ -113,9 +113,7 @@ @test_throws Exception m[1] = 1 - if isdefined(Base, :dataids) # v0.7- - @test Base.dataids(m) === () - end + @test Base.dataids(m) === () end @testset "promotion" begin diff --git a/test/SizedArray.jl b/test/SizedArray.jl index 0d96b9db..eaa39f6a 100644 --- a/test/SizedArray.jl +++ b/test/SizedArray.jl @@ -60,20 +60,18 @@ sa[1] = 2 @test sa.data == [2, 4] - if isdefined(Base, :mightalias) # v0.7- - @testset "aliasing" begin - a1 = rand(4) - a2 = copy(a1) - sa1 = SizedVector{4}(a1) - sa2 = SizedVector{4}(a2) - @test Base.mightalias(a1, sa1) - @test Base.mightalias(sa1, SizedVector{4}(a1)) - @test !Base.mightalias(a2, sa1) - @test !Base.mightalias(sa1, SizedVector{4}(a2)) - @test Base.mightalias(sa1, view(sa1, 1:2)) - @test Base.mightalias(a1, view(sa1, 1:2)) - @test Base.mightalias(sa1, view(a1, 1:2)) - end + @testset "aliasing" begin + a1 = rand(4) + a2 = copy(a1) + sa1 = SizedVector{4}(a1) + sa2 = SizedVector{4}(a2) + @test Base.mightalias(a1, sa1) + @test Base.mightalias(sa1, SizedVector{4}(a1)) + @test !Base.mightalias(a2, sa1) + @test !Base.mightalias(sa1, SizedVector{4}(a2)) + @test Base.mightalias(sa1, view(sa1, 1:2)) + @test Base.mightalias(a1, view(sa1, 1:2)) + @test Base.mightalias(sa1, view(a1, 1:2)) end @testset "back to Array" begin diff --git a/test/linalg.jl b/test/linalg.jl index dd16d175..d242477b 100644 --- a/test/linalg.jl +++ b/test/linalg.jl @@ -168,31 +168,21 @@ using StaticArrays, Test, LinearAlgebra # issue #388 let x = SVector(1, 2, 3) - if VERSION >= v"0.7.0-beta.47" - # current limit: 34 arguments - hcat( - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) - allocs = @allocated hcat( - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) - @test allocs == 0 - vcat( - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) - allocs = @allocated vcat( - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, - x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) - @test allocs == 0 - else - # current limit: 14 arguments - hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x) - allocs = @allocated hcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x) - @test allocs == 0 - vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x) - allocs = @allocated vcat(x, x, x, x, x, x, x, x, x, x, x, x, x, x) - @test allocs == 0 - end + # current limit: 34 arguments + hcat( + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) + allocs = @allocated hcat( + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) + @test allocs == 0 + vcat( + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) + allocs = @allocated vcat( + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, + x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x) + @test allocs == 0 end # issue #561 diff --git a/test/mapreduce.jl b/test/mapreduce.jl index 9677bef2..cefde549 100644 --- a/test/mapreduce.jl +++ b/test/mapreduce.jl @@ -1,7 +1,5 @@ using StaticArrays, Test -if VERSION >= v"0.7.0-beta.85" - import Statistics: mean -end +using Statistics: mean @testset "Map, reduce, mapreduce, broadcast" begin @testset "map and map!" begin diff --git a/test/triangular.jl b/test/triangular.jl index 2992161b..ffd2115b 100644 --- a/test/triangular.jl +++ b/test/triangular.jl @@ -64,15 +64,9 @@ end @test (transpose(SA)*SB)::SMatrix{n,n} ≈ transpose(A)*transpose(B) @test (transpose(SA)*transpose(SB))::SVector{n} ≈ transpose(A)*B @test (transpose(SA)*SB')::SVector{n} ≈ transpose(A)*conj(B) - if VERSION < v"0.7-" - @test (SB*SA)::RowVector{<:Any,<:SVector{n}} ≈ transpose(B)*A - @test (SB*SA')::RowVector{<:Any,<:SVector{n}} ≈ transpose(B)*A' - @test (SB*transpose(SA))::RowVector{<:Any,<:SVector{n}} ≈ transpose(B)*transpose(A) - else - @test (SB*SA)::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*A - @test (SB*SA')::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*A' - @test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*transpose(A) - end + @test (SB*SA)::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*A + @test (SB*SA')::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*A' + @test (SB*transpose(SA))::Transpose{<:Any,<:SVector{n}} ≈ transpose(B)*transpose(A) @test (transpose(SB)*SA)::SMatrix{n,n} ≈ B*A @test (SB'*SA)::SMatrix{n,n} ≈ conj(B)*A @test (transpose(SB)*transpose(SA))::SMatrix{n,n} ≈ B*transpose(A) @@ -88,7 +82,7 @@ end eltyB in (Float64, ComplexF64, Int), (ta, uploa) in ((UpperTriangular, :U), (LowerTriangular, :L)), (tb, uplob) in ((UpperTriangular, :U), (LowerTriangular, :L)) - + A = ta(eltyA == Int ? rand(1:7, n, n) : rand(eltyA, n, n)) B = tb(eltyB == Int ? rand(1:7, n, n) : rand(eltyB, n, n)) From 2f541ed86b68bc851dcf0dde91ea0948f663b3fa Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Thu, 18 Apr 2019 10:08:55 +0200 Subject: [PATCH 3/3] Replace REQUIRE with Project.toml. --- .gitignore | 1 + Project.toml | 16 ++++++++++++++++ REQUIRE | 1 - test/REQUIRE | 1 - 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 Project.toml delete mode 100644 REQUIRE delete mode 100644 test/REQUIRE diff --git a/.gitignore b/.gitignore index 8c960ec8..97e6a6fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ *.jl.cov *.jl.*.cov *.jl.mem +/Manifest.toml diff --git a/Project.toml b/Project.toml new file mode 100644 index 00000000..a5bbeb19 --- /dev/null +++ b/Project.toml @@ -0,0 +1,16 @@ +name = "StaticArrays" +uuid = "90137ffa-7385-5640-81b9-e52037218182" +version = "0.10.3" + +[deps] +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" + +[extras] +InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["InteractiveUtils", "SpecialFunctions", "Test"] diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index e6a2c237..00000000 --- a/REQUIRE +++ /dev/null @@ -1 +0,0 @@ -julia 0.7-rc2 diff --git a/test/REQUIRE b/test/REQUIRE deleted file mode 100644 index b2a39ac3..00000000 --- a/test/REQUIRE +++ /dev/null @@ -1 +0,0 @@ -SpecialFunctions