Deprecations.jl icon indicating copy to clipboard operation
Deprecations.jl copied to clipboard

List of deprecations to implement

Open KristofferC opened this issue 7 years ago • 3 comments

Will keep adding to this:

  • [x] Ptr{Void} -> Ptr{Cvoid}
  • [x] Void -> Nothing
  • [x] unshift! -> pushfirst!, shift!-> popfirst!
  • [x] CartesianRange -> CartesianIndices
  • [x] sub2ind -> CartesianIndices, ind2sub -> LinearIndices
  • [x] JULIA_HOME -> Sys.BINDIR
  • [x] ipermute! -> invpermute!
  • [ ] spones(A) -> fillstored!(copy(A), 1)
  • [ ] info, warn to macro versions (might be a bit tricky).
  • [x] Display -> AbstractDisplay
  • [x] linspace(a, b) -> linspace(a, b, 50), logspace(a, b) -> logspace(a, b, 50).
  • [x] (x...) -> (x...,)
  • [x] strwidth, charwidth -> textwidth
  • [x] Array{T, N}(m::Int, ...::Int) -> Array{T, N}(uninitialized, m, ...)
  • [x] logm -> log, expm -> exp, sqrtm -> sqrt
  • [ ] union() -> Set().
  • [ ] A_mul_B! -> mul! and co
  • [x] isleaftype -> isconcretetype https://github.com/JuliaLang/julia/pull/25496
  • [x] isabstract-> isabstracttype https://github.com/JuliaLang/julia/pull/25496
  • [ ] doc" " -> @doc doc""
  • [x] iteratorsize -> IteratorSize
  • [x] digits keyword argument to round.
  • [x] parse -> Meta.parse
  • [ ] prod, sum needs to take dims keyword
  • [x] linspace to range with keyword arguments
  • [ ] Automatically escape previously invalid escape sequences in strings
  • [ ] showcompact
  • [ ] eval -> Core.eval
  • [ ] atan2 -> atan
  • [ ] Compat.@__MODULE__ -> @__MODULE__
  • [ ] parse(Int, s, b) -> parse(Int, s, base=b).
  • [ ] is_unix -> Sys.isunix

Some of these might be unsafe to do without semantic analysis. Look into using https://github.com/ZacLN/StaticLint.jl and see how well it can be used to figure out where the binding originate from.

KristofferC avatar Jan 04 '18 15:01 KristofferC

From NEWS.md... Not a final list, but rather to start weeding them out.

  • [ ] Need correct version numbers for the deprecations.

Simple renames ... as well as the case for all other stdlib deprecations.

  • [ ] using Base.Test -> using Test
  • [ ] LinAlg -> LinearAlgebra
  • [ ] bits -> bitstring
  • [ ] search and rsearch have been deprecated in favor of findfirst/findnext and findlast/findprev respectively, in combination with curried isequal and in predicates for some methods
  • [ ] Random.dSFMT -> Random.DSFMT
  • [ ] gc and gc_enable and Base.@gc_preserve-> GC.gc and GC.enable and GC.@preserve
  • [ ] LinSpace -> LinRange
  • [ ] endof -> lastindex
  • [ ] DateTime(), Date(), Time(), -> DateTime(1), Date(1), Time(1)
  • [ ] isupper, islower, ucfirst, lcfirst -> isuppercase, islowercase, uppercasefirst, lowercasefirst
  • [ ] Base.IntSet -> Base.BitSet
  • [ ] linearindices -> new LinearIndices type.
  • [ ] LinAlg.fillslots! -> LinAlg.fillstored!
  • [ ] cfunction -> @cfunction
  • [ ] GMP.gmp_version(), GMP.GMP_VERSION, GMP.gmp_bits_per_limb(), and GMP.GMP_BITS_PER_LIBM -> GMP.version(), GMP.VERSION, GMP.bits_per_limb(), and GMP.BITS_PER_LIMB.
  • [ ] MPFR.get_version() -> MPFR.version()

stdlib exports

  • [ ] Libdl exports need using Libdl
  • [ ] sparse functionalities require using SparseArrays
  • [ ] is_assigned_char and normalize_string -> isassigned and normalize need a using Unicode, as well as graphemes
  • [ ] eigs and svds need using IterativeEigensolvers
  • [ ] stringmime needs using Base64

Done

  • [x] module_name, Base.function_name, and Base.datatype_name -> nameof
  • [x] Associative -> AbstractDict
  • [x] module_parent, Base.datatype_module, Base.funciton_module -> parentmodule
  • [x] EnvHash -> EnvDict
  • [x] nb_available -> bytesavailable
  • [x] issubtype -> <:
  • [x] ctranspose and ctranspose! -> adjoint and adjoint!
  • [x] select, select!, selectperm, selectperm! -> partialsort, partialsort!, partialsortperm, partialsortperm
  • [x] Range -> AbstractRange
  • [x] LinAlg.LAPACK.laver() -> LinAlg.LAPACK.version()

