You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
coordinates_1d=np.linspace(0, boxsize_1d, 2*nsamples_1d+1)[1::2] # in the middle of the parts along each dimension, with no shift to make things easier here
61
+
labels_1d=np.arange(nsamples_1d) # obvious regions along each axis
62
+
coordinates_alt= [np.ravel(_) for_innp.meshgrid(coordinates_1d, coordinates_1d, coordinates_1d, indexing='ij')] # arrays of all 3D coordinate combinations taken from `coordinates_1d`
63
+
labels_3d= [np.ravel(_) for_innp.meshgrid(labels_1d, labels_1d, labels_1d, indexing='ij')] # arrays of all 3D index combinations taken from `labels_1d`, same order as the coordinates
64
+
labels_alt=sum(_*nsamples_1d**ifor (i, _) inenumerate(labels_3d[::-1])) # more explicit conversion to the multi-dimensional index
65
+
assertnp.max(labels_alt) ==nsamples-1
66
+
subsampler2=BoxSubsampler(boxsize=boxsize, boxcenter=boxsize/2, nsamples=nsamples) # subsampler without shift
0 commit comments