EcoJulia / Phylo.jl

Simple phylogenetic trees in Julia to work with Diversity.jl - https://github.com/EcoJulia/Diversity.jl
BSD 2-Clause "Simplified" License
33 stars 13 forks source link

Extraneous linebreaks in `show` methods #69

Closed jakobnissen closed 9 months ago

jakobnissen commented 2 years ago

This is quite minor, but it looks like most objects in this package prints an extra newline in their show methods, i.e. the methods use println. Best practise is to use print, since the Julia REPL automatically inserts a newline after each object.

For example, a vector of nodes is printed like:

julia> collect(nodeiter(tree))[1:2]
2-element Vector{LinkNode{OneRoot, String, Dict{String, Any}, LinkBranch{OneRoot, String, Dict{String, Any}, Float64}}}:
 LinkNode A, a tip of the tree with an incoming connection (branch 4).

 LinkNode B, a tip of the tree with an incoming connection (branch 3).

julia>
richardreeve commented 2 years ago

Thanks @jakobnissen - this seems like an easy fix. I remember there being a problem a few years ago that vectors of phylogenetic elements were just appearing as an infinitely long line of unreadable text, but I guess that got changed?

jakobnissen commented 2 years ago

Looks like it, yes.

richardreeve commented 9 months ago

Finally fixed!