Skip to content

Commit

Permalink
Fix NumPy 1.24: np.float has expired
Browse files Browse the repository at this point in the history
  • Loading branch information
lucduron committed Feb 23, 2024
1 parent c2aea09 commit fe2aff3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyteltools/geom/Shapefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def write_shp_lines(output_filename, shape_type, lines, attribute_name):
if 10 < shape_type < 20 and poly.is_2d():
coords = np.hstack((coords, np.zeros((poly.nb_points(), 1))))
if shape_type > 10:
m = np.array(poly.m, dtype=np.float).reshape(coords.shape[0], 1)
m = np.array(poly.m, dtype=float).reshape(coords.shape[0], 1)
coords = np.hstack((coords, m))
if shape_type == shapefile.POLYLINE:
w.line([list(map(tuple, coords))])
Expand Down
4 changes: 2 additions & 2 deletions pyteltools/geom/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def to_multi(self, new_shapes, to_file, shape_type):
def to_multim(self, new_shapes, new_m, to_file, shape_type):
w = self._to_multi_init(to_file, shape_type)
for points, points_m, attributes in zip(new_shapes, new_m, self.attributes):
m = np.array(points_m, dtype=np.float).reshape(points.shape[0], 1)
m = np.array(points_m, dtype=float).reshape(points.shape[0], 1)
if points.shape[1] == 3:
points = np.delete(points, 2, 1) # remove Z array
coords = np.hstack((points, m))
Expand All @@ -797,7 +797,7 @@ def to_multim(self, new_shapes, new_m, to_file, shape_type):
def to_multiz(self, new_shapes, new_m, to_file, shape_type):
w = self._to_multi_init(to_file, shape_type)
for points, points_m, attributes in zip(new_shapes, new_m, self.attributes):
m = np.array(points_m, dtype=np.float).reshape(points.shape[0], 1)
m = np.array(points_m, dtype=float).reshape(points.shape[0], 1)
coords = np.hstack((points, m))
w.multipointz(list(map(tuple, coords)))
w.record(*attributes)
Expand Down

0 comments on commit fe2aff3

Please sign in to comment.