PartSegCore-compiled-backend 0.15.3__tar.gz → 0.15.4__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.
- {PartSegCore_compiled_backend-0.15.3/src/PartSegCore_compiled_backend.egg-info → PartSegCore_compiled_backend-0.15.4}/PKG-INFO +1 -1
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_napari_mapping.pyx +4 -4
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/version.py +2 -2
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4/src/PartSegCore_compiled_backend.egg-info}/PKG-INFO +1 -1
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_napari_mapping.py +13 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.github/workflows/wheels.yml +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.gitignore +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.readthedocs.yaml +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/License.txt +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/MANIFEST.in +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/Readme.md +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/build_utils/build_libomp.sh +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/Makefile +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/calc_bounds.rst +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/conf.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/fast_unique.rst +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/index.rst +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/make.bat +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/napari_mapping.rst +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/sprawl_utils.rst +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/data_util.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/performance_label_unique.ipynb +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/performance_napari.ipynb +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/pyproject.toml +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/setup.cfg +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/setup.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/__init__.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_fast_unique.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_fast_unique.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/calc_bounds.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/calc_bounds.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/color_image_cython.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/color_image_cython.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/fast_unique.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/__init__.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso.cpp +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso.h +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/my_queue.h +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/napari_mapping.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/__init__.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/distance_utils.pxd +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/euclidean_cython.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/euclidean_cython.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/find_split.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/find_split.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/fuzzy_distance.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/global_consts.h +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/my_queue.h +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/path_sprawl_cython.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/path_sprawl_cython.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/put_borders_in_queue.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/sprawl_utils.pyi +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/sprawl_utils.pyx +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/utils.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/SOURCES.txt +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/dependency_links.txt +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/requires.txt +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/top_level.txt +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_calc_bounds.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_coloring.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_fast_unique.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_sprawl_utils/__init__.py +0 -0
- {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_sprawl_utils/test_euclidean.py +0 -0
|
@@ -28,23 +28,23 @@ ctypedef fused out_types:
|
|
|
28
28
|
out_types_mod
|
|
29
29
|
cnp.float32_t
|
|
30
30
|
|
|
31
|
-
def _zero_preserving_modulo_seq(label_types[:] labels,
|
|
31
|
+
def _zero_preserving_modulo_seq(label_types[:] labels, out_types_mod modulo, label_types to_zero, out_types_mod[:] out):
|
|
32
32
|
cdef Py_ssize_t i
|
|
33
33
|
cdef Py_ssize_t n = labels.shape[0]
|
|
34
34
|
for i in range(n):
|
|
35
35
|
if labels[i] == to_zero:
|
|
36
36
|
out[i] = 0
|
|
37
37
|
else:
|
|
38
|
-
out[i] = ((labels[i] - 1)
|
|
38
|
+
out[i] = ((modulo + ((labels[i] - 1) % modulo)) % modulo) + 1
|
|
39
39
|
|
|
40
|
-
def _zero_preserving_modulo_par(label_types[:] labels,
|
|
40
|
+
def _zero_preserving_modulo_par(label_types[:] labels, out_types_mod modulo, label_types to_zero, out_types_mod[:] out):
|
|
41
41
|
cdef Py_ssize_t i
|
|
42
42
|
cdef Py_ssize_t n = labels.shape[0]
|
|
43
43
|
for i in prange(n, nogil=True):
|
|
44
44
|
if labels[i] == to_zero:
|
|
45
45
|
out[i] = 0
|
|
46
46
|
else:
|
|
47
|
-
out[i] = ((labels[i] - 1) % modulo) + 1
|
|
47
|
+
out[i] = ((modulo + ((labels[i] - 1) % modulo)) % modulo) + 1
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
def _map_array_par(label_types[:] labels, dict dkt, out_types[:] out, out_types def_val=0):
|
|
@@ -37,6 +37,19 @@ def test_zero_preserving_modulo(func, data):
|
|
|
37
37
|
npt.assert_array_equal(out, _zero_preserving_modulo_numpy(data, 10, np.uint8, 0))
|
|
38
38
|
|
|
39
39
|
|
|
40
|
+
@pytest.mark.parametrize('func', [zero_preserving_modulo_parallel, zero_preserving_modulo_sequential])
|
|
41
|
+
@pytest.mark.parametrize('background_num', [0, 1, 2, -1])
|
|
42
|
+
def test_background_label(func, background_num):
|
|
43
|
+
data = np.zeros((10, 10), dtype=np.int32)
|
|
44
|
+
data[1:-1, 1:-1] = 1
|
|
45
|
+
data[2:-2, 2:-2] = 2
|
|
46
|
+
data[4:-4, 4:-4] = -1
|
|
47
|
+
|
|
48
|
+
res = func(data, 49, background_num)
|
|
49
|
+
np.testing.assert_array_equal(res == 0, data == background_num)
|
|
50
|
+
np.testing.assert_array_equal(res != 0, data != background_num)
|
|
51
|
+
|
|
52
|
+
|
|
40
53
|
@pytest.mark.parametrize('func', [map_array_parallel, map_array_sequential])
|
|
41
54
|
@pytest.mark.parametrize('data', DATA_LI, ids=DATA_IDS)
|
|
42
55
|
def test_map_array(func, data):
|
|
File without changes
|
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.readthedocs.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/calc_bounds.rst
RENAMED
|
File without changes
|
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/fast_unique.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/napari_mapping.rst
RENAMED
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/sprawl_utils.rst
RENAMED
|
File without changes
|
{PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/data_util.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|