Light Expression mangling

  • [ ] indices(a) and indices(a,d) -> axes(a), axes(a,d)
  • [ ] getindex(F::Factorization, s::Symbol) (usually seen as e.g. F[:Q]) is deprecated in favor of dot overloading (getproperty) so factors should now be accessed as e.g. F.Q instead of F[:Q]
  • [ ] search(buf :: IOBuffer, delim :: UInt8) -> occursin(delim, buf)to test containment orreaduntil(buf,delim)`
  • [ ] ismatch(regex, str) -> contains(str,regex)
  • [ ] matchall -> collect(m.match for m in eachamtch(r,s))
  • [ ] similar(::Associative) -> empty(::Associative), similar(::Associative, Pair{K,V})->empty(::Associative, K,V)`
  • [x] findin(a,b) -> `findall(in(b), a)
  • [ ] Random.RandomDevice(unlimited :: Bool) ( on non Windows) -> Random.RandomDevice(; unlimited = unlimited)
  • [ ] rand(t :: Tuple{VarArg{Int}}) -> rand(Float64, t) or rand(t...)
  • [ ] ObjectIdDict - > IdDict{Any, Any}
  • [ ] scale! -> mul!, lmul!, rmul!
  • [ ] remove_destination keyword argument to cp, mv, and the unexported cptree has been renamed to force
  • [ ] contains -> occursin, as well as reversing the order of the args.
  • [ ] Regex objects no longer callable -> contains
  • [ ] deprecate logspace
  • [ ] showcompact(io, x...) has been deprecated in favor of show(IOContext(io, :compact => true), x...) (#26080). Use sprint(show, x..., context=:compact => true) instead of sprint(showcompact, x...).
  • [ ] signif -> sigdigits kw argument to round
  • [ ] setrounding -> Float32, Float64, as it was too unreliable.
  • [ ] gamma, lgamma, beta, lbeta, lfact -> using SpecialFunctions
  • [ ] atan is now a 2 arg method of atan
  • [ ] BitArray constructors need undef
  • [ ] Prefix & in ccall now need Ref argument types
  • [ ] findn(x :: AbstractArray) -> findall(!iszero, x)
  • [ ] eye(::Type{Diagonal{T{{, m:: Integer) -> Diagonal{T}(I, m)

More Expression mangling

  • [ ] eig(A[, args...]) -> (eigen(A[, args...])...,)
  • [ ] eig( A :: AbstractMatrix, B :: AbstractMatrix) and eig(A :: Number, B :: Number) -> eigen(A, B), and also (eigen(A,B)...,)
  • [ ] The use of a positional dimension argument has largely been deprecated in favor of a dims keyword argument. This includes the functions sum, prod, maximum, minimum, all, any, findmax, findmin, mean, varm, std, var, cov, cor, median, mapreducedim, reducedim, sort, accumulate, accumulate!, cumsum, cumsum!, cumprod, cumprod!, flipdim, squeeze, and cat
  • [ ] broadcast_getindex(A, I...) and broadcast_setindex!(A, v, I...) are deprecated in favor of getindex.((A,), I...) and setindex!.((A,), v, I...),
  • [ ] fill!(A :: Diagonal, x) and fill!(A::AbstractTriangular, x) -> Base.LinAlg.fillstored!(A,x)
  • [ ] See deprecations for eye
  • [ ] zeros(D:: Diagnoal[, opts...]) deprecated.
  • [ ] sliceddim(A, d, i) -> copy(selectdim(A, d,i))
  • [ ] RowVector undefs deprecations
  • [ ] writecsv(io, a; opts...) -> `writedlm(io, a, ','; opts...)
  • [ ] srand(rng, filename, n=4) has been deprecated
  • [x] readcsv(io[, T::Type]; opts...) -> readdlm(io, ','[, T]; opts...)
  • [ ] sparse(s::UniformScaling, m::Integer) -> sparse(s::UniformScaling, m, n)
  • [ ] facts and decomps
  • [ ] expand(ex) and expand(module,ex) -> `Meta.lower(module,ex)
  • [ ] ones and zeros
  • [ ] corrected positional argument to cov
  • [ ] replace(s::AbstractString, pat, r, [count]) -> replace(s::AbstractString, pat => r; [count]). count must use typemax(Int)
  • [ ] read(io, type, dims) -> read!(io, Array{type}(undef, dims))
  • [ ] read(::IO, ::Ref) -> now a method of read!
  • [ ] skipchars(io :: IO, predicate; linecomment = nothing)->skipchars(predicate, io :: IO; linecommet = nothing)
  • [ ] Bidiagonal uses a symbol now
  • [ ] nfields on a type -> fieldcount
  • [ ] write on non-isbits -> explicit loops or serialize
  • [ ] readstring -> read(io, String)
  • [ ] rol and circshifts
  • [ ] Math constants
  • [ ] Deprecate array + scalar linalg cases
  • [ ] flipbits!(B) --> B .= .!B
  • [ ] spdiagm(x::AbstractVector) has been deprecated in favor of sparse(Diagonal(x)) alternatively spdiagm(0 => x) (#23757).
  • [ ] spdiagm(x::AbstractVector, d::Integer) and spdiagm(x::Tuple{<:AbstractVector}, d::Tuple{<:Integer}) have been deprecated in favor of spdiagm(d => x) and spdiagm(d[1] => x[1], d[2] => x[2], ...)

miguelraz avatar Jun 12 '18 22:06 miguelraz

+1 for auto-fixing a positional dimensions argument!

bjarthur avatar Sep 18 '18 20:09 bjarthur

ismatch -> contains can be checked off this list

bjarthur avatar Sep 20 '18 17:09 bjarthur