fastremap 1.17.0__cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 1.17.2__cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
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.
- fastremap/__init__.py +2 -0
- fastremap/fastremap.cpython-39-aarch64-linux-gnu.so +0 -0
- fastremap/fastremap.pyi +8 -1
- fastremap/fastremap.pyx +15 -6
- {fastremap-1.17.0.dist-info → fastremap-1.17.2.dist-info}/METADATA +1 -1
- fastremap-1.17.2.dist-info/RECORD +15 -0
- {fastremap-1.17.0.dist-info → fastremap-1.17.2.dist-info}/licenses/AUTHORS +1 -0
- fastremap-1.17.2.dist-info/pbr.json +1 -0
- fastremap-1.17.0.dist-info/RECORD +0 -15
- fastremap-1.17.0.dist-info/pbr.json +0 -1
- {fastremap-1.17.0.dist-info → fastremap-1.17.2.dist-info}/WHEEL +0 -0
- {fastremap-1.17.0.dist-info → fastremap-1.17.2.dist-info}/licenses/LICENSE +0 -0
- {fastremap-1.17.0.dist-info → fastremap-1.17.2.dist-info}/top_level.txt +0 -0
fastremap/__init__.py
CHANGED
@@ -2,6 +2,7 @@ from .fastremap import (
|
|
2
2
|
ascontiguousarray,
|
3
3
|
asfortranarray,
|
4
4
|
component_map,
|
5
|
+
fit_dtype,
|
5
6
|
foreground,
|
6
7
|
indices,
|
7
8
|
inverse_component_map,
|
@@ -26,6 +27,7 @@ __all__ = [
|
|
26
27
|
"ascontiguousarray",
|
27
28
|
"asfortranarray",
|
28
29
|
"component_map",
|
30
|
+
"fit_dtype",
|
29
31
|
"foreground",
|
30
32
|
"indices",
|
31
33
|
"inverse_component_map",
|
Binary file
|
fastremap/fastremap.pyi
CHANGED
@@ -441,6 +441,13 @@ def ascontiguousarray(arr: NDArray[Any]) -> NDArray[Any]:
|
|
441
441
|
"""
|
442
442
|
...
|
443
443
|
|
444
|
+
def fit_dtype(
|
445
|
+
dtype:DTypeLike,
|
446
|
+
value:Union[int, float, np.integer, np.unsignedinteger, np.complexfloating, np.floating],
|
447
|
+
exotics:bool = False,
|
448
|
+
) -> DTypeLike:
|
449
|
+
...
|
450
|
+
|
444
451
|
def minmax(
|
445
452
|
arr: NDArray[Any],
|
446
453
|
) -> tuple[Union[int, float, None], Union[int, float, None]]:
|
@@ -458,7 +465,7 @@ def pixel_pairs(labels: NDArray[Any]) -> int:
|
|
458
465
|
"""
|
459
466
|
...
|
460
467
|
|
461
|
-
def foreground(arr: NDArray[
|
468
|
+
def foreground(arr: NDArray[np.integer]) -> int:
|
462
469
|
"""Returns the number of non-zero voxels in an array."""
|
463
470
|
...
|
464
471
|
|
fastremap/fastremap.pyx
CHANGED
@@ -292,7 +292,7 @@ def refit(arr, value=None, increase_only=False, exotics=False):
|
|
292
292
|
else:
|
293
293
|
value = min_value
|
294
294
|
|
295
|
-
dtype =
|
295
|
+
dtype = fit_dtype(arr.dtype, value, exotics=exotics)
|
296
296
|
|
297
297
|
if increase_only and np.dtype(dtype).itemsize <= np.dtype(arr.dtype).itemsize:
|
298
298
|
return arr
|
@@ -300,7 +300,7 @@ def refit(arr, value=None, increase_only=False, exotics=False):
|
|
300
300
|
return arr
|
301
301
|
return arr.astype(dtype)
|
302
302
|
|
303
|
-
def
|
303
|
+
def fit_dtype(dtype, value, exotics=False):
|
304
304
|
"""
|
305
305
|
Find the smallest dtype of the
|
306
306
|
same kind that will fit a given value.
|
@@ -973,9 +973,18 @@ def _unique_via_shifted_array(labels, min_label=None, max_label=None, return_ind
|
|
973
973
|
if min_label is None or max_label is None:
|
974
974
|
min_label, max_label = minmax(labels)
|
975
975
|
|
976
|
-
labels
|
977
|
-
|
978
|
-
|
976
|
+
if labels.flags.writeable:
|
977
|
+
labels -= min_label
|
978
|
+
arr = labels
|
979
|
+
else:
|
980
|
+
arr = labels - min_label
|
981
|
+
|
982
|
+
uniq, idx, counts, inverse = _unique_via_array(arr, max_label - min_label + 1, return_index, return_inverse)
|
983
|
+
del arr
|
984
|
+
|
985
|
+
if labels.flags.writeable:
|
986
|
+
labels += min_label
|
987
|
+
|
979
988
|
uniq += min_label
|
980
989
|
return uniq, idx, counts, inverse
|
981
990
|
|
@@ -990,7 +999,7 @@ def _unique_via_renumber(labels, return_index=False, return_inverse=False):
|
|
990
999
|
uniq.sort()
|
991
1000
|
return uniq, idx, counts, inverse
|
992
1001
|
|
993
|
-
uniq, idx2 = np.unique(uniq, return_index=
|
1002
|
+
uniq, idx2 = np.unique(uniq, return_index=True)
|
994
1003
|
if idx is not None:
|
995
1004
|
idx = idx[idx2]
|
996
1005
|
if counts is not None:
|
@@ -0,0 +1,15 @@
|
|
1
|
+
fastremap/__init__.py,sha256=OgcsmS2SUE7W1fDcPQEQEba-zmOyZQ6ezZBnYglHTNc,814
|
2
|
+
fastremap/ipt.hpp,sha256=aTS5-ftA8r0vGhJ1T5lE2xZwKCE1oCzgTbbNgIfehhM,7907
|
3
|
+
fastremap/ska_flat_hash_map.hpp,sha256=eny2nkM5ME8SxYobjFgoypKjchpP1gLq8zI-S3EFYDw,61579
|
4
|
+
fastremap/fastremap.pyi,sha256=vsAuGtadHq0l9yxpZpjAnv0EPhIWytYLVWpISUwISrw,15087
|
5
|
+
fastremap/fastremap.pyx,sha256=q2jCUyzB3Un9glI1BBowkLnKTV-d98COsqBTJWGl9jU,45163
|
6
|
+
fastremap/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
fastremap/fastremap.cpython-39-aarch64-linux-gnu.so,sha256=YAO9nhRsgVkXAKPNIWQAm7Ev410iqvyxQFtBJ7_KQUk,29365384
|
8
|
+
fastremap/fastremap.pxd,sha256=lHTRtJC_SuDBuOGFtEx3zf7WTCAWuQ0oumwC9IdiuLk,3966
|
9
|
+
fastremap-1.17.2.dist-info/METADATA,sha256=6Y0U4bh3nuaTAIpQMkolhrg_fA0vI4djjF7-Q54gDFs,10294
|
10
|
+
fastremap-1.17.2.dist-info/RECORD,,
|
11
|
+
fastremap-1.17.2.dist-info/top_level.txt,sha256=D-q4-YJbbk7QpuU8fxH9rFQEjV_W6wpdruzTTDV4N5s,10
|
12
|
+
fastremap-1.17.2.dist-info/pbr.json,sha256=z-ahicM-bsw4Dwxh-QOB5RSgxodG7zN9H-J0_kKaSjc,47
|
13
|
+
fastremap-1.17.2.dist-info/WHEEL,sha256=E40XJ3Kqr2LLs8cXTJwKscwWQko6dRKCfXO_6R_FbDI,149
|
14
|
+
fastremap-1.17.2.dist-info/licenses/AUTHORS,sha256=Ws46nzS0P0zeAhwmIyTMrr02oD05yxM2KafJD07G5vQ,243
|
15
|
+
fastremap-1.17.2.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
@@ -0,0 +1 @@
|
|
1
|
+
{"git_version": "1fec0d5", "is_release": false}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
fastremap/ska_flat_hash_map.hpp,sha256=eny2nkM5ME8SxYobjFgoypKjchpP1gLq8zI-S3EFYDw,61579
|
2
|
-
fastremap/fastremap.pyi,sha256=BtOaLT8CMKu9dljUB_WnhZs97_e-NVZlExdOLrLcEaI,14897
|
3
|
-
fastremap/fastremap.pyx,sha256=12Ys8lgn_RHRwipHyrvbvR__qLJgse5X1IhFlkd_zjs,45047
|
4
|
-
fastremap/fastremap.cpython-39-aarch64-linux-gnu.so,sha256=7vHyHjJTt_4Q6moWBspBLeOAedJP4jyHv_HbIB9AjtA,29368288
|
5
|
-
fastremap/__init__.py,sha256=hB8qCFtoI0dJgCziFURiIjHLjuTjA2lU-HNNzcM0W-g,782
|
6
|
-
fastremap/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
fastremap/ipt.hpp,sha256=aTS5-ftA8r0vGhJ1T5lE2xZwKCE1oCzgTbbNgIfehhM,7907
|
8
|
-
fastremap/fastremap.pxd,sha256=lHTRtJC_SuDBuOGFtEx3zf7WTCAWuQ0oumwC9IdiuLk,3966
|
9
|
-
fastremap-1.17.0.dist-info/WHEEL,sha256=E40XJ3Kqr2LLs8cXTJwKscwWQko6dRKCfXO_6R_FbDI,149
|
10
|
-
fastremap-1.17.0.dist-info/top_level.txt,sha256=D-q4-YJbbk7QpuU8fxH9rFQEjV_W6wpdruzTTDV4N5s,10
|
11
|
-
fastremap-1.17.0.dist-info/RECORD,,
|
12
|
-
fastremap-1.17.0.dist-info/pbr.json,sha256=dR1UpQuiiTyrZ7Y1PMguAEXlAjPBXmHM_DXmzrK1gbY,47
|
13
|
-
fastremap-1.17.0.dist-info/METADATA,sha256=P86CEeEBDSz3Dj-at8iRQ4wies_I0m6FNlQKTyXJxpU,10294
|
14
|
-
fastremap-1.17.0.dist-info/licenses/AUTHORS,sha256=0qY4uhbaHN_67hMxvSqBeiQ6xhA_-u4dSDXlDdJ09Lk,181
|
15
|
-
fastremap-1.17.0.dist-info/licenses/LICENSE,sha256=46mU2C5kSwOnkqkw9XQAJlhBL2JAf1_uCD8lVcXyMRg,7652
|
@@ -1 +0,0 @@
|
|
1
|
-
{"git_version": "1b389a3", "is_release": false}
|
File without changes
|
File without changes
|
File without changes
|