Repository navigation
Match Vector's index rules in MissingVector insert!, deleteat!, and similar - #141
Open
quinnj-bot[bot] wants to merge 2 commits into
Open
quinnj-bot[bot] wants to merge 2 commits into
quinnj-bot[bot] wants to merge 2 commits into
Conversation
Fails on main; passes with the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…imilar deleteat! deleted once per given index without checking order or duplicates, insert! rejected the append position, and similar(x, Missing, dims) ignored all but the first dimension, which broke hcat. Validate deleteat! indices like Vector, accept length(x) + 1 in insert!, and keep the MissingVector method of similar to one dimension. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
A
MissingVectorshould follow the same index rules as aVector{Missing}. It did not in three places:deleteat!with repeated or unsorted indices silently deleted the wrong number of elements.insert!rejected the append position.similar(x, Missing, dims)ignored every dimension after the first, sohcatwrote into a vector.What changed
deleteat!(x, inds)checks that indices are sorted, unique, and in bounds, and throws the same errors asVector.insert!(x, length(x) + 1, missing)appends.similar(x, Missing, dims)returns aMissingVectoronly for one dimension and falls back to Base otherwise.Scope
MissingVector. Each one now matchesVector.Blast radius
Callers that passed repeated or unsorted indices to
deleteat!now get an error instead of a wrong length.Verification
mainand passes on this branch (Julia 1.12.6).deleteat!errors matchVector:ArgumentErrorfor repeated or unsorted indices andBoundsErrorfor out-of-range ones.ChainedVector,SentinelVector, andMissingVector, compared withVector) reports this mismatch onmainand not with the fixes applied.🤖 Generated with Claude Code