0.5里的conv函数在1.0里换成什么名字了?

0.5里的conv函数在1.0里换成什么名字了?
还有@parallel 也没有了。请大神指教一下。

conv

一般都是先在 0.7 里看一下,有时会告诉你改成什么了。
@ v0.7

help?> conv
search: conv conv2 convert deconv code_native @code_native conj const conj! continue contains Condition isconst

  No documentation found.

  Base.DSP.conv is a Function.

搜了一下 Base.DSP => DSP.jl
ref: - Remove the FFTW bindings from Base by ararslan · Pull Request #21956 · JuliaLang/julia

所以
@v1.0

using Pkg
Pkg.add("DSP")
using DSP

就能用了

julia> conv
conv (generic function with 4 methods)

help?> conv
search: conv conv2 convert deconv code_native @code_native conj const conj! continue Condition isconst IOContext

  conv(u,v)

  Convolution of two vectors. Uses FFT algorithm.

@parallel

同理
@ v0.7

help?> @parallel
WARNING: Base.@parallel is deprecated: it has been moved to the standard library package `Distributed`.
Add `using Distributed` to your imports.
 in module Base
...

julia> @parallel
WARNING: Base.@parallel is deprecated: it has been moved to the standard library package `Distributed`.
Add `using Distributed` to your imports.
 in module Main
┌ Warning: `@parallel` is deprecated, use `@distributed` instead.
│   caller = eval(::Module, ::Any) at boot.jl:319
└ @ Core .\boot.jl:319

@v1.0

using Distributed
help?> @distributed
  @distributed

  A distributed memory, parallel for loop of the form :

  @distributed [reducer] for var = range
      body
  end

ref: - deprecate or improve @parallel for · Issue #19578 · JuliaLang/julia

3 个赞

非常感谢你的细致回复!非常感谢!解决了我的大问题了!:grinning:

woclass大神。1.0里没有find函数了。按你说的方法也没有找到它被换成什么了。麻烦你看看!:slightly_smiling_face:

find

确实 v0.7 里啥也没说

help?> find
search: find findn findin findmin findmax findall findprev findnext findmin! findmax! findlast findfirst isdefined

  No documentation found.

  Base.find is a Function.

  # 6 methods for generic function "find":
  [1] find(x::Number) in Base at deprecated.jl:53
  [2] find(A::AbstractArray{T,1} where T) in Base at deprecated.jl:53
  [3] find(A::AbstractArray) in Base at deprecated.jl:53
  [4] find(f::Function, A::AbstractArray{T,1} where T) in Base at deprecated.jl:53
  [5] find(f::Function, A::AbstractArray) in Base at deprecated.jl:53
  [6] find(args...) in Base at deprecated.jl:29

我去 0.7 的 Release Notes 搜了下,发现它改名了

find has been renamed to findall .
—— julia/HISTORY.md at master · JuliaLang/julia
搜这句能找到那一段

它在 Breaking changes 里

Breaking changes
This section lists changes that do not have deprecation warnings.

:thinking: 还行

不知道是不是你要的那个
@ v1.0

help?> findall
search: findall findmax! findmax findlast

  findall(f::Function, A)

  Return a vector I of the indices or keys of A where f(A[I]) returns true. If there are no such elements of A, return
  an empty array.

  Indices or keys are of the same type as those returned by keys(A) and pairs(A).

哦,原来改名了,非常感谢!:handshake:

一般不提示改成什么了,显示在 deprecated.jl 里,你可以直接去这个文件里搜

这是 v0.7 release

...
module DSP
    for f in [:conv, :conv2, :deconv, :filt, :filt!, :xcorr]
        @eval Base.@deprecate_moved $f "DSP"
    end
end
deprecate(Base, :DSP, 2)
using .DSP
export conv, conv2, deconv, filt, filt!, xcorr
...

@deprecate find(x::Number)            findall(!iszero, x)
...

非常感谢!0.5到1.0确实变动很多。你告诉我的方法非常棒!