gridpoints 1.0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gridpoints
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: fast multidimensional sorting tool for point clouds using the monotonic lagrangian grid
5
5
  Author: Armand de Cacqueray
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "gridpoints"
7
- version = "1.0.1"
7
+ version = "1.0.2"
8
8
  description = "fast multidimensional sorting tool for point clouds using the monotonic lagrangian grid "
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -7,4 +7,4 @@ __all__ = (
7
7
  print_zoom,
8
8
  )
9
9
 
10
- __version__ = "1.0.1"
10
+ __version__ = "1.0.2"
@@ -61,7 +61,10 @@ def show_result(X, animate=False):
61
61
  print("Missing dependencies for the demo. pip install gridsort[demo]")
62
62
  from squarenet import SquareNet
63
63
  import numpy as np
64
- X = np.asarray(X)
64
+ try:
65
+ X = np.asarray(X)
66
+ except:
67
+ print("Array still on GPU, move it back to gpu first befor showing e.g. show_result(X.cpu())")
65
68
  sn = SquareNet(gridshape = X.shape[:-1])
66
69
  sn.pointsmaped = X
67
70
  sn.plot(style = "mesh", animate = animate, save = animate)
@@ -83,7 +86,10 @@ def print_zoom(Ygrid, center, side=1):
83
86
  Number of cells shown on each side of the center.
84
87
  """
85
88
  import numpy as np
86
- Ygrid = np.asarray(Ygrid)
89
+ try:
90
+ Ygrid = np.asarray(Ygrid)
91
+ except:
92
+ print("Array still on GPU, move it back to gpu first befor showing e.g. print_zoom(X.cpu())")
87
93
  ndim = Ygrid.ndim - 1
88
94
  if ndim not in (2, 3):
89
95
  raise ValueError("printzoom only for 2D/3D grids")
@@ -8,4 +8,4 @@ __all__ = (
8
8
  "invert_permutation",
9
9
  )
10
10
 
11
- __version__ = "1.0.1"
11
+ __version__ = "1.0.2"
@@ -43,9 +43,12 @@ def astype(X, dtype_str, reference_array=None):
43
43
 
44
44
 
45
45
  def inplace_sort(X, axis):
46
- _, backend_name = get_backend(X)
46
+ xp, backend_name = get_backend(X)
47
47
  if backend_name == 'torch':
48
48
  X.copy_(X.sort(dim=axis)[0])
49
+ if backend_name == "cupy":
50
+ X[...] = xp.ascontiguousarray(X)
51
+ X.sort(axis=axis)
49
52
  else:
50
53
  X.sort(axis=axis)
51
54
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gridpoints
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: fast multidimensional sorting tool for point clouds using the monotonic lagrangian grid
5
5
  Author: Armand de Cacqueray
6
6
  License: MIT
File without changes
File without changes
File without changes