eaton-lab / toytree

A minimalist tree plotting library using toyplot graphs
http://eaton-lab.org/toytree
BSD 3-Clause "New" or "Revised" License
169 stars 28 forks source link

`set_tip_labels` should cast to str() imho #34

Closed isaacovercast closed 4 years ago

isaacovercast commented 4 years ago

Right now if you call draw with set_tip_labels and a list of floats it does this:

~/toytree/toytree/Drawing.py in <listcomp>(.0)
    896             return
    897 
--> 898         lname = max([len(i) for i in self.tip_labels])
    899         if self.style.layout in ("r", "l"):
    900             # height fit by tree size

TypeError: object of type 'numpy.float64' has no len()

This seems like a reasonable thing to want to do. Is it possible to cast the input tip labels to str inside the draw() command to allow this?

eaton-lab commented 4 years ago

Totally agree, .get_tip_labels() should cast to st. This is now fixed in the v.2.0 (newmark branch) coming v. soon.