Conversation
meggart
left a comment
There was a problem hiding this comment.
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.
Just curious why this is necessary, are the fallbacks too slow here?
There was a problem hiding this comment.
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.
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
PaddedDiskArraywrapper and aDiskArrays.padfunction 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 thefillkeyword, which is zero by default.Chunk offsets are updated to match the padding