JuliaStats / GLM.jl

Generalized linear models in Julia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

buggy deprecation for :confint interval

piever opened this issue · comments

In the predict function, it looks like interval = :confint is deprecated, but the deprecation itself errors.

MWE (on GLM 1.4.0)

julia> using GLM

julia> m = lm(rand(100, 2), rand(100));

julia> predict(m, rand(100, 2), interval=:confidence)
(prediction = [0.4457712011811358, 0.5895167997046556, 0.6248370487585566, 0.17901578098319926, 0.35424647775731344, 0.5664701710008138, 0.8007288341954572, 0.08617824050232076, 0.619747015285145, 0.18596756716000415    0.40837348662667183, 0.10592168624191159, 0.4785070523998235, 0.5705130491054077, 0.5431816917484562, 0.16760895142782536, 0.10227135499858943, 0.5618049997084372, 0.1560673602644415, 0.14408625116079402], lower = [0.3559292469108241; 0.4424800814605109;  ; 0.09932816503375805; 0.11872678430208171], upper = [0.5356131554514474; 0.7365535179488004;  ; 0.21280655549512498; 0.1694457180195063])

julia> predict(m, rand(100, 2), interval=:confint)
ERROR: MethodError: no method matching depwarn(::String)
Closest candidates are:
  depwarn(::Any, ::Any; force) at deprecated.jl:79
Stacktrace:
 [1] predict(mm::LinearModel{GLM.LmResp{Vector{Float64}}, GLM.DensePredChol{Float64, LinearAlgebra.CholeskyPivoted{Float64, Matrix{Float64}}}}, newx::Matrix{Float64}; interval::Symbol, level::Float64)   
   @ GLM ~\.julia\packages\GLM\9WMIv\src\lm.jl:220
 [2] top-level scope
   @ REPL[78]:1

@pdeffebach Looks like #386 didn't add a test for the deprecation?

I don't think this is #386. The only changes in #386 are for the lm keyword arguments.

The last change to that depwarn line was 2 years ago, and Base.depwarn appears undocumented. At first I thought that there was some unannounced breaking change to depwarn but I think that the Base.depwarn(::String) method has never existed.

So I think this error has been sitting around for someone to find for a long time.

OK. Not sure whether it's a good news or not. :-)

It's a bit late to fix this deprecation, but see #412.