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

upgrade OffsetArrays to v1.3.0 #37643

Merged
merged 8 commits into from
Oct 6, 2020

Conversation

johnnychen94
Copy link
Member

Separated from #37629

cc: @timholy

@johnnychen94 johnnychen94 force-pushed the jc/upgrade_offsetarrays branch 3 times, most recently from 073a4df to d702325 Compare September 18, 2020 15:59
@StefanKarpinski
Copy link
Member

@timholy, I think this would just need a quick once-over from you.

@mbauman mbauman added the test This change adds or pertains to unit tests label Sep 29, 2020
@@ -22,7 +22,7 @@ using Distributed: splitrange
@test splitrange(-1, 1, 4) == Array{UnitRange{Int64},1}([-1:-1,0:0,1:1])

const BASE_TEST_PATH = joinpath(Sys.BINDIR, "..", "share", "julia", "test")
isdefined(Main, :OffsetArrays) || @eval Main include(joinpath($(BASE_TEST_PATH), "testhelpers", "OffsetArrays.jl"))
isdefined(Main, :OffsetArrays) || @eval Main @everywhere include(joinpath($(BASE_TEST_PATH), "testhelpers", "OffsetArrays.jl"))
Copy link
Member

Choose a reason for hiding this comment

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

It surprises me that this wasn't needed before

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this is because eachindex(oa) requires axes(oa), which now returns OffsetArrays.IdOffsetRange.

end

@inline function Base.deleteat!(A::OffsetArray, i::Int)
Copy link
Member

Choose a reason for hiding this comment

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

Interesting — is there a reason why this was removed from OffsetArrays? Or has it never made it there?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmmm... I'm surprised that this seems to never appeared in OffsetArrays.jl codebase. My best guess of this not going into OffsetArrays.jl is to make clear the conceptual confusion between an array and a list.

There are tendencies to add support for OffsetList, though (e.g., JuliaArrays/OffsetArrays.jl#137, #37629)

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense — and the old definition for deleteat! doesn't really test any other base functionality, so I think this is fine to remove.

The definition for push! is also changing, though, and in doing so I think we lose the test coverage on resize!.

Copy link
Member Author

Choose a reason for hiding this comment

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

The resize! tests are added in 1f9b290 (copied from OffsetArrays.jl)

v1.2.0 introduces an ambiguity and thus not used.
OffsetArrays issues 133 and 100 are fixed by JuliaLang#37204.
@johnnychen94 johnnychen94 force-pushed the jc/upgrade_offsetarrays branch from d702325 to c46776f Compare September 30, 2020 06:05
@johnnychen94 johnnychen94 changed the title upgrade OffsetArrays to v1.1.3 upgrade OffsetArrays to v1.3.0 Sep 30, 2020
@johnnychen94 johnnychen94 force-pushed the jc/upgrade_offsetarrays branch from c46776f to 18323b1 Compare September 30, 2020 06:09
@johnnychen94
Copy link
Member Author

The test failure seems unrelated.

@timholy
Copy link
Member

timholy commented Oct 6, 2020

Thanks @johnnychen94!

@timholy timholy merged commit 4ccfd37 into JuliaLang:master Oct 6, 2020
@johnnychen94 johnnychen94 deleted the jc/upgrade_offsetarrays branch October 6, 2020 11:46
Keno pushed a commit that referenced this pull request Jun 5, 2024
* upgrade to OffsetArrays v1.3.0

* everywhere include OffsetArrays

* more tests for #37204

OffsetArrays issues 133 and 100 are fixed by #37204.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test This change adds or pertains to unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants