Skip to content

Stop using deprecated/removed np.float/np.int #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 5.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion geomdl/visualization/VisMPL.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class VisConfig(vis.VisConfigAbstract):

def __init__(self, **kwargs):
super(VisConfig, self).__init__(**kwargs)
self.dtype = np.float
self.dtype = np.float64
self.display_ctrlpts = kwargs.get('ctrlpts', True)
self.display_evalpts = kwargs.get('evalpts', True)
self.display_bbox = kwargs.get('bbox', False)
Expand Down
2 changes: 1 addition & 1 deletion geomdl/visualization/VisPlotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class VisConfig(vis.VisConfigAbstract):
"""
def __init__(self, **kwargs):
super(VisConfig, self).__init__(**kwargs)
self.dtype = np.float
self.dtype = np.float64
# Set Plotly custom variables
self.figure_image_filename = "temp-plot.html"
self.use_renderer = kwargs.get("use_renderer", False)
Expand Down
26 changes: 13 additions & 13 deletions geomdl/visualization/VisVTK.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ def render(self, **kwargs):
# Plot control points
if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
# Points as spheres
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
# Handle 2-dimensional data
if pts.shape[1] == 2:
pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float)]
pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float64)]
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
actor1 = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand All @@ -148,10 +148,10 @@ def render(self, **kwargs):

# Plot evaluated points
if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
# Handle 2-dimensional data
if pts.shape[1] == 2:
pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float)]
pts = np.c_[pts, np.zeros(pts.shape[0], dtype=np.float64)]
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
actor1 = vtkh.create_actor_polygon(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand Down Expand Up @@ -200,14 +200,14 @@ def render(self, **kwargs):
vertices = [v.data for v in plot['ptsarr'][0]]
faces = [q.data for q in plot['ptsarr'][1]]
# Points as spheres
pts = np.array(vertices, dtype=np.float)
pts = np.array(vertices, dtype=np.float64)
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
actor1 = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
name=plot['name'], index=plot['idx'])
vtk_actors.append(actor1)
# Quad mesh
lines = np.array(faces, dtype=np.int)
lines = np.array(faces, dtype=int)
actor2 = vtkh.create_actor_mesh(pts=vtkpts, lines=lines, color=vtkh.create_color(plot['color']),
name=plot['name'], index=plot['idx'], size=self.vconf.line_width)
vtk_actors.append(actor2)
Expand All @@ -218,15 +218,15 @@ def render(self, **kwargs):
vtkpts = numpy_to_vtk(vertices, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
faces = [t.data for t in plot['ptsarr'][1]]
tris = np.array(faces, dtype=np.int)
tris = np.array(faces, dtype=int)
actor1 = vtkh.create_actor_tri(pts=vtkpts, tris=tris, color=vtkh.create_color(plot['color']),
name=plot['name'], index=plot['idx'])
vtk_actors.append(actor1)

# Plot trim curves
if self.vconf.display_trims:
if plot['type'] == 'trimcurve':
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
actor1 = vtkh.create_actor_polygon(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand Down Expand Up @@ -269,7 +269,7 @@ def render(self, **kwargs):
# Plot control points
if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
# Points as spheres
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand All @@ -278,7 +278,7 @@ def render(self, **kwargs):

# Plot evaluated points
if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand Down Expand Up @@ -321,7 +321,7 @@ def render(self, **kwargs):
# Plot control points
if plot['type'] == 'ctrlpts' and self.vconf.display_ctrlpts:
# Points as spheres
pts = np.array(plot['ptsarr'], dtype=np.float)
pts = np.array(plot['ptsarr'], dtype=np.float64)
vtkpts = numpy_to_vtk(pts, deep=False, array_type=VTK_FLOAT)
vtkpts.SetName(plot['name'])
temp_actor = vtkh.create_actor_pts(pts=vtkpts, color=vtkh.create_color(plot['color']),
Expand All @@ -330,8 +330,8 @@ def render(self, **kwargs):

# Plot evaluated points
if plot['type'] == 'evalpts' and self.vconf.display_evalpts:
faces = np.array(plot['ptsarr'][1], dtype=np.float)
filled = np.array(plot['ptsarr'][2], dtype=np.int)
faces = np.array(plot['ptsarr'][1], dtype=np.float64)
filled = np.array(plot['ptsarr'][2], dtype=int)
grid_filled = faces[filled == 1]
temp_actor = vtkh.create_actor_hexahedron(grid=grid_filled, color=vtkh.create_color(plot['color']),
name=plot['name'], index=plot['idx'])
Expand Down