You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functioncenter(A::AbstractArray)
map(axes(A)) do inds
length(inds)-1)/2+first(inds)
endendfunctioncentered(A::AbstractArray, cp::Dims=center(A), r::RoundingMode=RoundDown)
OffsetArray(A, map(x->round(Int, x, r), .-cp))
end
This enables users to get the raw float point center coordinate and thus can be used in other scenarios. For instance, in interpolations, arrays are not required to be placed at the grids points. Also, unlike the previous version, applying rounding mode to centered will not be ambiguous anymore (See #250)
Unfortunately, to support this breaking behavior transition, a major version bump is required. For now, we should just stick to the current integer world. Also, I'm not sure how much people want this change so it's better to leave it open for a while before making any deprecations.
The text was updated successfully, but these errors were encountered:
I'm OK with a breaking change/major version bump if that's what is needed, but I haven't yet dug into this carefully enough to comment. Perhaps I'll focus on the Images transition first and come back?
This isn't something urgent to change. I think it's totally acceptable to wait for other more important calls for breaking change. For now, we can just live in the integer world and keep this issue open until we're ready to break everything.
Working through #242 #251 and #254, I have to admit that I made a design mistake here, instead of current
A better approach is perhaps to:
This enables users to get the raw float point center coordinate and thus can be used in other scenarios. For instance, in interpolations, arrays are not required to be placed at the grids points. Also, unlike the previous version, applying rounding mode to
centered
will not be ambiguous anymore (See #250)Unfortunately, to support this breaking behavior transition, a major version bump is required. For now, we should just stick to the current integer world. Also, I'm not sure how much people want this change so it's better to leave it open for a while before making any deprecations.
The text was updated successfully, but these errors were encountered: