Skip to content

Commit ed1163e

Browse files
ChrisRackauckasSciML Bot
andauthored
Apply JuliaFormatter to fix code formatting (#193)
- Applied JuliaFormatter with SciML style guide - Formatted 3 files 🤖 Generated by OrgMaintenanceScripts.jl Co-authored-by: SciML Bot <[email protected]>
1 parent 44c6abf commit ed1163e

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/RootedTrees.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ end
9494
root = first(level_sequence)
9595
prev = root
9696
for level in view(level_sequence,
97-
(firstindex(level_sequence) + 1):lastindex(level_sequence))
97+
(firstindex(level_sequence) + 1):lastindex(level_sequence))
9898
if (level <= root) || (level > prev + 1)
9999
return false
100100
end
@@ -905,7 +905,7 @@ function all_partitions(t::RootedTree)
905905
forests = [partition_forest(t, edge_set)]
906906
skeletons = [partition_skeleton(t, edge_set)]
907907

908-
for edge_set_value in 1:(2^length(edge_set) - 1)
908+
for edge_set_value in 1:(2 ^ length(edge_set) - 1)
909909
binary_digits!(edge_set, edge_set_value)
910910
push!(forests, partition_forest(t, edge_set))
911911
push!(skeletons, partition_skeleton(t, edge_set))
@@ -1056,10 +1056,8 @@ end
10561056

10571057
# necessary for simple and convenient use since the iterates may be modified
10581058
function Base.collect(partitions::PartitionIterator{TreeInput,
1059-
TreeOutput}) where {
1060-
TreeInput,
1061-
TreeOutput
1062-
}
1059+
TreeOutput}) where {TreeInput,
1060+
TreeOutput}
10631061
iterates = Vector{Tuple{Vector{TreeOutput}, TreeOutput}}()
10641062
sizehint!(iterates, length(partitions))
10651063
for (forest, skeleton) in partitions
@@ -1092,7 +1090,7 @@ function all_splittings(t::RootedTree)
10921090
forests = Vector{Vector{RootedTree{T, Vector{T}}}}()
10931091
subtrees = Vector{RootedTree{T, Vector{T}}}() # ordered subtrees
10941092

1095-
for node_set_value in 0:(2^order(t) - 1)
1093+
for node_set_value in 0:(2 ^ order(t) - 1)
10961094
binary_digits!(node_set, node_set_value)
10971095

10981096
# Check that if a node is removed then all of its descendants are removed

src/colored_trees.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ Representation of bicolored rooted trees.
4343
4444
See also [`ColoredRootedTree`](@ref), [`RootedTree`](@ref), [`rootedtree`](@ref).
4545
"""
46-
const BicoloredRootedTree{T <: Integer, V <: AbstractVector{T}, C <: AbstractVector{Bool}} = ColoredRootedTree{T,
47-
V,
48-
C}
46+
const BicoloredRootedTree{T <: Integer, V <: AbstractVector{T},
47+
C <: AbstractVector{Bool}} = ColoredRootedTree{T,
48+
V,
49+
C}
4950

5051
"""
5152
rootedtree(level_sequence, color_sequence)
@@ -204,7 +205,7 @@ function Base.:(==)(t1::ColoredRootedTree, t2::ColoredRootedTree)
204205

205206
root1_minus_root2 = first(t1.level_sequence) - first(t2.level_sequence)
206207
for (e1, c1, e2, c2) in zip(t1.level_sequence, t1.color_sequence, t2.level_sequence,
207-
t2.color_sequence)
208+
t2.color_sequence)
208209
v1 = e1
209210
v2 = e2 + root1_minus_root2
210211
(v1 == v2 && c1 == c2) || return false

src/plot_recipes.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ function _plot_coordinates(t::AbstractRootedTree,
7272
x_child = x_children[idx]
7373
push!(x, nan, x_root, x_child)
7474
push!(y, nan, y_root, y_child)
75-
x_recursive, y_recursive = _plot_coordinates(subtr[idx],
76-
x_child, y_child, width / 3, height)
75+
x_recursive,
76+
y_recursive = _plot_coordinates(subtr[idx],
77+
x_child, y_child, width / 3, height)
7778
append!(x, x_recursive)
7879
append!(y, y_recursive)
7980
end
@@ -212,10 +213,11 @@ function _plot_coordinates(t::ColoredRootedTree,
212213
push!(x, [x_root, x_child])
213214
push!(y, [y_root, y_child])
214215
push!(colors, [color_root, colormap[first(subtr[idx].color_sequence)]])
215-
x_recursive, y_recursive, colors_recursive = _plot_coordinates(subtr[idx],
216-
x_child, y_child,
217-
width / 3, height,
218-
colormap)
216+
x_recursive, y_recursive,
217+
colors_recursive = _plot_coordinates(subtr[idx],
218+
x_child, y_child,
219+
width / 3, height,
220+
colormap)
219221
append!(x, x_recursive)
220222
append!(y, y_recursive)
221223
append!(colors, colors_recursive)

0 commit comments

Comments
 (0)