Skip to content

Commit

Permalink
phylolm deprecations: comment about them being silent
Browse files Browse the repository at this point in the history
  • Loading branch information
cecileane committed Mar 30, 2023
1 parent e5f144e commit 8ecb0dd
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@

function Base.getproperty(mm::PhyloNetworkLinearModel, f::Symbol)
if f === :model
Base.depwarn("accessing the `model` field of PhyloNetworkLinearModel.jl models is deprecated, " *
"as they are no longer wrapped in a `TableRegressionModel` " *
"and can be used directly now", :getproperty)
Base.depwarn("""accessing the 'model' field of PhyloNetworkLinearModel's is
deprecated, as they are no longer wrapped in a TableRegressionModel.
They can be used directly now.""",
:getproperty) # force=true to show warning. currently silent by default
return mm
elseif f === :mf
Base.depwarn("accessing the `mf` field of PhyloNetworkLinearModel.jl models is deprecated, " *
"as they are no longer wrapped in a `TableRegressionModel`." *
"Use `formula(m)` to access the model formula.", :getproperty)
Base.depwarn("""accessing the 'mf' field of PhyloNetworkLinearModel's is
deprecated, as they are no longer wrapped in a TableRegressionModel.
Use `formula(m)` to access the model formula.""", :getproperty)
form = formula(mm)
return ModelFrame{Nothing, typeof(mm)}(form, nothing, nothing, typeof(mm))
elseif f === :mm
Base.depwarn("accessing the `mm` field of PhyloNetworkLinearModel.jl models is deprecated, " *
"as they are no longer wrapped in a `TableRegressionModel`." *
"Use `modelmatrix(m)` to access the model matrix.", :getproperty)
Base.depwarn("""accessing the 'mm' field of PhyloNetworkLinearModel's is
deprecated, as they are no longer wrapped in a TableRegressionModel.
Use `modelmatrix(m)` to access the model matrix.""", :getproperty)
modmatr = modelmatrix(mm)
return ModelMatrix{typeof(modmatr)}(modmatr, Int[])
else
Expand Down

0 comments on commit 8ecb0dd

Please sign in to comment.