Deprecations.jl
Deprecations.jl copied to clipboard
List of deprecations to implement
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, warnto 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->isconcretetypehttps://github.com/JuliaLang/julia/pull/25496 - [x]
isabstract->isabstracttypehttps://github.com/JuliaLang/julia/pull/25496 - [ ]
doc" "->@doc doc"" - [x]
iteratorsize->IteratorSize - [x]
digitskeyword argument toround. - [x]
parse->Meta.parse - [ ]
prod,sumneeds to takedimskeyword - [x]
linspacetorangewith 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.
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 - [ ]
searchandrsearchhave been deprecated in favor offindfirst/findnextandfindlast/findprevrespectively, in combination with curriedisequalandinpredicates for some methods - [ ]
Random.dSFMT->Random.DSFMT - [ ]
gcandgc_enableandBase.@gc_preserve->GC.gcandGC.enableandGC.@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-> newLinearIndicestype. - [ ]
LinAlg.fillslots!->LinAlg.fillstored! - [ ]
cfunction->@cfunction - [ ]
GMP.gmp_version(),GMP.GMP_VERSION,GMP.gmp_bits_per_limb(), andGMP.GMP_BITS_PER_LIBM->GMP.version(),GMP.VERSION,GMP.bits_per_limb(), andGMP.BITS_PER_LIMB. - [ ]
MPFR.get_version()->MPFR.version()
stdlib exports
- [ ]
Libdlexports needusing Libdl - [ ] sparse functionalities require
using SparseArrays - [ ]
is_assigned_charandnormalize_string->isassignedandnormalizeneed ausing Unicode, as well asgraphemes - [ ]
eigsandsvdsneedusing IterativeEigensolvers - [ ]
stringmimeneedsusing Base64
Done
- [x]
module_name,Base.function_name, andBase.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]
ctransposeandctranspose!->adjointandadjoint! - [x]
select,select!,selectperm,selectperm!->partialsort,partialsort!,partialsortperm,partialsortperm - [x] Range -> AbstractRange
- [x]
LinAlg.LAPACK.laver()->LinAlg.LAPACK.version()
Light Expression mangling
- [ ]
indices(a)andindices(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.Qinstead ofF[: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)orrand(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->sigdigitskw argument to round - [ ]
setrounding->Float32,Float64, as it was too unreliable. - [ ]
gamma,lgamma,beta,lbeta,lfact->using SpecialFunctions - [ ]
atanis now a 2 arg method ofatan - [ ] BitArray constructors need
undef - [ ] Prefix
&inccallnow needRefargument 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)andeig(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)andfill!(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)andexpand(module,ex)-> `Meta.lower(module,ex) - [ ] ones and zeros
- [ ]
correctedpositional argument tocov - [ ]
replace(s::AbstractString, pat, r, [count])->replace(s::AbstractString, pat => r; [count]).countmust usetypemax(Int) - [ ]
read(io, type, dims)->read!(io, Array{type}(undef, dims)) - [ ]
read(::IO, ::Ref)-> now a method ofread! - [ ] skipchars(io :: IO, predicate; linecomment = nothing)
->skipchars(predicate, io :: IO; linecommet = nothing) - [ ]
Bidiagonaluses a symbol now - [ ]
nfieldson a type ->fieldcount - [ ]
writeon non-isbits -> explicit loops orserialize - [ ]
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 ofsparse(Diagonal(x))alternativelyspdiagm(0 => x)(#23757). - [ ]
spdiagm(x::AbstractVector, d::Integer)andspdiagm(x::Tuple{<:AbstractVector}, d::Tuple{<:Integer})have been deprecated in favor ofspdiagm(d => x)andspdiagm(d[1] => x[1], d[2] => x[2], ...)
+1 for auto-fixing a positional dimensions argument!
ismatch -> contains can be checked off this list