Пример #1
0
def test_basic(
    pair: BoundPortedRingManagersPair, points_pair: BoundPortedPointsPair,
    operation_kinds_pair: BoundPortedOperationKindsPair,
    subject_fill_kinds_pair: BoundPortedFillKindsPair,
    clip_fill_kinds_pair: BoundPortedFillKindsPair,
    active_bounds_pair_indices_pair: Tuple[BoundPortedBoundsListsPair,
                                           Tuple[int, int]]
) -> None:
    bound, ported = pair
    bound_point, ported_point = points_pair
    bound_operation_kind, ported_operation_kind = operation_kinds_pair
    bound_subject_fill_kind, ported_subject_fill_kind = subject_fill_kinds_pair
    bound_clip_fill_kind, ported_clip_fill_kind = clip_fill_kinds_pair
    ((bound_active_bounds, ported_active_bounds),
     (first_index, second_index)) = active_bounds_pair_indices_pair
    ported_first_bound = ported_active_bounds[first_index]
    ported_second_bound = ported_active_bounds[second_index]

    bound_active_bounds = bound.intersect_bounds(
        bound_point, bound_operation_kind, bound_subject_fill_kind,
        bound_clip_fill_kind, first_index, second_index, bound_active_bounds)
    ported.intersect_bounds(ported_point, ported_operation_kind,
                            ported_subject_fill_kind, ported_clip_fill_kind,
                            ported_first_bound, ported_second_bound,
                            ported_active_bounds)

    assert are_bound_ported_bounds_equal(bound_active_bounds[first_index],
                                         ported_first_bound)
    assert are_bound_ported_bounds_equal(bound_active_bounds[second_index],
                                         ported_second_bound)
    assert are_bound_ported_bounds_lists_equal(bound_active_bounds,
                                               ported_active_bounds)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #2
0
def test_basic(pair: BoundPortedBoundsPair) -> None:
    bound, ported = pair

    bound.fix_horizontals()
    ported.fix_horizontals()

    assert are_bound_ported_bounds_equal(bound, ported)
Пример #3
0
def test_basic(pair: BoundPortedBoundsPair,
               scanbeams: List[Coordinate]) -> None:
    bound, ported = pair
    bound_scanbeams, ported_scanbeams = scanbeams, scanbeams[:]

    bound_scanbeams = bound.to_next_edge(bound_scanbeams)
    ported.to_next_edge(ported_scanbeams)

    assert bound_scanbeams == ported_scanbeams
    assert are_bound_ported_bounds_equal(bound, ported)
Пример #4
0
def test_basic(pair: BoundPortedRingManagersPair,
               bounds_pair: BoundPortedBoundsPair,
               points_pair: BoundPortedPointsPair) -> None:
    bound, ported = pair
    bound_bound, ported_bound = bounds_pair
    bound_point, ported_point = points_pair

    ported.add_point_to_ring(ported_bound, ported_point)
    bound.add_point_to_ring(bound_bound, bound_point)

    assert are_bound_ported_bounds_equal(bound_bound, ported_bound)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #5
0
def test_basic(pair: BoundPortedRingManagersPair,
               active_bounds_pair_indices_pair
               : Tuple[BoundPortedBoundsListsPair, Tuple[int, int]]) -> None:
    bound, ported = pair
    ((bound_active_bounds, ported_active_bounds),
     (first_index, second_index)) = active_bounds_pair_indices_pair
    ported_first_bound = ported_active_bounds[first_index]
    ported_second_bound = ported_active_bounds[second_index]

    bound_active_bounds = bound.append_ring(first_index, second_index,
                                            bound_active_bounds)
    ported.append_ring(ported_first_bound, ported_second_bound,
                       ported_active_bounds)

    assert are_bound_ported_bounds_equal(bound_active_bounds[first_index],
                                         ported_first_bound)
    assert are_bound_ported_bounds_equal(bound_active_bounds[second_index],
                                         ported_second_bound)
    assert are_bound_ported_bounds_lists_equal(bound_active_bounds,
                                               ported_active_bounds)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #6
0
def test_basic(pair: BoundPortedRingManagersPair,
               bounds_pair: BoundPortedBoundsPair,
               end_points_pair: BoundPortedPointsPair,
               add_end_point: bool) -> None:
    bound, ported = pair
    bound_bound, ported_bound = bounds_pair
    bound_end_point, ported_end_point = end_points_pair

    bound.insert_hot_pixels_in_path(bound_bound, bound_end_point,
                                    add_end_point)
    ported.insert_hot_pixels_in_path(ported_bound, ported_end_point,
                                     add_end_point)

    assert are_bound_ported_bounds_equal(bound_bound, ported_bound)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #7
0
def test_basic(pair: BoundPortedRingManagersPair,
               active_bounds_pair_index: Tuple[BoundPortedBoundsListsPair, int]
               ) -> None:
    bound, ported = pair
    ((bound_active_bounds, ported_active_bounds),
     index) = active_bounds_pair_index
    ported_bound = ported_active_bounds[index]

    bound_active_bounds = bound.set_hole_state(index, bound_active_bounds)
    ported.set_hole_state(ported_bound, ported_active_bounds)

    assert are_bound_ported_bounds_equal(bound_active_bounds[index],
                                         ported_bound)
    assert are_bound_ported_bounds_lists_equal(bound_active_bounds,
                                               ported_active_bounds)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #8
0
def test_basic(pair: BoundPortedRingManagersPair,
               active_bounds_pair_index: Tuple[BoundPortedBoundsListsPair,
                                               int],
               points_pair: BoundPortedPointsPair) -> None:
    bound, ported = pair
    ((bound_active_bounds, ported_active_bounds),
     index) = active_bounds_pair_index
    bound_point, ported_point = points_pair
    ported_bound = ported_active_bounds[index]

    bound_active_bounds = bound.add_point(index, bound_active_bounds,
                                          bound_point)
    ported.add_point(ported_bound, ported_active_bounds, ported_point)

    assert are_bound_ported_bounds_equal(bound_active_bounds[index],
                                         ported_bound)
    assert are_bound_ported_bounds_lists_equal(bound_active_bounds,
                                               ported_active_bounds)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #9
0
def test_basic(pair_start_stop: Tuple[BoundPortedRingManagersPair,
                                      Tuple[int, int]], y: Coordinate,
               start_x_end_x: Tuple[Coordinate, Coordinate],
               bounds_pair: BoundPortedBoundsPair,
               add_end_point: bool) -> None:
    (bound, ported), (start, stop) = pair_start_stop
    start_x, end_x = start_x_end_x
    bound_bound, ported_bound = bounds_pair

    bound_result = bound.hot_pixel_set_left_to_right(y, start_x, end_x,
                                                     bound_bound, start, stop,
                                                     add_end_point)
    ported_result = ported.hot_pixel_set_left_to_right(y, start_x, end_x,
                                                       ported_bound, start,
                                                       stop, add_end_point)

    assert bound_result == ported_result
    assert are_bound_ported_bounds_equal(bound_bound, ported_bound)
    assert are_bound_ported_ring_managers_equal(bound, ported)
Пример #10
0
def test_basic(edges_lists_pair: BoundPortedEdgesListsPair) -> None:
    bound_edges, ported_edges = edges_lists_pair

    assert are_bound_ported_bounds_equal(bound(bound_edges),
                                         ported(ported_edges))