-
Notifications
You must be signed in to change notification settings - Fork 46
Added resize! function for OffsetVector #55
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
Conversation
Is it a problem that this pull-request comes from my master (instead of a branch)? |
Not at all, but for the future you might find it more convenient to use branches on your own fork too. |
Sorry I didn't notice this when you submitted it, August was busy. I like this, but before I merge it let me raise one conceptual issue. CC @mbauman and @andyferris to see whether they have any thoughts on this. |
There's so many options here with offset arrays. If you I see a few distinct options
I'm not certain what is best. |
@andyferris thanks for chiming in. You may be amused by https://github.com/JuliaArrays/CatIndices.jl which contains Of your options, I think the third is the best but unfortunately it's not achievable without serious sacrifices elsewhere (so it's off the table as far as I am concerned). I think we should choose between the first two. |
Cool, yes it makes sense that it's been done :) I guess the question I have is - do you find it useful? |
From CatIndices.jl
I've come to start thinking that certain interfaces are somewhat distinct and not really compatible with each other. The "list" interface (what we often call the deque interface, I assume because of the implemention (not interface) of I've started thinking of three categories
(Further, as far as I can tell, There may be more, but this seems to be what exists in Base. It would seem to me that you could replace en mass the keys of a OffsetArray with other keys of semantic importance, which is basically some subset of the third functionality. Or you could have a zero-based array that is a "list", which is some intersection of the second option and
What are the main sacrifices? |
In specific contexts, yes. It's a dependency of ImageFiltering (useful for implementing the various padding rules).
|
Fair enough. (This is where a trailing |
Barring objections I'll merge this shortly. |
This pull request implements resizing for OffsetVectors.
The code was taken from julia/test/testhelpers/OffsetArrays.jl and by including it, unique!() should subsequently also work for OffsetArrays.