61f037c3ab9dd7df522134b3048cebcf3f62e43f,skimage/draw/_random_shapes.py,,_generate_triangle_mask,#,122

Before Change


    available_side = min(image[1] - point[1], point[0] + 1, shape[1])
    if available_side < shape[0]:
        raise ArithmeticError("cannot fit shape to image")
    side = random.randint(shape[0], available_side + 1)
    triangle_height = int(np.ceil(np.sqrt(3 / 4.0) * side))
    triangle = draw_polygon([
        point[0],
        point[0] - triangle_height,

After Change


        raise ValueError("dimension must be > 1 for triangles")
    available_side = min(image[1] - point[1], point[0],
                         shape[1]) - shape[0]
    side = shape[0] + random.randint(max(1, available_side)) - 1
    triangle_height = int(np.ceil(np.sqrt(3 / 4.0) * side))
    triangle = draw_polygon([
        point[0],
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: scikit-image/scikit-image
Commit Name: 61f037c3ab9dd7df522134b3048cebcf3f62e43f
Time: 2020-10-28
Author: rfezzani@gmail.com
File Name: skimage/draw/_random_shapes.py
Class Name:
Method Name: _generate_triangle_mask


Project Name: scikit-image/scikit-image
Commit Name: 61f037c3ab9dd7df522134b3048cebcf3f62e43f
Time: 2020-10-28
Author: rfezzani@gmail.com
File Name: skimage/draw/_random_shapes.py
Class Name:
Method Name: _generate_circle_mask


Project Name: scikit-image/scikit-image
Commit Name: 61f037c3ab9dd7df522134b3048cebcf3f62e43f
Time: 2020-10-28
Author: rfezzani@gmail.com
File Name: skimage/draw/_random_shapes.py
Class Name:
Method Name: _generate_rectangle_mask