Skip to content

Commit

Permalink
Revert "loose the limit"
Browse files Browse the repository at this point in the history
This reverts commit bbc63f8.

The commit was introduced by mistake, but the reason is sound: ete
complains a lot when the tree is big.

We may do this change, but maybe better when running, if it produces
an exception, catch it and warn/ask the user and change the recursion
limit then.
  • Loading branch information
jordibc committed Dec 10, 2024
1 parent bbc63f8 commit bf32525
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions ete4/smartview/renderer/faces.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
from ..utils import InvalidUsage, get_random_string
from .draw_helpers import *
from copy import deepcopy
import sys
sys.setrecursionlimit(10000) # Adjust the value as needed

CHAR_HEIGHT = 1.4 # char's height to width ratio

ALLOWED_IMG_EXTENSIONS = [ "png", "svg", "jpeg" ]
Expand Down Expand Up @@ -135,7 +134,6 @@ def compute_bounding_box(self,

self._check_own_content()
x, y = point

dx, dy = size

zx, zy, za = drawer.zoom
Expand Down Expand Up @@ -168,7 +166,6 @@ def compute_bounding_box(self,
avail_dy = dy / n_row
aligned_x = drawer.node_size(drawer.tree)[0]\
if drawer.panel == 0 else drawer.xmin

x = aligned_x + dx_before

if pos == 'aligned_bottom':
Expand All @@ -192,10 +189,6 @@ def compute_bounding_box(self,
max(avail_dx - 2 * padding_x, 0) if avail_dx else None,
max(avail_dy - 2 * padding_y, 0))

# if self.name =="Scale_Face":
# print("Scale_Face")
# print("dx_before", dx_before)
# print(x + padding_x)
return self._box

def fits(self):
Expand Down Expand Up @@ -1467,7 +1460,7 @@ def __init__(self, name='', width=None, color='black',

Face.__init__(self, name=name,
padding_x=padding_x, padding_y=padding_y)
self.name = "Scale_Face"

self.width = width
self.height = None
self.range = scale_range
Expand Down Expand Up @@ -1499,7 +1492,7 @@ def compute_bounding_box(self,

if drawer.TYPE == 'circ' and abs(point[1]) >= pi/2:
pos = swap_pos(pos)

box = super().compute_bounding_box(
drawer,
point, size,
Expand All @@ -1511,7 +1504,6 @@ def compute_bounding_box(self,
dx_before, dy_before)

x, y, _, dy = box

zx, zy = self.zoom

self.viewport = (drawer.viewport.x, drawer.viewport.x + drawer.viewport.dx)
Expand All @@ -1524,7 +1516,6 @@ def compute_bounding_box(self,
y = y + dy - height

self._box = Box(x, y, self.width / zx, height)

return self._box

def draw(self, drawer):
Expand All @@ -1533,7 +1524,6 @@ def draw(self, drawer):

p1 = (x0, y + dy - 5 / zy)
p2 = (x0 + self.width, y + dy - self.vt_line_height / (2 * zy))

if drawer.TYPE == 'circ':
p1 = cartesian(p1)
p2 = cartesian(p2)
Expand All @@ -1542,7 +1532,6 @@ def draw(self, drawer):


nticks = round((self.width * zx) / self.tick_width)

dx = self.width / nticks
range_factor = (self.range[1] - self.range[0]) / self.width

Expand Down

0 comments on commit bf32525

Please sign in to comment.