From 3abf1e137fa124573081819196db6c4c959a9f2e Mon Sep 17 00:00:00 2001 From: Jan Petykiewicz Date: Tue, 30 Jul 2024 23:46:10 -0700 Subject: [PATCH] use asarray() in place of array(copy=False) --- adze/boundary.py | 4 ++-- adze/shapes.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/adze/boundary.py b/adze/boundary.py index 03ee744..73de8b2 100644 --- a/adze/boundary.py +++ b/adze/boundary.py @@ -23,8 +23,8 @@ def planes_from_boundary( Returns: List of planes, represented by (normal vector, signed distance to origin) tuples. ''' - vertices = numpy.array(vertices, copy=False) - afaces = [numpy.array(ff, copy=False) for ff in faces] + vertices = numpy.asarray(vertices) + afaces = [numpy.asarray(ff) for ff in faces] planes = [] for face in afaces: face_verts = vertices[face] diff --git a/adze/shapes.py b/adze/shapes.py index fd42c69..ef313c2 100644 --- a/adze/shapes.py +++ b/adze/shapes.py @@ -48,7 +48,7 @@ def build_box(box_corners: ArrayLike) -> poly_t: [6, 3, 4], ] - box_corners = numpy.array(box_corners, copy=False) + box_corners = numpy.asarray(box_corners) vertices = [ [box_corners[0, 0], box_corners[0, 1], box_corners[0, 2]], [box_corners[1, 0], box_corners[0, 1], box_corners[0, 2]], @@ -77,7 +77,7 @@ def planes_from_box(box_corners: ArrayLike) -> list[plane_t]: Returns: List of planes, facing inwards. ''' - box_corners = numpy.array(box_corners, copy=False) + box_corners = numpy.asarray(box_corners) faces = [ (( 0, 0, 1), -box_corners[0, 2]), (( 0, 0, -1), box_corners[1, 2]), @@ -100,7 +100,7 @@ def planes_from_tetrahedron(vertices: ArrayLike) -> list[plane_t]: Returns: List of planes, facing inwards. ''' - verts = numpy.array(vertices, dtype=float, copy=False) + verts = numpy.asarray(vertices, dtype=float) vset_inds = numpy.array(( [3, 1, 2, 1], [2, 0, 3, 2],