Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List of deprecations to implement #20

Open
19 of 32 tasks
KristofferC opened this issue Jan 4, 2018 · 3 comments
Open
19 of 32 tasks

List of deprecations to implement #20

KristofferC opened this issue Jan 4, 2018 · 3 comments

Comments

@KristofferC
Copy link
Contributor

KristofferC commented Jan 4, 2018

Will keep adding to this:

  • Ptr{Void} -> Ptr{Cvoid}
  • Void -> Nothing
  • unshift! -> pushfirst!, shift!-> popfirst!
  • CartesianRange -> CartesianIndices
  • sub2ind -> CartesianIndices, ind2sub -> LinearIndices
  • JULIA_HOME -> Sys.BINDIR
  • ipermute! -> invpermute!
  • spones(A) -> fillstored!(copy(A), 1)
  • info, warn to macro versions (might be a bit tricky).
  • Display -> AbstractDisplay
  • linspace(a, b) -> linspace(a, b, 50), logspace(a, b) -> logspace(a, b, 50).
  • (x...) -> (x...,)
  • strwidth, charwidth -> textwidth
  • Array{T, N}(m::Int, ...::Int) -> Array{T, N}(uninitialized, m, ...)
  • logm -> log, expm -> exp, sqrtm -> sqrt
  • union() -> Set().
  • A_mul_B! -> mul! and co
  • isleaftype -> isconcretetype kill isleaftype JuliaLang/julia#25496
  • isabstract-> isabstracttype kill isleaftype JuliaLang/julia#25496
  • doc" " -> @doc doc""
  • iteratorsize -> IteratorSize
  • digits keyword argument to round.
  • parse -> Meta.parse
  • prod, sum needs to take dims keyword
  • 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.

@miguelraz
Copy link

miguelraz commented Jun 12, 2018

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

  • module_name, Base.function_name, and Base.datatype_name -> nameof
  • Associative -> AbstractDict
  • module_parent, Base.datatype_module, Base.funciton_module -> parentmodule
  • EnvHash -> EnvDict
  • nb_available -> bytesavailable
  • issubtype -> <:
  • ctranspose and ctranspose! -> adjoint and adjoint!
  • select, select!, selectperm, selectperm! -> partialsort, partialsort!, partialsortperm, partialsortperm
  • Range -> AbstractRange
  • 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)`
  • 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
  • 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], ...)

@bjarthur
Copy link

+1 for auto-fixing a positional dimensions argument!

@bjarthur
Copy link

ismatch -> contains can be checked off this list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants