From 93882ca471c903d00879931e4e95bb5d128ed276 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Fri, 12 May 2023 13:50:33 +0900 Subject: [PATCH 1/2] MAINT: fix non integer shape --- examples/mayavi/mlab/simple_structured_grid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mayavi/mlab/simple_structured_grid.py b/examples/mayavi/mlab/simple_structured_grid.py index 9866aa1e9..e86466892 100644 --- a/examples/mayavi/mlab/simple_structured_grid.py +++ b/examples/mayavi/mlab/simple_structured_grid.py @@ -43,10 +43,10 @@ # We reorder the points, scalars and vectors so this is as per VTK's # requirement of x first, y next and z last. pts = pts.transpose(2, 1, 0, 3).copy() -pts.shape = pts.size / 3, 3 +pts.shape = int(pts.size / 3), 3 scalars = scalars.T.copy() vectors = vectors.transpose(2, 1, 0, 3).copy() -vectors.shape = vectors.size / 3, 3 +vectors.shape = int(vectors.size / 3), 3 # Create the dataset. sg = tvtk.StructuredGrid(dimensions=x.shape, points=pts) From e6f315366879c7e26b47516febb1f7e03924e853 Mon Sep 17 00:00:00 2001 From: Prabhu Ramachandran Date: Thu, 23 May 2024 22:49:49 +0530 Subject: [PATCH 2/2] Update simple_structured_grid.py Make suggested fixes. --- examples/mayavi/mlab/simple_structured_grid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mayavi/mlab/simple_structured_grid.py b/examples/mayavi/mlab/simple_structured_grid.py index e86466892..c5d047082 100644 --- a/examples/mayavi/mlab/simple_structured_grid.py +++ b/examples/mayavi/mlab/simple_structured_grid.py @@ -43,10 +43,10 @@ # We reorder the points, scalars and vectors so this is as per VTK's # requirement of x first, y next and z last. pts = pts.transpose(2, 1, 0, 3).copy() -pts.shape = int(pts.size / 3), 3 +pts.shape = pts.size // 3, 3 scalars = scalars.T.copy() vectors = vectors.transpose(2, 1, 0, 3).copy() -vectors.shape = int(vectors.size / 3), 3 +vectors.shape = vectors.size // 3, 3 # Create the dataset. sg = tvtk.StructuredGrid(dimensions=x.shape, points=pts)