Printing

Trees, forests, and diagnostic reports have two display forms: a compact one-line show (used inline, e.g. in a Vector or @show) and a detailed multi-line text/plain summary (used at the REPL / notebook top level).

using H2Trees

m = meshsphere(1.0, 0.1)
tree = TwoNTree(vertices(m); builder=TwoNTreeBuilder(; minhalfsize=0.1, minvalues=0))

sprint(show, tree)  # compact: type, nodes, leaves, level range, root
"TwoNTree{3,Float64}(nodes=510, leaves=360, levels=1:5, root=1)"
tree  # text/plain: one row per level, with node/value/child counts and a tree-specific metric
TwoNTree{3,Float64}
level   nodes         avg values    avg children  halfsize      
1       1             1610.0        8.0           1.6           
2       8             201.25        4.0           0.8           
3       32            50.31         3.41          0.4           
4       109           14.77         3.3           0.2           
5       360           4.47          0.0           0.1           

The per-level metric is halfsize for box trees (TwoNTree) and radius for ball trees (KMeansTree, BoundingBallTree).

Forests

A Forest follows the same pattern: a compact one-liner (tree/node/leaf counts, level range), or the detailed form listing every component tree — see Forest.

forest              # detailed: one summary line per component tree
sprint(show, forest) # compact

Diagnostic reports

H2Trees.AdmissibilityReport has its own text/plain show, listing ok, error/warning counts, and every finding with its geometric gap where relevant — see Admissibility Diagnostics for reading one.