Skip to content

Commit

Permalink
Merge pull request GUDHI#1055 from VincentRouvreau/numpy_2_compatibility
Browse files Browse the repository at this point in the history
Fix for numpy 2.X
  • Loading branch information
VincentRouvreau authored May 27, 2024
2 parents affcfac + 46c270f commit f15a418
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/python/gudhi/cubical_complex.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ cdef class CubicalComplex:
else:
raise ValueError("Must specify one of top_dimensional_cells, vertices, or perseus_file")
if dimensions is None:
array = np.array(array, copy=False, order='F')
array = np.asarray(array, order='F')
dimensions = array.shape
array = array.ravel(order='F')
self._construct_from_cells(dimensions, array, vertices is None)
Expand Down
2 changes: 1 addition & 1 deletion src/python/gudhi/off_utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def write_points_to_off_file(fname, points):
:param points: Point coordinates.
:type points: numpy array of shape (n, dim)
"""
points = np.array(points, copy=False)
points = np.asarray(points)
assert len(points.shape) == 2
dim = points.shape[1]
if dim == 3:
Expand Down
2 changes: 1 addition & 1 deletion src/python/gudhi/periodic_cubical_complex.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ cdef class PeriodicCubicalComplex:
else:
raise ValueError("Must specify one of top_dimensional_cells, vertices, or perseus_file")
if dimensions is None:
array = np.array(array, copy=False, order='F')
array = np.asarray(array, order='F')
dimensions = array.shape
array = array.ravel(order='F')
self._construct_from_cells(dimensions, array, periodic_dimensions, vertices is None)
Expand Down

0 comments on commit f15a418

Please sign in to comment.