diff --git a/src/arithmetic.jl b/src/arithmetic.jl index a7621be..99d012f 100644 --- a/src/arithmetic.jl +++ b/src/arithmetic.jl @@ -57,7 +57,7 @@ end import Base: A_mul_B!, A_mul_Bc!, A_mul_Bc, A_mul_Bt!, A_mul_Bt, Ac_mul_B, Ac_mul_B!, Ac_mul_Bc, Ac_mul_Bc!, At_mul_B, At_mul_B!, At_mul_Bt, At_mul_Bt! -if VERSION >= v"0.5.0-dev" ## v0.4 ambiguity-hell with AbstractTriangular c.s. +if VERSION ≥ v"0.5.0" ## v0.4 ambiguity-hell with AbstractTriangular c.s. ## Assume dimensions/names are correct for op in (:A_mul_B!, :A_mul_Bc!, :A_mul_Bt!, :Ac_mul_B!, :Ac_mul_Bc!, :At_mul_B!, :At_mul_Bt!) @eval ($op)(C::NamedMatrix, A::AbstractMatrix, B::AbstractMatrix) = ($op)(C.array, A, B) @@ -125,10 +125,10 @@ end \{Tx<:Number,Ty<:Number}(x::Diagonal{Tx}, y::NamedVector{Ty}) = x \ y.array \{Tx<:Number,Ty<:Number}(x::Union{Bidiagonal{Tx},LinAlg.AbstractTriangular{Tx}}, y::NamedVector{Ty}) = x \ y.array \{Tx<:Number,Ty<:Number}(x::Union{Bidiagonal{Tx},LinAlg.AbstractTriangular{Tx}}, y::NamedMatrix{Ty}) = NamedArray(x \ y.array, (defaultnamesdict(size(x,1)), y.dicts[2]), (:A, y.dimnames[2])) -if VERSION >= v"0.4.0-dev" - \(x::Bidiagonal,y::NamedVector) = NamedArray(x \ y.array, ([string(i) for i in 1:size(x,2)], names(y,2)), (:A, y.dimnames[2])) - \(x::Bidiagonal,y::NamedMatrix) = NamedArray(x \ y.array, ([string(i) for i in 1:size(x,2)], names(y,2)), (:A, y.dimnames[2])) -end + +\(x::Bidiagonal,y::NamedVector) = NamedArray(x \ y.array, ([string(i) for i in 1:size(x,2)], names(y,2)), (:A, y.dimnames[2])) +\(x::Bidiagonal,y::NamedMatrix) = NamedArray(x \ y.array, ([string(i) for i in 1:size(x,2)], names(y,2)), (:A, y.dimnames[2])) + ## AbstractVectorOrMat gives us more ambiguities than separate entries... \(x::AbstractVector, y::NamedVector) = x \ y.array \(x::AbstractMatrix, y::NamedVector) = x \ y.array diff --git a/src/compat.jl b/src/compat.jl index 6269873..d557f56 100644 --- a/src/compat.jl +++ b/src/compat.jl @@ -3,6 +3,6 @@ if VERSION < v"0.5.0-dev+2023" displaysize(io::IO) = Base.tty_size() end -if VERSION < v"0.5.0-dev" +if !isdefined(Core, :String) String = ASCIIString end diff --git a/src/constructors.jl b/src/constructors.jl index d6ede98..bcdceff 100644 --- a/src/constructors.jl +++ b/src/constructors.jl @@ -19,10 +19,8 @@ defaultdimnames(ndim::Integer) = map(defaultdimname, tuple(1:ndim...)) defaultdimnames(a::AbstractArray) = defaultdimnames(ndims(a)) ## disambiguation (Argh...) -if VERSION ≥ v"0.4-dev" - NamedArray{T,N}(a::AbstractArray{T,N}, names::Tuple{}, dimnames::NTuple{N}) = NamedArray{T,N,typeof(a),Tuple{}}(a, (), ()) - NamedArray{T,N}(a::AbstractArray{T,N}, names::Tuple{}) = NamedArray{T,N,typeof(a),Tuple{}}(a, (), ()) -end +NamedArray{T,N}(a::AbstractArray{T,N}, names::Tuple{}, dimnames::NTuple{N}) = NamedArray{T,N,typeof(a),Tuple{}}(a, (), ()) +NamedArray{T,N}(a::AbstractArray{T,N}, names::Tuple{}) = NamedArray{T,N,typeof(a),Tuple{}}(a, (), ()) ## Basic constructor: array, tuple of dicts, tuple ## This calls the inner constructor with the appropriate types @@ -68,6 +66,6 @@ function NamedArray(T::DataType, dims::Int...) NamedArray(a, tuple(names...), tuple(dimnames...)) end -if VERSION >= v"0.5.0-dev" +if VERSION >= v"0.5.0-dev+2396" include("typedconstructor.jl") end diff --git a/src/convert.jl b/src/convert.jl index 40efb9e..14c9d17 100644 --- a/src/convert.jl +++ b/src/convert.jl @@ -20,17 +20,3 @@ array(n::NamedArray) = n.array ## to other type convert{T}(::Type{NamedArray{T}}, n::NamedArray) = NamedArray(convert(Array{T}, n.array), n.dicts, n.dimnames) - -#function promote_rule{T1<:Real,T2<:Real,N}(::Type{Array{T1,N}}, ::Type{NamedArray{T2,N}}) -# println("my rule") -# t = promote_type(T1,T2) -# Array{t,N} -#end - -## convenience functions -##if VERSION < v"0.4-dev" -## for tf in [:float16, :float32, :float64, :complex32, :complex64, :complex128] -## eval(Expr(:import, :Base, tf)) -## @eval ($tf)(a::NamedArray) = NamedArray(($tf)(a.array), a.dicts, a.dimnames) -## end -##end diff --git a/src/index.jl b/src/index.jl index da08bf5..bc9dde5 100644 --- a/src/index.jl +++ b/src/index.jl @@ -6,8 +6,8 @@ import Base: getindex -## ambiguity from abstractarray.jl -if VERSION < v"0.5-dev" +if VERSION < v"0.5" + ## ambiguity from abstractarray.jl getindex(n::NamedArray, i::Real) = namedgetindex(n, indices(n.dicts[1], i)) getindex(n::NamedArray, i::AbstractArray) = namedgetindex(n, indices(n.dicts[1], i)) end @@ -17,7 +17,7 @@ getindex(n::NamedArray, ::Colon) = n.array[:] ## special 0-dimensional case getindex{T}(n::NamedArray{T,0}, i::Real) = getindex(n.array, i) -if VERSION < v"0.5-dev" +if VERSION < v"0.5" getindex(n::NamedArray, i) = namedgetindex(n, indices(n.dicts[1], i)) getindex(n::NamedArray, i1, i2) = namedgetindex(n, indices(n.dicts[1], i1), indices(n.dicts[2], i2)) getindex(n::NamedArray, i1, i2, i3) = namedgetindex(n, indices(n.dicts[1], i1), indices(n.dicts[2], i2), indices(n.dicts[3], i3)) @@ -63,7 +63,7 @@ indices(dict::Associative, i::Not) = setdiff(1:length(dict), indices(dict, i.ind ## and has been computed by `indices()` ## Simple scalar indexing -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" namedgetindex(n::NamedArray, i::Integer) = getindex(n.array, i) namedgetindex(n::NamedArray, i1::Integer, i2::Integer) = getindex(n.array, i1, i2) namedgetindex(n::NamedArray, i1::Integer, i2::Integer, i3::Integer) = getindex(n.array, i1, i2, i3) @@ -80,7 +80,7 @@ dimkeepingtype(x::Range) = true dimkeepingtype(x::BitArray) = true ## Slices etc. -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" ## in julia pre 0.5, only trailing singleton dimensions are removed function namedgetindex(n::NamedArray, index...) a = getindex(n.array, index...) @@ -156,7 +156,7 @@ import Base.setindex! setindex!{T}(A::NamedArray{T}, x) = setindex!(A, convert(T,x), 1) -if VERSION < v"0.5-dev" +if VERSION < v"0.5" setindex!{T}(n::NamedArray{T}, x, i1::Real) = setindex!(n.array, convert(T,x), indices(n.dicts[1],i1)) setindex!{T}(n::NamedArray{T}, x, i1::Real, i2::Real) = setindex!(n.array, convert(T,x), indices(n.dicts[1], i1), indices(n.dicts[2], i2)) setindex!{T}(n::NamedArray{T}, x, i1::Real, i2::Real, i3::Real) = setindex!(n.array, convert(T,x), indices(n.dicts[1],i1), indices(n.dicts[2], i2), indices(n.dicts[3], i3)) @@ -179,7 +179,7 @@ function setindex!{T}(A::NamedArray{T}, X::ArrayOrNamed{T}, I::Range{Int}) return A end -if VERSION < v"0.5-dev" +if VERSION < v"0.5" # n[[1,3,4,6]] = 1:4 setindex!{T<:Real}(A::NamedArray, X::AbstractArray, I::AbstractVector{T}) = setindex!(A.array, X, I) diff --git a/src/keepnames.jl b/src/keepnames.jl index 72bafb3..0cfa2a1 100644 --- a/src/keepnames.jl +++ b/src/keepnames.jl @@ -49,14 +49,14 @@ function Base.vcat(N::NamedVector...) end ## broadcast -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" Base.Broadcast.broadcast(f, n::NamedArray, As...) = broadcast!(f, similar(n, Base.Broadcast.broadcast_shape(n, As...)), n, As...) else Base.Broadcast.broadcast_t(f, T, n::NamedArray, As...) = broadcast!(f, similar(n, T, Base.Broadcast.broadcast_shape(n, As...)), n, As...) end ## keep names intact -if VERSION < v"0.5-dev" +if VERSION < v"0.5" for f in (:sin, :cos, :tan, :sind, :cosd, :tand, :sinpi, :cospi, :sinh, :cosh, :tanh, :asin, :acos, :atan, :asind, :acosd, :sec, :csc, :cot, :secd, :cscd, :cotd, :asec, :acsc, :asecd, :acscd, :acotd, :sech, :csch, :coth, :asinh, :acosh, :atanh, :asech, :acsch, :acoth, :sinc, :cosc, :deg2rad, :log, :log2, :log10, :log1p, :exp, :exp2, :exp10, :expm1, :ceil, :floor, :trunc, :round, :abs, :abs2, :sign, :signbit, :sqrt, :isqrt, :cbrt, :erf, :erfc, :erfcx, :erfi, :dawson, :erfinv, :erfcinv, :real, :imag, :conj, :angle, :cis, :gamma, :lgamma, :digamma, :invdigamma, :trigamma, :airyai, :airyprime, :airyaiprime, :airybi, :airybiprime, :besselj0, :besselj1, :bessely0, :bessely1, :eta, :zeta) eval(Expr(:import, :Base, f)) @eval ($f)(a::NamedArray) = NamedArray(($f)(a.array), a.dicts, a.dimnames) diff --git a/src/names.jl b/src/names.jl index 1b37e6e..be90517 100644 --- a/src/names.jl +++ b/src/names.jl @@ -23,7 +23,7 @@ dimnames(a::AbstractArray) = [defaultdimnames(a)...] dimnames(a::AbstractArray, d::Integer) = defaultdimname(d) ## string versions of the above -strnames(dict::Associative) = map(string, names(dict)) +strnames(dict::Associative) = [isa(name, String) ? name : sprint(showcompact, name) for name in names(dict)] strnames(n::NamedArray) = [strnames(d) for d in n.dicts] strnames(n::NamedArray, d::Integer) = strnames(n.dicts[d]) strdimnames(n::NamedArray) = [string(dn) for dn in n.dimnames] diff --git a/src/rearrange.jl b/src/rearrange.jl index 6288b2c..a7011e9 100644 --- a/src/rearrange.jl +++ b/src/rearrange.jl @@ -54,7 +54,7 @@ rotr90(n::NamedArray) = transpose(flipdim(n, 1)) rotl90(n::NamedArray) = transpose(flipdim(n, 2)) rot180(n::NamedArray) = NamedArray(rot180(n.array), tuple([reverse(name) for name in names(n)]...), n.dimnames) -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" import Base.nthperm, Base.nthperm! else import Combinatorics.nthperm, Combinatorics.nthperm! diff --git a/test/arithmetic.jl b/test/arithmetic.jl index 807050f..c4f188c 100644 --- a/test/arithmetic.jl +++ b/test/arithmetic.jl @@ -62,20 +62,22 @@ end @test ((1:6) - v).array == (1:6) - v.array ## matmul -if VERSION >= v"0.5.0-dev" ## v0.4 ambiguity-hell with AbstractTriangular c.s. +if VERSION ≥ v"0.5" ## v0.4 ambiguity-hell with AbstractTriangular c.s. ## Assume dimensions/names are correct c = NamedArray(Float64, 5, 5) - A_mul_B!(c, randn(5, 10), randn(10, 5)) - A_mul_Bc!(c, randn(5, 10), randn(5, 10)) - A_mul_Bt!(c, randn(5, 10), randn(5, 10)) - Ac_mul_B!(c, randn(10, 5), randn(10, 5)) - At_mul_B!(c, randn(10, 5), randn(10, 5)) - At_mul_Bt!(c, randn(10,5), randn(5, 10)) + r5x10 = randn(5, 10) + r10x5 = randn(10, 5) + @test A_mul_B!(c, r5x10, r10x5) == r5x10 * r10x5 + @test A_mul_Bc!(c, r5x10, r5x10) == r5x10 * r5x10' + @test A_mul_Bt!(c, r5x10, r5x10) == r5x10 * r5x10' + @test Ac_mul_B!(c, r10x5, r10x5) == r10x5' * r10x5 + @test At_mul_B!(c, r10x5, r10x5) == r10x5' * r10x5 + @test At_mul_Bt!(c, r10x5, r5x10) == r10x5' * r5x10' end for m in (NamedArray(rand(4)), NamedArray(rand(4,3))) - m * m' - m' * m + @test m * m' == m.array * m.array' + @test m' * m == m.array' * m.array @test n * m == n * m.array == n.array * m == n.array * m.array ## the first expression dispatches Ac_mul_Bc!: @test isapprox(m' * n.array', m' * n') @@ -151,7 +153,7 @@ lufa = lufact(n.array) a = randn(1000,10); s = NamedArray(a'a) ## The necessity for isapprox sugests we don't get BLAS implementations but a fallback... -if VERSION >= v"0.5.0-dev" ## v0.4 cholfact is different? +if VERSION ≥ v"0.5" ## v0.4 cholfact is different? @test isapprox(cholfact(s).factors.array, cholfact(s.array).factors) end diff --git a/test/constructors.jl b/test/constructors.jl index 8c0cfe0..a4c793c 100644 --- a/test/constructors.jl +++ b/test/constructors.jl @@ -40,11 +40,9 @@ n4 = NamedArray(a, (OrderedDict("a"=>1,"b"=>2), OrderedDict("C"=>1,"D"=>2,"E"=>3 @test names(n3,2) == names(n4,2) == ["C","D","E"] ## 0-dim case #21 -if VERSION ≥ v"0.4-dev" - n0 = NamedArray(Array{Int}()) - @test size(n0) == () - @test n0[1] == n0.array[1] -end +n0 = NamedArray(Array{Int}()) +@test size(n0) == () +@test n0[1] == n0.array[1] ## Calling constructors through convert, #38 @test convert(NamedArray, n.array) == NamedArray(n.array) diff --git a/test/index.jl b/test/index.jl index f6aa83a..6e57af3 100644 --- a/test/index.jl +++ b/test/index.jl @@ -31,7 +31,7 @@ first = n.array[1,:] @test names(n[Not("two"), :]) == names(n[1:1, :]) @test n[:, ["b", "d"]] == view(n, :, ["b", "d"]) == n[:, [2, 4]] -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" @test names(n["one", :],1) == ["one"] end @test names(n[Not("one"), :],1) == ["two"] diff --git a/test/init-namedarrays.jl b/test/init-namedarrays.jl index 2d99dd6..be480dc 100644 --- a/test/init-namedarrays.jl +++ b/test/init-namedarrays.jl @@ -1,7 +1,7 @@ n = NamedArray(rand(2,4)) Letters = [string(Char(64+i)) for i in 1:26] letters = [string(Char(64+32+i)) for i in 1:26] -if VERSION < v"0.5.0-dev" +if VERSION < v"0.5" letters = ASCIIString[ascii(s) for s in letters] end diff --git a/test/matrixops.jl b/test/matrixops.jl index 9c609ca..8e2cfde 100644 --- a/test/matrixops.jl +++ b/test/matrixops.jl @@ -20,11 +20,7 @@ for t in (Float32, Float64) d = diag(a) diagm(d) cond(a) - if VERSION ≥ v"0.4-dev" - nullspace(a) - else - null(a) - end + nullspace(a) kron(a, a) linreg(a[:,1], b[:,1]) lyap(a, c) diff --git a/test/names.jl b/test/names.jl index bfc1c92..e572b84 100644 --- a/test/names.jl +++ b/test/names.jl @@ -9,7 +9,7 @@ include("init-namedarrays.jl") @test dimnames(n.array, 1) == :A @test dimnames(n.array, 2) == :B -if VERSION > v"0.5.0-dev" ## ascii and utf-8 are both String +if VERSION ≥ v"0.5" ## ascii and utf-8 are both String dn1 = ["一", "二"] dn2 = ["一", "二", "三", "四"] else diff --git a/test/runtests.jl b/test/runtests.jl index ef0e323..62c13a9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -10,8 +10,8 @@ using NamedArrays using Base.Test using DataStructures -if VERSION < v"0.5.0-dev" - view(n, args...) = getindex(n, args...) +if VERSION < v"0.5" + view(n::NamedArray, args...) = getindex(n, args...) end include("test.jl") diff --git a/test/show.jl b/test/show.jl index 779dc6a..7c235c3 100644 --- a/test/show.jl +++ b/test/show.jl @@ -9,27 +9,109 @@ println("show,") include("init-namedarrays.jl") -if VERSION >= v"0.4.0-dev" - println(NamedArray(Array{Int}())) +if VERSION ≥ v"0.5" + tostring(b::IOBuffer) = String(b) + times = "×" ## \times +else + tostring(b::IOBuffer) = UTF8String(b.data) + times = "x" # ex end -println(NamedArray([])) -print(n) -println() -show(n) -show(STDOUT, MIME"text/plain"(), n) -show(NamedArray(randn(2,1000))) -show(NamedArray(randn(1000,2))) -show(NamedArray(randn(1000))) +function showlines(x...) + buf = IOBuffer() + show(buf, x...) + return split(tostring(buf), "\n") +end + +lines = showlines(NamedArray(Array{Int}())) +@test length(lines) == 2 +@test lines[1] == "0-dimensional Named Array{Int64,0}" + +lines = showlines(NamedArray([])) +@test length(lines) == 2 +@test lines[1] == "0-element Named Array{Any,1}" + +for lines in Any[showlines(n), showlines(MIME"text/plain"(), n)] + @test length(lines) == 5 + @test lines[1] == "2$(times)4 Named Array{Float64,2}" + @test split(lines[2]) == vcat(["A", "╲", "B", "│"], letters[1:4]) +end + +## wide array abbreviated +lines = showlines(NamedArray(randn(2,1000))) +@test length(lines) == 5 +@test lines[1] == "2$(times)1000 Named Array{Float64,2}" +header = split(lines[2]) +@test header[vcat(1:5, end)] == ["A", "╲", "B", "│", "1", "1000"] +@test "…" in header +for (i, line) in enumerate(lines[end-1:end]) + @test split(line)[1] == string(i) +end + +## tall array abbreviated +lines = showlines(NamedArray(randn(1000,2))) +@test length(lines) > 7 +@test lines[1] == "1000$(times)2 Named Array{Float64,2}" +@test split(lines[2]) == ["A", "╲", "B", "│", "1", "2"] +@test split(lines[4])[1] == "1" +@test split(lines[end])[1] == "1000" + +## tall vector abbreviated +lines = showlines(NamedArray(randn(1000))) +@test length(lines) > 7 +@test lines[1] == "1000-element Named Array{Float64,1}" +@test split(lines[2]) == ["A", "│"] +@test split(lines[4])[1] == "1" +@test split(lines[end])[1] == "1000" + +## non-standard integer indexing zo = [0,1] -println(NamedArray(rand(2,2,2), (zo, zo, zo), ("base", "zero", "indexing"))) +lines = showlines(NamedArray(rand(2,2,2), (zo, zo, zo), ("base", "zero", "indexing"))) +@test length(lines) == 13 +@test lines[1] == "2$(times)2$(times)2 Named Array{Float64,3}" + +for (index, offset) in ([0, 3], [1, 9]) + @test lines[offset] == "[:, :, indexing=$index] =" + @test split(lines[offset+1]) == ["base", "╲", "zero", "│", "0", "1"] + @test split(lines[offset+3])[1] == "0" + @test split(lines[offset+4])[1] == "1" +end + for ndim in 1:5 - println(NamedArray(rand(fill(2,ndim)...))) + lines = showlines(NamedArray(rand(fill(2,ndim)...))) + if (ndim == 1) + line1 = "2-element Named Array{Float64,1}" + else + line1 = join(repmat(["2"], ndim), times) * " Named Array{Float64,$ndim}" + end + @test lines[1] == line1 + if ndim ≥ 3 + @test startswith(lines[3], "[:, :, C=1") + @test split(lines[4]) == ["A", "╲", "B", "│", "1", "2"] + end end ## various singletons println(NamedArray(rand(1,2,2))) println(NamedArray(rand(2,1,2))) println(NamedArray(rand(2,2,1))) +## sparse array nms = [string(hash(i)) for i in 1:1000] -show(NamedArray(sprand(1000,1000, 1e-4), (nms, nms))) +lines = showlines(NamedArray(sprand(1000,1000, 1e-4), (nms, nms))) +@test length(lines) > 7 +@test startswith(lines[1], "1000×1000 Named sparse matrix with") +@test endswith(lines[1], "Float64 nonzero entries:") +@test sum([contains(line, "⋮") for line in lines]) == 1 + +# array with Nullable names +lines = showlines(NamedArray(rand(2, 2), (Nullable["a", Nullable()], Nullable["c", "d"]))) +@test lines[1] == "2$(times)2 Named Array{Float64,2}" +if VERSION >= v"0.5.0-" + @test split(lines[2]) == ["A", "╲", "B", "│", "\"c\"", "\"d\""] + @test startswith(lines[4], "\"a\"") + @test startswith(lines[5], "#NULL") +else + @test split(lines[2]) == ["A","╲","B","│","Nullable(\"c\")","Nullable(\"d\")"] + @test startswith(lines[4], "Nullable(\"a\")") + @test startswith(lines[5], "Nullable") +end diff --git a/test/test.jl b/test/test.jl index b5d4d15..62e64e5 100644 --- a/test/test.jl +++ b/test/test.jl @@ -67,7 +67,7 @@ for i1=1:2, i2=1:3, i3=1:4, i4=1:3, i5=1:2, i6=1:3 @test m[string(i1), string(i2), string(i3), string(i4), string(i5), string(i6)] == m.array[i1,i2,i3,i4,i5,i6] end m[1, :, 2, :, 2, 3].array == m.array[1, :, 2, :, 2, 3] -if VERSION >= v"0.5-dev" +if VERSION ≥ v"0.5" i = [3 2 4; 1 4 2] @test n[:, i].array == n.array[:, i] @test names(n[:, i], 1) == names(n, 1) @@ -111,7 +111,7 @@ print("vectorized, ") ## a selection of vectorized functions for f in (:sin, :cos, :tan, :sinpi, :cospi, :sinh, :cosh, :tanh, :asin, :acos, :atan, :sinc, :cosc, :deg2rad, :log, :log2, :log10, :log1p, :exp, :exp2, :exp10, :expm1, :abs, :abs2, :sign, :sqrt, :erf, :erfc, :erfcx, :erfi, :dawson, :erfinv, :erfcinv, :gamma, :lgamma, :digamma, :invdigamma, :trigamma, :besselj0, :besselj1, :bessely0, :bessely1, :eta, :zeta) - if VERSION < v"0.5.0-dev" + if VERSION < v"0.5" @eval @test ($f)(n).array == ($f)(n.array) else @eval begin @@ -122,7 +122,7 @@ for f in (:sin, :cos, :tan, :sinpi, :cospi, :sinh, :cosh, :tanh, :asin, :acos, end end #39 -if VERSION >= v"0.5.0-dev" +if VERSION ≥ v"0.5" v = n[1,:] @test sin.(v).array == sin.(v.array) @test namesanddim(sin.(v)) == namesanddim(v) @@ -142,7 +142,7 @@ include("show.jl") include("speed.jl") -if VERSION ≥ v"0.5.0-dev" +if VERSION ≥ v"0.5" # julia issue #17328 a = NamedArray([1.0,2.0,3.0,4.0]) @test sumabs(a, 1)[1] == 10