-
Notifications
You must be signed in to change notification settings - Fork 18
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
add PaddedDiskArray
and pad
#219
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for starting this, this would be useful indeed.
src/pad.jl
Outdated
end | ||
|
||
readblock!(A::PaddedDiskArray, data, I...) = _readblock_padded!(A, data, I...) | ||
readblock!(A::PaddedDiskArray, data, I::AbstractVector...) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious why this is necessary, are the fallbacks too slow here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understood this question, I think we need readblock!
to fill the padding zeros/etc? Or should I do that another way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment was about the type signature of the arguments. I would suggest to do define readblock!(A::PaddedDiskArray, data, I::AbstractUnitRange{<:Int}...)
and let DiskArrays figure out complicated cases like unsorted vectors.
@rafaqz do you need support for fixing some of the chunk issues? |
Should be ok, just haven't had time to get back to it yet |
@meggart I think this is good to go |
Ive had this use case a few times that you want to pad a disk array for windowing or fixing chunk alignment, and you don't want to make a copy of the file.
This PR adds a
PaddedDiskArray
wrapper and aDiskArrays.pad
function that pads any disk array by custom amounts above and below the original array on each axis. The fill value for the padded area can be set with thefill
keyword, which is zero by default.Chunk offsets are updated to match the padding