numpy.array(..., copy=False) -> numpy.asarray(...)
For numpy 2.0
This commit is contained in:
parent
8fd6896a71
commit
ad0adec8e8
2 changed files with 13 additions and 13 deletions
|
|
@ -38,8 +38,8 @@ def maxrects_bssf(
|
|||
Raises:
|
||||
MasqueError if `allow_rejects` is `True` but some `rects` could not be placed.
|
||||
"""
|
||||
regions = numpy.array(containers, copy=False, dtype=float)
|
||||
rect_sizes = numpy.array(rects, copy=False, dtype=float)
|
||||
regions = numpy.asarray(containers, dtype=float)
|
||||
rect_sizes = numpy.asarray(rects, dtype=float)
|
||||
rect_locs = numpy.zeros_like(rect_sizes)
|
||||
rejected_inds = set()
|
||||
|
||||
|
|
@ -139,8 +139,8 @@ def guillotine_bssf_sas(
|
|||
Raises:
|
||||
MasqueError if `allow_rejects` is `True` but some `rects` could not be placed.
|
||||
"""
|
||||
regions = numpy.array(containers, copy=False, dtype=float)
|
||||
rect_sizes = numpy.array(rects, copy=False, dtype=float)
|
||||
regions = numpy.asarray(containers, dtype=float)
|
||||
rect_sizes = numpy.asarray(rects, dtype=float)
|
||||
rect_locs = numpy.zeros_like(rect_sizes)
|
||||
rejected_inds = set()
|
||||
|
||||
|
|
@ -227,7 +227,7 @@ def pack_patterns(
|
|||
MasqueError if `allow_rejects` is `True` but some `rects` could not be placed.
|
||||
"""
|
||||
|
||||
half_spacing = numpy.array(spacing, copy=False, dtype=float) / 2
|
||||
half_spacing = numpy.asarray(spacing, dtype=float) / 2
|
||||
|
||||
bounds = [library[pp].get_bounds() for pp in patterns]
|
||||
sizes = [bb[1] - bb[0] + spacing if bb is not None else spacing for bb in bounds]
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ def poly_contains_points(
|
|||
Returns:
|
||||
ndarray of booleans, [point0_is_in_shape, point1_is_in_shape, ...]
|
||||
"""
|
||||
points = numpy.array(points, copy=False)
|
||||
vertices = numpy.array(vertices, copy=False)
|
||||
points = numpy.asarray(points, dtype=float)
|
||||
vertices = numpy.asarray(vertices, dtype=float)
|
||||
|
||||
if points.size == 0:
|
||||
return numpy.zeros(0, dtype=numpy.int8)
|
||||
|
|
|
|||
Loading…
Reference in a new issue