Skip to content

Commit

Permalink
others
Browse files Browse the repository at this point in the history
  • Loading branch information
cossio committed Jul 6, 2023
1 parent 735537c commit 98e23bf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Tree.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ abstract type AbstractBranchTree{RT, N, B, LI, ND} <:
end

import Phylo.API: _hasinbound
function _hasinbound(tree::AbstractBranchTree{<: Rooted}, name::String)
function _hasinbound(tree::AbstractBranchTree{<: Rooted}, name::String)
return tree.nodes[name].inbound !== nothing
end

Expand Down Expand Up @@ -429,7 +429,7 @@ end

import Phylo.API: _addoutbound!
function _addoutbound!(tree::BinaryTree{RT}, name::String, branch::B) where
{RT <: Rooted, N, B <: Branch{RT, String}}
{RT <: Rooted, B <: Branch{RT, String}}
node = tree.nodes[name]
node.outbounds[1] nothing ?
node.outbounds = (branch, node.outbounds[2]) :
Expand Down
10 changes: 5 additions & 5 deletions src/plot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ end

_handlez(x, tree, names) = x
_handlez(x::Union{String, Symbol}, tree, names) = [getnodedata(tree, name, x) for name in names]
function _handlez(x::Dict, tree, names) where T
function _handlez(x::Dict, tree, names)

Check warning on line 155 in src/plot.jl

View check run for this annotation

Codecov / codecov/patch

src/plot.jl#L155

Added line #L155 was not covered by tests
ret = fill(NaN, length(names))
for (i, n) in enumerate(names)
name = getnodename(tree, n)
Expand Down Expand Up @@ -293,10 +293,10 @@ end
"""
map_depthfirst(FUN, start, tree, eltype = nothing)
Apply `FUN` to each node in `tree` in depth-first order, and return the result.
`FUN` must take two arguments, `val` and `node`, where `val` is the result of
applying `FUN` to the previous node, and `node` is the current node. `start`
specifies the initial value of `val`, and `eltype` specifies the type of the
Apply `FUN` to each node in `tree` in depth-first order, and return the result.
`FUN` must take two arguments, `val` and `node`, where `val` is the result of
applying `FUN` to the previous node, and `node` is the current node. `start`
specifies the initial value of `val`, and `eltype` specifies the type of the
return value of `FUN`.
### Examples
Expand Down
2 changes: 1 addition & 1 deletion src/routes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function noderoute end
return [getnodename(tree, n) for n in route]
end
@traitfn function noderoute(tree::T, node1::N, node2::N) where
{RT, N, T <: AbstractTree{OneTree}; MatchNodeType{T, N}}
{N, T <: AbstractTree{OneTree}; MatchNodeType{T, N}}
branches1, nodes1 = _treehistory(tree, node1)
branches2, nodes2 = _treehistory(tree, node2)
nodes1[end] == nodes2[end] || error("No route between nodes in tree")
Expand Down

0 comments on commit 98e23bf

Please sign in to comment.