Skip to content

Commit

Permalink
Merge pull request #40 from PierreBarrat/fix_failing_docs
Browse files Browse the repository at this point in the history
Fix failing docs
  • Loading branch information
PierreBarrat committed Feb 22, 2024
2 parents 0f60e93 + 09c4d38 commit 794a305
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
TreeKnit = "03f602be-98a1-4bb2-9504-fbd3406624a7"
TreeTools = "62f0eae3-8c0e-4032-a621-7756092209e5"

[compat]
Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using Documenter

Documenter.makedocs(;
source = "src",
warnonly = [:missing_docs,],
clean = true,
doctest = true,
modules = Module[TreeKnit],
Expand Down
10 changes: 7 additions & 3 deletions src/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,14 @@ function run_treeknit!(trees::AbstractVector{<:Tree}, oa::OptArgs; naive=false)

oa.pre_resolve && resolve!(trees...)

# function used for inferring the MCCs
# for every pair of trees (i,j), will be called as
# `f(oa, trees[i], trees[j]; output = :mccs)`
f = if naive
TreeKnit.naive_mccs
(oa, t1, t2; kwargs...) -> TreeKnit.naive_mccs(t1, t2)
else
TreeKnit.runopt
end

return if oa.parallel == true
run_parallel_treeknit!(trees, oa; infer_mccs_function=f)
else
Expand All @@ -157,7 +159,9 @@ end

run_treeknit!(trees; kwargs...) = run_treeknit!(trees, OptArgs(length(trees); kwargs...))

run_treeknit!(t1::Tree, t2::Tree; kwargs...) = run_treeknit!([t1,t2], OptArgs(;kwargs...))
function run_treeknit!(t1::Tree, t2::Tree; naive=false, kwargs...)
return run_treeknit!([t1,t2], OptArgs(;kwargs...); naive)
end
run_treeknit!(t1::Tree, t2::Tree, oa::OptArgs) = run_treeknit!([t1,t2], oa)

run_treeknit(trees, oa::OptArgs) = run_treeknit!(map(copy, trees), oa)
Expand Down
2 changes: 1 addition & 1 deletion src/mcc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function naive_mccs(treelist)
checklist = Dict(k=>false for k in keys(tref.lleaves))

# Explore one leaf at a time
mc_clades = []
mc_clades = Vector{String}[]
for (cl,v) in checklist
if !v # If leave not already visited
# Root of current maximal clade, in all trees
Expand Down
2 changes: 1 addition & 1 deletion src/objects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
"""
function OptArgs(K::Int; method=:none, kwargs...)
OptArgs constructor will default to :better_trees method if K>2, :better_MCCs if K==2.
OptArgs constructor will default to `:better_trees` method if `K>2`, `:better_MCCs` if `K==2`.
"""
function OptArgs(K::Int; method=:none, kwargs...)
kwargs_dict = Dict(kwargs)
Expand Down

0 comments on commit 794a305

Please sign in to comment.