Skip to content

Commit

Permalink
reshape for offset AbstractVectors with Tuple{Colon} as indices (#41599)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Jul 18, 2021
1 parent 9023817 commit 9044222
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/reshapedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ reshape(parent::AbstractArray, dims::Dims) = _reshape(parent, dims)

# Allow missing dimensions with Colon():
reshape(parent::AbstractVector, ::Colon) = parent
reshape(parent::AbstractVector, ::Tuple{Colon}) = parent
reshape(parent::AbstractArray, dims::Int...) = reshape(parent, dims)
reshape(parent::AbstractArray, dims::Union{Int,Colon}...) = reshape(parent, dims)
reshape(parent::AbstractArray, dims::Tuple{Vararg{Union{Int,Colon}}}) = reshape(parent, _reshape_uncolon(parent, dims))
Expand Down
5 changes: 5 additions & 0 deletions test/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1565,3 +1565,8 @@ end
@test_throws ArgumentError keepat!(a, [2, 1])
@test isempty(keepat!(a, []))
end

@testset "reshape methods for AbstractVectors" begin
r = Base.IdentityUnitRange(3:4)
@test reshape(r, :) === reshape(r, (:,)) === r
end
6 changes: 6 additions & 0 deletions test/offsetarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -795,3 +795,9 @@ end
@test Iterators.partition(OffsetArray(reshape(collect(1:9),3,3), (3,3)), 5) |> collect == [1:5,6:9] #OffsetMatrix
@test Iterators.partition(IdOffsetRange(2:7,10), 5) |> collect == [12:16,17:17] # IdOffsetRange
end

@testset "reshape" begin
a = OffsetArray(4:5, 5:6)
@test reshape(a, :) === a
@test reshape(a, (:,)) === a
end
1 change: 1 addition & 0 deletions test/testhelpers/OffsetArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ Base.reshape(A::OffsetArray, inds::Tuple{Union{Integer,Base.OneTo},Vararg{Union{
Base.reshape(A::OffsetArray, inds::Dims) = reshape(parent(A), inds)
Base.reshape(A::OffsetArray, ::Colon) = reshape(parent(A), Colon())
Base.reshape(A::OffsetVector, ::Colon) = A
Base.reshape(A::OffsetVector, ::Tuple{Colon}) = A
Base.reshape(A::OffsetArray, inds::Union{Int,Colon}...) = reshape(parent(A), inds)
Base.reshape(A::OffsetArray, inds::Tuple{Vararg{Union{Int,Colon}}}) = reshape(parent(A), inds)

Expand Down

4 comments on commit 9044222

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong when running your job:

ProcessExitedException(2)

cc @maleadt

@maleadt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restarted the process -- it had failed last week with:

Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        signal (11): Segmentation fault
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        in expression starting at none:0
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        MurmurHash3_x64_128 at /buildworker/worker/package_linux64/build/src/support/MurmurHash3.c:295
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        memhash_seed at /buildworker/worker/package_linux64/build/src/support/hashing.c:74
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        immut_id_ at /buildworker/worker/package_linux64/build/src/builtins.c:323 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_object_id_ at /buildworker/worker/package_linux64/build/src/builtins.c:373
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        objectid at ./reflection.jl:291 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        dataids at ./abstractarray.jl:1407 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        mightalias at ./abstractarray.jl:1384 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        unalias at ./abstractarray.jl:1349
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        copyto! at ./abstractarray.jl:949 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        Array at ./strings/string.jl:87 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        convert at ./array.jl:532 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        Request at /storage/pkgeval/depot/packages/HTTP/IAI92/src/Messages.jl:178 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #Request#3 at /storage/pkgeval/depot/packages/HTTP/IAI92/src/Messages.jl:192
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        Type##kw at /storage/pkgeval/depot/packages/HTTP/IAI92/src/Messages.jl:192 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #request#1 at /storage/pkgeval/depot/packages/HTTP/IAI92/src/MessageRequest.jl:48
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        request##kw at /storage/pkgeval/depot/packages/HTTP/IAI92/src/MessageRequest.jl:28 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #request#1 at /storage/pkgeval/depot/packages/HTTP/IAI92/src/BasicAuthRequest.jl:28
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        request##kw at /storage/pkgeval/depot/packages/HTTP/IAI92/src/BasicAuthRequest.jl:21
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        unknown function (ip: 0x7f94c922183c)
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:336 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /storage/pkgeval/depot/packages/Retry/vS1bg/src/repeat_try.jl:192 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _http_request at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:329
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /storage/pkgeval/depot/packages/Mocking/U41JO/src/mock.jl:29 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:398 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /storage/pkgeval/depot/packages/Retry/vS1bg/src/repeat_try.jl:192 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #submit_request#32 at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:395
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        submit_request##kw at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:376
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        unknown function (ip: 0x7f94c9217e3c)
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #_#33 at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:601
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        Any##kw at /storage/pkgeval/depot/packages/AWS/J5jan/src/AWS.jl:577 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #put_object#170 at /storage/pkgeval/depot/packages/AWS/J5jan/src/services/s3.jl:3449
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        put_object at /storage/pkgeval/depot/packages/AWS/J5jan/src/services/s3.jl:3449
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        execute_tests! at /storage/pkgeval/Nanosoldier/src/jobs/PkgEvalJob.jl:243
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        run at /storage/pkgeval/Nanosoldier/src/jobs/PkgEvalJob.jl:355
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        do_apply at /buildworker/worker/package_linux64/build/src/builtins.c:670
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #106 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:278
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        run_work_thunk at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:63
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/process_messages.jl:278 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        #105 at ./task.jl:411
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        unknown function (ip: 0x7f94c916213c)
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        _jl_invoke at /buildworker/worker/package_linux64/build/src/gf.c:2237 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2419
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1703 [inlined]
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        start_task at /buildworker/worker/package_linux64/build/src/task.c:839
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        unknown function (ip: (nil))
Jul 09 05:38:59 amdci8 bash[45426]:       From worker 2:        Allocations: 99130712795 (Pool: 99090549529; Big: 40163266); GC: 18488

After which the Nanosoldier.jl process was in a bad state.

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your package evaluation job has completed - possible new issues were detected. A full report can be found here.

Please sign in to comment.