Skip to content

Commit 35216e8

Browse files
authored
remove deprecated AbstractTrees calls (#494)
1 parent 3d89dde commit 35216e8

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Convex"
22
uuid = "f65535da-76fb-5f13-bab9-19810c17039a"
3-
version = "0.15.1"
3+
version = "0.15.2"
44

55
[deps]
66
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
@@ -13,7 +13,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1313
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1414

1515
[compat]
16-
AbstractTrees = "0.2, 0.3"
16+
AbstractTrees = "0.2, 0.3, 0.4"
1717
BenchmarkTools = "1"
1818
ECOS = "1"
1919
GLPK = "1"

src/utilities/tree_print.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# This module is needed until AbstractTrees.jl#37 is fixed.
2-
# (PR: https://github.com/Keno/AbstractTrees.jl/pull/38)
3-
# because currently `print_tree` does not respect `maxdepth`.
4-
# This just implements the changes in the above PR.
1+
# This module originally existed for AbstractTrees.jl#37,
2+
# but has since diverged from the functionality of
3+
# AbstractTrees.print_tree. It is now a separate implementation
4+
# of tree printing
55
# Code in this file is modified from AbstractTrees.jl
66
# See LICENSE for a copy of its MIT license.
77
module TreePrint
88

9-
using AbstractTrees: printnode, treekind, IndexedTree, children
9+
using AbstractTrees: children, printnode
1010

1111
# Printing
1212
struct TreeCharSet
@@ -83,19 +83,16 @@ function _print_tree(
8383
if withinds
8484
printnode(nodebuf, tree, inds)
8585
else
86-
tree != roottree && isa(treekind(roottree), IndexedTree) ?
87-
printnode(nodebuf, roottree[tree]) : printnode(nodebuf, tree)
86+
printnode(nodebuf, tree)
8887
end
8988
str = String(take!(isa(nodebuf, IOContext) ? nodebuf.io : nodebuf))
9089
for (i, line) in enumerate(split(str, '\n'))
9190
i != 1 && print_prefix(io, depth, charset, active_levels)
9291
println(io, line)
9392
end
9493
depth > maxdepth && return
95-
c =
96-
isa(treekind(roottree), IndexedTree) ? childindices(roottree, tree) :
97-
children(roottree, tree)
98-
if c !== ()
94+
c = children(tree)
95+
if !isempty(c)
9996
width = 0
10097
s = Iterators.Stateful(
10198
from === nothing ? pairs(c) : Iterators.Rest(pairs(c), from),

0 commit comments

Comments
 (0)