Fix push! for OffsetVectors, add tests for push! and append! on AbstractVector#55480
Merged
jishnub merged 2 commits intoJuliaLang:masterfrom Aug 16, 2024
Merged
Conversation
Contributor
Author
|
I do not understand the CI failures here. They seem unrelated to the code changes. |
Member
|
Looks good to me |
jishnub
reviewed
Aug 15, 2024
| push!(a, args...) | ||
| @test length(a) == length(orig) + length(args) | ||
| @test a[axes(orig,1)] == orig | ||
| @test all(a[end-length(args)+1:end] .== args) |
Member
There was a problem hiding this comment.
Isn't this test equivalent to the simpler a[end-length(args)+1:end] == args?
Member
|
Please don't include any |
Member
|
Oops, sorry |
lazarusA
pushed a commit
to lazarusA/julia
that referenced
this pull request
Aug 17, 2024
…actVector (JuliaLang#55480) Per JuliaLang#55470 (comment), the `push!(::AbstractArray, ...)` array implementation assumed one-based indexing and did not account for an `OffsetVector` scenario. Here we add tests for `push!(::AbstractArray, ...)` and `append(::AbstractArray, ...)` including using `@invoke` to test the effect on `OffsetVector`. cc: @fredrikekre
Contributor
|
Shouldn't this also be backported to julia 1.11 as a follow up the previous PR? |
KristofferC
pushed a commit
that referenced
this pull request
Sep 9, 2024
…actVector (#55480) Per #55470 (comment), the `push!(::AbstractArray, ...)` array implementation assumed one-based indexing and did not account for an `OffsetVector` scenario. Here we add tests for `push!(::AbstractArray, ...)` and `append(::AbstractArray, ...)` including using `@invoke` to test the effect on `OffsetVector`. cc: @fredrikekre (cherry picked from commit 5230d27)
33 tasks
KristofferC
pushed a commit
that referenced
this pull request
Sep 12, 2024
…actVector (#55480) Per #55470 (comment), the `push!(::AbstractArray, ...)` array implementation assumed one-based indexing and did not account for an `OffsetVector` scenario. Here we add tests for `push!(::AbstractArray, ...)` and `append(::AbstractArray, ...)` including using `@invoke` to test the effect on `OffsetVector`. cc: @fredrikekre
KristofferC
added a commit
that referenced
this pull request
Sep 17, 2024
Backported PRs: - [x] #55480 <!-- Fix push! for OffsetVectors, add tests for push! and append! on AbstractVector --> - [x] #55443 <!-- Add test for upper/lower/titlecase and fix call --> - [x] #55524 <!-- Set `.jl` sources as read-only during installation --> - [x] #55500 <!-- make jl_thread_suspend_and_get_state safe --> - [x] #55506 <!-- Fix indexing in _mapreducedim for OffsetArrays --> - [x] #55564 <!-- Empty out loaded_precompiles dict instead of asserting it's empty. --> - [x] #55567 <!-- Initialize threadpools correctly during sysimg build --> - [x] #55596 <!-- Fast bounds-check for CartesianIndex ranges --> - [x] #55605 <!-- Reroute Symmetric/Hermitian + Diagonal through triangular --> - [x] #55640 <!-- win: move stack_overflow_warning to the backtrace fiber --> - [x] #55715 <!-- Add precompile signatures to Markdown to reduce latency. --> - [x] #55593 <!-- Fix invalidations for FileIO --> - [x] #55555 <!-- Revert "Don't expose guard pages to malloc_stack API consumers" --> - [x] #55720 <!-- Fix `pkgdir` for extensions --> - [x] #55729 <!-- Avoid confounding compilation side effects of `@time_imports` --> - [x] #55718 <!-- Fix `@time_imports` extension recognition --> - [x] #55522 <!-- Fix tr for Symmetric/Hermitian block matrices --> Contains multiple commits, manual intervention needed: - [ ] #55509 <!-- Fix cong implementation to be properly random and not just cycling. --> Non-merged PRs with backport label: - [ ] #55641 <!-- fall back to slower stat filesize if optimized filesize fails --> - [ ] #55534 <!-- Set stdlib sources as read-only during installation --> - [ ] #55499 <!-- propagate the terminal's `displaysize` to the `IOContext` used by the REPL --> - [ ] #55458 <!-- Allow for generically extracting unannotated string --> - [ ] #55457 <!-- Make AnnotateChar equality consider annotations --> - [ ] #55453 <!-- Privatise the annotations API, for StyledStrings --> - [ ] #55355 <!-- relocation: account for trailing path separator in depot paths --> - [ ] #55220 <!-- `isfile_casesensitive` fixes on Windows --> - [ ] #55169 <!-- `propertynames` for SVD respects private argument --> - [ ] #54457 <!-- Make `String(::Memory)` copy --> - [ ] #53957 <!-- tweak how filtering is done for what packages should be precompiled --> - [ ] #51479 <!-- prevent code loading from lookin in the versioned environment when building Julia --> - [ ] #50813 <!-- More doctests for Sockets and capitalization fix --> - [ ] #50157 <!-- improve docs for `@inbounds` and `Base.@propagate_inbounds` --> - [ ] #41244 <!-- Fix shell `cd` error when working dir has been deleted -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Per #55470 (comment), the
push!(::AbstractArray, ...)array implementation assumed one-based indexing and did not account for anOffsetVectorscenario.
Here we add tests for
push!(::AbstractArray, ...)andappend(::AbstractArray, ...)including using@invoketo test the effect onOffsetVector.cc: @fredrikekre