ITADN

Can we find a better name for `boundary=:edge`?

#251Opentomchor 创建于 2026-06-10
T
tomchorcommented
Currently the options for boundary treatment in filters are: ``` Stencil offsets that leave the interior 1:Nd_grid of a direction (where Nd_grid is the number of cells along that direction) are handled per-direction. For Periodic directions offsets are always wrapped periodically, independent of the boundary keyword. For Bounded directions the boundary keyword picks the policy (default: :shrink): • :shrink — drop out-of-bounds offsets from both the sum and the count, so the filter is an honest local average whose effective stencil shrinks near a wall. This is the default for Bounded directions. • :edge — replicate the boundary-cell value (reads ψ[1] or ψ[Nd_grid] for offsets past either end). • (left=a, right=b) — pad with constant a on the low-index side and b on the high-index side (a and b are promoted to a common type). ``` I think `:edge` is the least intuitive option. Maybe we can rename it to something better like `:pad_with_edge` or `:repeat_last_value`? cc @glwagner
9 条评论