Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure with Julia 1.9 #1

Closed
mcabbott opened this issue Jun 27, 2022 · 1 comment
Closed

Failure with Julia 1.9 #1

mcabbott opened this issue Jun 27, 2022 · 1 comment

Comments

@mcabbott
Copy link

With Julia nightly, there is a clash of exported symbols:

julia> arr = reshape(1:24, 2, 3, 4);

julia> rank"summary 2"(arr)
WARNING: both JuliennedArrays and Base export "Slices"; uses of it in module JJ must be qualified
ERROR: UndefVarError: Slices not defined
Stacktrace:
 [1] enframe(data::Base.ReshapedArray{Int64, 3, UnitRange{Int64}, Tuple{}}, rank::Val{2})
   @ JJ ~/.julia/packages/JJ/Qh6eT/src/julienned.jl:22
 [2] (::JJ.RankedMonad{typeof(summary), 2})(x::Base.ReshapedArray{Int64, 3, UnitRange{Int64}, Tuple{}})
   @ JJ ~/.julia/packages/JJ/Qh6eT/src/ranked.jl:46
 [3] top-level scope
   @ REPL[6]:1

julia> @eval JJ const Slices = JuliennedArrays.Slices  # seems necc on master
JuliennedArrays.Slices

julia> rank"summary 2"(arr)
4-element Vector{String}:
 "2×3 view(reshape(::UnitRange{In"  35 bytes  ".OneTo(3), 1) with eltype Int64"
 "2×3 view(reshape(::UnitRange{In"  35 bytes  ".OneTo(3), 2) with eltype Int64"
 "2×3 view(reshape(::UnitRange{In"  35 bytes  ".OneTo(3), 3) with eltype Int64"
 "2×3 view(reshape(::UnitRange{In"  35 bytes  ".OneTo(3), 4) with eltype Int64"

julia> map(summary, eachslice(arr, dims=3))
4-element Vector{String}:
 "2×3 view(reshape(::UnitRange{Int64}, 2, 3, 4), :, :, 1) with eltype Int64"
 "2×3 view(reshape(::UnitRange{Int64}, 2, 3, 4), :, :, 2) with eltype Int64"
 "2×3 view(reshape(::UnitRange{Int64}, 2, 3, 4), :, :, 3) with eltype Int64"
 "2×3 view(reshape(::UnitRange{Int64}, 2, 3, 4), :, :, 4) with eltype Int64"

This is due to JuliaLang/julia#32310, which makes eachslice more powerful; this should arguably be used instead of JuliennedArrays now.

(You may also wish to watch JuliaLang/julia#43334, which is roughly the other half of JuliennedArrays.)

@bertschi
Copy link
Owner

Nice, was not aware of these functions in 1.9.
Have just installed and compiled nightly ... Julia is surprisingly fast to compile ;-)

For now, I have pushed a fix importing JuliennedArrays explicitly qualified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants