etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
773 stars 216 forks source link

Fix floating numbers in (drawer.render_tree function) #662

Closed MohdFarag closed 1 year ago

MohdFarag commented 1 year ago

Solve Error:

t.render("phylotree.png", w=750) File "...\Programs\Python\Python310\lib\site-packages\ete3\coretype\tree.py", line 1392, in render return drawer.render_tree(self, file_name, w=w, h=h, File "...\Programs\Python\Python310\lib\site-packages\ete3\treeview\drawer.py", line 113, in render_tree x_scale, y_scale = save(scene, imgName, w=w, h=h, units=units, dpi=dpi) File "...\Programs\Python\Python310\lib\site-packages\ete3\treeview\main.py", line 754, in save ii.setDotsPerMeterX(dpi / 0.0254) # Convert inches to meters TypeError: setDotsPerMeterX(self, int): argument 1 has unexpected type 'float'1 has unexpected type 'float'

KennethVrb commented 1 year ago

would it not be better to fix the w and h variables after line 662. I have now come across the same issue and i believe thats where the problems start. The fact that dpi becomes a float as well is because of those two variables

jhcepas commented 1 year ago

should be fixed in 71d0d3b0f0d8e65a93af295a64a4860d2f79551c