From 1e528d0bfd5f3a07a2dd3ff4d1a2bd2d3668a3fa Mon Sep 17 00:00:00 2001 From: SciML Bot Date: Thu, 31 Jul 2025 16:36:53 -0400 Subject: [PATCH] Apply JuliaFormatter to fix code formatting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Applied JuliaFormatter with SciML style guide - Formatted 3 files 🤖 Generated by OrgMaintenanceScripts.jl --- src/RootedTrees.jl | 12 +++++------- src/colored_trees.jl | 9 +++++---- src/plot_recipes.jl | 14 ++++++++------ 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/RootedTrees.jl b/src/RootedTrees.jl index 6a05de1a..20508103 100644 --- a/src/RootedTrees.jl +++ b/src/RootedTrees.jl @@ -94,7 +94,7 @@ end root = first(level_sequence) prev = root for level in view(level_sequence, - (firstindex(level_sequence) + 1):lastindex(level_sequence)) + (firstindex(level_sequence) + 1):lastindex(level_sequence)) if (level <= root) || (level > prev + 1) return false end @@ -905,7 +905,7 @@ function all_partitions(t::RootedTree) forests = [partition_forest(t, edge_set)] skeletons = [partition_skeleton(t, edge_set)] - for edge_set_value in 1:(2^length(edge_set) - 1) + for edge_set_value in 1:(2 ^ length(edge_set) - 1) binary_digits!(edge_set, edge_set_value) push!(forests, partition_forest(t, edge_set)) push!(skeletons, partition_skeleton(t, edge_set)) @@ -1056,10 +1056,8 @@ end # necessary for simple and convenient use since the iterates may be modified function Base.collect(partitions::PartitionIterator{TreeInput, - TreeOutput}) where { - TreeInput, - TreeOutput - } + TreeOutput}) where {TreeInput, + TreeOutput} iterates = Vector{Tuple{Vector{TreeOutput}, TreeOutput}}() sizehint!(iterates, length(partitions)) for (forest, skeleton) in partitions @@ -1092,7 +1090,7 @@ function all_splittings(t::RootedTree) forests = Vector{Vector{RootedTree{T, Vector{T}}}}() subtrees = Vector{RootedTree{T, Vector{T}}}() # ordered subtrees - for node_set_value in 0:(2^order(t) - 1) + for node_set_value in 0:(2 ^ order(t) - 1) binary_digits!(node_set, node_set_value) # Check that if a node is removed then all of its descendants are removed diff --git a/src/colored_trees.jl b/src/colored_trees.jl index 361f8a21..03684474 100644 --- a/src/colored_trees.jl +++ b/src/colored_trees.jl @@ -43,9 +43,10 @@ Representation of bicolored rooted trees. See also [`ColoredRootedTree`](@ref), [`RootedTree`](@ref), [`rootedtree`](@ref). """ -const BicoloredRootedTree{T <: Integer, V <: AbstractVector{T}, C <: AbstractVector{Bool}} = ColoredRootedTree{T, - V, - C} +const BicoloredRootedTree{T <: Integer, V <: AbstractVector{T}, + C <: AbstractVector{Bool}} = ColoredRootedTree{T, + V, + C} """ rootedtree(level_sequence, color_sequence) @@ -204,7 +205,7 @@ function Base.:(==)(t1::ColoredRootedTree, t2::ColoredRootedTree) root1_minus_root2 = first(t1.level_sequence) - first(t2.level_sequence) for (e1, c1, e2, c2) in zip(t1.level_sequence, t1.color_sequence, t2.level_sequence, - t2.color_sequence) + t2.color_sequence) v1 = e1 v2 = e2 + root1_minus_root2 (v1 == v2 && c1 == c2) || return false diff --git a/src/plot_recipes.jl b/src/plot_recipes.jl index 0210bb9b..09d9bdcf 100644 --- a/src/plot_recipes.jl +++ b/src/plot_recipes.jl @@ -72,8 +72,9 @@ function _plot_coordinates(t::AbstractRootedTree, x_child = x_children[idx] push!(x, nan, x_root, x_child) push!(y, nan, y_root, y_child) - x_recursive, y_recursive = _plot_coordinates(subtr[idx], - x_child, y_child, width / 3, height) + x_recursive, + y_recursive = _plot_coordinates(subtr[idx], + x_child, y_child, width / 3, height) append!(x, x_recursive) append!(y, y_recursive) end @@ -212,10 +213,11 @@ function _plot_coordinates(t::ColoredRootedTree, push!(x, [x_root, x_child]) push!(y, [y_root, y_child]) push!(colors, [color_root, colormap[first(subtr[idx].color_sequence)]]) - x_recursive, y_recursive, colors_recursive = _plot_coordinates(subtr[idx], - x_child, y_child, - width / 3, height, - colormap) + x_recursive, y_recursive, + colors_recursive = _plot_coordinates(subtr[idx], + x_child, y_child, + width / 3, height, + colormap) append!(x, x_recursive) append!(y, y_recursive) append!(colors, colors_recursive)