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

Get rid of Tableregressionmodel #194

Merged
merged 7 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PhyloNetworks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module PhyloNetworks

import Base: show
import GLM: ftest
import StatsModels: coefnames

const DEBUGC = false # even more debug messages
global CHECKNET = false # for debugging only
Expand Down
23 changes: 23 additions & 0 deletions src/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,26 @@
@deprecate getMajorParentEdge getparentedge false
@deprecate getMinorParentEdge getparentedgeminor false
@deprecate getPartner getpartneredge false

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)
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)
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)
modmatr = modelmatrix(mm)
return ModelMatrix{typeof(modmatr)}(modmatr, Int[])
else
return getfield(mm, f)
end
end
Loading