<commit_before>
from .drawable import PointList, ApertureFlash
from .aperture import CircleAperture

class SVGRenderer:
    """
    SVG Renderer for Layer objects
    """

    def __init__(self, layer):
        self.layer = layer
        self.setup_canvas()

    def setup_canvas(self):
        self.min_x = 10000   # FIXME
        self.min_y = 10000   # FIXME
        self.max_x = 0
        self.max_y = 0

        self.vertical_padding = 50
        self.horizontal_padding = 50

        self.scale = 100

        for shape in self.layer.shapes:
            if isinstance(shape, PointList):
                for point in shape.points:
                    if point.x < self.min_x:
                        self.min_x = point.x
                    if point.x > self.max_x:
                        self.max_x = point.x
                    if point.y < self.min_y:
                        self.min_y = point.y
                    if point.y > self.max_y:
                        self.max_y = point.y
            elif isinstance(shape, ApertureFlash):
                if shape.point.x < self.min_x:
                    self.min_x = shape.point.x
                if shape.point.x > self.max_x:
                    self.max_x = shape.point.x
                if shape.point.y < self.min_y:<commit_msg>Fix hardcoded maxixum values for layer dimensions<commit_after>
import math
from .drawable import PointList, ApertureFlash
from .aperture import CircleAperture

class SVGRenderer:
    """
    SVG Renderer for Layer objects
    """

    def __init__(self, layer):
        self.layer = layer
        self.setup_canvas()

    def setup_canvas(self):
        self.min_x = math.inf
        self.min_y = math.inf
        self.max_x = 0
        self.max_y = 0

        self.vertical_padding = 50
        self.horizontal_padding = 50

        self.scale = 100

        for shape in self.layer.shapes:
            if isinstance(shape, PointList):
                for point in shape.points:
                    if point.x < self.min_x:
                        self.min_x = point.x
                    if point.x > self.max_x:
                        self.max_x = point.x
                    if point.y < self.min_y:
                        self.min_y = point.y
                    if point.y > self.max_y:
                        self.max_y = point.y
            elif isinstance(shape, ApertureFlash):
                if shape.point.x < self.min_x:
                    self.min_x = shape.point.x
                if shape.point.x > self.max_x:
                    self.max_x = shape.point.x
                if shape.point.y < self.min_y:
{'fraction_non_alphanumeric': 0.08021390374331551, 'fraction_numerical': 0.0106951871657754, 'mean_word_length': 1.2873362445414847, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '735536', 'n_tokens_mistral': 814, 'n_tokens_neox': 740, 'n_words': 181}