From 950551aa4ef04368e3a9c13001d1bf78ad258f89 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Sun, 8 Mar 2015 14:17:32 +0100 Subject: [PATCH] Deprecate flipud() and fliplr() in favor of flipdim() We do not provide other convenience functions for any other operation, like size(), and these names are obscure for non-MATLAB users. --- NEWS.md | 3 +++ base/abstractarray.jl | 3 --- base/deprecated.jl | 3 +++ base/dsp.jl | 2 +- doc/stdlib/arrays.rst | 8 -------- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/NEWS.md b/NEWS.md index 90b7d695cff24e..6768ceff14758b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -238,6 +238,9 @@ Deprecated or removed * The operators `|>`, `.>`, `>>`, and `.>>` as used for process I/O redirection are replaced with the `pipe` function ([#5349]). + * `flipud(A)` and `fliplr(A)` have been deprecated in favor of `flipdim(A, 1)` and + `flipdim(A, 2)`, respectively ([#10446]). + Julia v0.3.0 Release Notes ========================== diff --git a/base/abstractarray.jl b/base/abstractarray.jl index becbe491695d9a..91c610614eb7e3 100644 --- a/base/abstractarray.jl +++ b/base/abstractarray.jl @@ -518,9 +518,6 @@ function flipdim(A::AbstractArray, d::Integer) return B end -flipud(A::AbstractArray) = flipdim(A, 1) -fliplr(A::AbstractArray) = flipdim(A, 2) - circshift(a::AbstractArray, shiftamt::Real) = circshift(a, [integer(shiftamt)]) function circshift{T,N}(a::AbstractArray{T,N}, shiftamts) I = () diff --git a/base/deprecated.jl b/base/deprecated.jl index 7436c9db3f93af..f386e23c8d34b9 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -294,6 +294,9 @@ const base64 = base64encode # 10314 @deprecate filter!(r::Regex, d::Dict) filter!((k,v)->ismatch(r,k), d) +@deprecate flipud(A::AbstractArray) flipdim(A, 1) +@deprecate fliplr(A::AbstractArray) flipdim(A, 2) + # 0.4 discontinued functions @noinline function subtypetree(x::DataType, level=-1) diff --git a/base/dsp.jl b/base/dsp.jl index 193e06b084e022..8d7190c1b8575b 100644 --- a/base/dsp.jl +++ b/base/dsp.jl @@ -163,7 +163,7 @@ function xcorr(u, v) elseif sv < su v = [v;zeros(eltype(v),su-sv)] end - flipud(conv(flipud(u), v)) + flipdim(conv(flipdim(u, 1), v), 1) end fftshift(x) = circshift(x, div([size(x)...],2)) diff --git a/doc/stdlib/arrays.rst b/doc/stdlib/arrays.rst index 2def1568ca9752..9e04218f601fa7 100644 --- a/doc/stdlib/arrays.rst +++ b/doc/stdlib/arrays.rst @@ -267,14 +267,6 @@ Indexing, Assignment, and Concatenation Reverse ``A`` in dimension ``d``. -.. function:: flipud(A) - - Equivalent to ``flipdim(A,1)``. - -.. function:: fliplr(A) - - Equivalent to ``flipdim(A,2)``. - .. function:: circshift(A,shifts) Circularly shift the data in an array. The second argument is a vector giving the amount to shift in each dimension.