-
Notifications
You must be signed in to change notification settings - Fork 8
Closed
Description
Hi team,
Wondering if we can discuss the behaviour of https://github.com/alyst/SpatialIndexing.jl/blob/master/src/rtree/show.jl
Specifically: the last line of the show() function, when we have large trees (200k+ nodes) and using this interactively, i have to remember to always suppress the output and never print the object in the REPL, or otherwise it will flood the REPL and i basically have to restart the julia session.
function Base.show(io::IO, tree::RTree)
print(io, typeof(tree))
print(io, "(variant="); print(io, tree.variant)
print(io, ", tight_mbrs="); print(io, tree.tight_mbrs)
print(io, ", nearmin_overlap="); print(io, tree.nearmin_overlap)
print(io, ", fill_factor="); print(io, tree.fill_factor)
print(io, ", split_factor="); print(io, tree.split_factor)
print(io, ", reinsert_factor="); print(io, tree.reinsert_factor)
print(io, ", leaf_capacity="); print(io, capacity(Leaf, tree))
print(io, ", branch_capacity="); print(io, capacity(Branch, tree)); println(io, ")")
print(io, length(tree)); print(io, " element(s) in "); print(io, height(tree));
print(io, " level(s) ("); print(io, join(reverse(tree.nnodes_perlevel), ", ")); println(io, " node(s) per level):")
# this line which recursively prints every branch/node
_show(io, tree.root, recurse=true, indent=1) end
Can we consider having changing this to print(io::IO, tree::RTree)
and having show(io::IO, tree::RTree)
without the final recursion call?
That will make working with the RTree interactively much easier, as users can control when they want to print the full tree.
Metadata
Metadata
Assignees
Labels
No labels