Skip to content

Commit

Permalink
remove deprecated AbstractTrees calls (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExpandingMan authored Jun 1, 2022
1 parent 3d89dde commit 35216e8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Convex"
uuid = "f65535da-76fb-5f13-bab9-19810c17039a"
version = "0.15.1"
version = "0.15.2"

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

[compat]
AbstractTrees = "0.2, 0.3"
AbstractTrees = "0.2, 0.3, 0.4"
BenchmarkTools = "1"
ECOS = "1"
GLPK = "1"
Expand Down
19 changes: 8 additions & 11 deletions src/utilities/tree_print.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# This module is needed until AbstractTrees.jl#37 is fixed.
# (PR: https://github.com/Keno/AbstractTrees.jl/pull/38)
# because currently `print_tree` does not respect `maxdepth`.
# This just implements the changes in the above PR.
# This module originally existed for AbstractTrees.jl#37,
# but has since diverged from the functionality of
# AbstractTrees.print_tree. It is now a separate implementation
# of tree printing
# Code in this file is modified from AbstractTrees.jl
# See LICENSE for a copy of its MIT license.
module TreePrint

using AbstractTrees: printnode, treekind, IndexedTree, children
using AbstractTrees: children, printnode

# Printing
struct TreeCharSet
Expand Down Expand Up @@ -83,19 +83,16 @@ function _print_tree(
if withinds
printnode(nodebuf, tree, inds)
else
tree != roottree && isa(treekind(roottree), IndexedTree) ?
printnode(nodebuf, roottree[tree]) : printnode(nodebuf, tree)
printnode(nodebuf, tree)
end
str = String(take!(isa(nodebuf, IOContext) ? nodebuf.io : nodebuf))
for (i, line) in enumerate(split(str, '\n'))
i != 1 && print_prefix(io, depth, charset, active_levels)
println(io, line)
end
depth > maxdepth && return
c =
isa(treekind(roottree), IndexedTree) ? childindices(roottree, tree) :
children(roottree, tree)
if c !== ()
c = children(tree)
if !isempty(c)
width = 0
s = Iterators.Stateful(
from === nothing ? pairs(c) : Iterators.Rest(pairs(c), from),
Expand Down

2 comments on commit 35216e8

@ericphanson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/66006

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.15.2 -m "<description of version>" 35216e8e11ce7a0c30d2cc429bc4ba110bbe53ff
git push origin v0.15.2

Please sign in to comment.