fix interval selection when keys are intervals#120
Open
aplavin wants to merge 1 commit intomcabbott:masterfrom
Open
fix interval selection when keys are intervals#120aplavin wants to merge 1 commit intomcabbott:masterfrom
aplavin wants to merge 1 commit intomcabbott:masterfrom
Conversation
Collaborator
Author
|
nightly failures are unrelated |
Collaborator
Author
|
bump |
rofinn
reviewed
Aug 31, 2022
| findall(in(int), r) | ||
|
|
||
| # find interval in a vector of intervals: same as generic findindex in lookup.jl | ||
| function findindex(int::Interval, r::AbstractVector{<:Interval}) |
Collaborator
There was a problem hiding this comment.
Hmm, I suppose this is a bit ambiguous as you could also want to find the first occurrence in which int overlaps or intersects with one of the intervals in r. I suppose that's what the functional interface is for though? @mcabbott do you have a preference?
Collaborator
Author
There was a problem hiding this comment.
My motivation was that keeping invariants goes a long way. And "calling with a value of type eltype(axiskeys(A)) returns the array value at that specific axiskey value" is a nice invariant to follow whenever possible. Overlaps or whatever else can be done with separate selectors, potentially as simple as !isdisjoint(int)/⊆(int)/....
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.
it wasn't possible to simply index by key if keys are intervals themlselves