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.
Files changed (65) hide show
  1. {PartSegCore_compiled_backend-0.15.3/src/PartSegCore_compiled_backend.egg-info → PartSegCore_compiled_backend-0.15.4}/PKG-INFO +1 -1
  2. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_napari_mapping.pyx +4 -4
  3. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/version.py +2 -2
  4. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4/src/PartSegCore_compiled_backend.egg-info}/PKG-INFO +1 -1
  5. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_napari_mapping.py +13 -0
  6. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.github/workflows/wheels.yml +0 -0
  7. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.gitignore +0 -0
  8. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/.readthedocs.yaml +0 -0
  9. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/License.txt +0 -0
  10. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/MANIFEST.in +0 -0
  11. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/Readme.md +0 -0
  12. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/build_utils/build_libomp.sh +0 -0
  13. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/Makefile +0 -0
  14. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/calc_bounds.rst +0 -0
  15. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/conf.py +0 -0
  16. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/fast_unique.rst +0 -0
  17. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/index.rst +0 -0
  18. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/make.bat +0 -0
  19. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/napari_mapping.rst +0 -0
  20. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/docs/sprawl_utils.rst +0 -0
  21. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/data_util.py +0 -0
  22. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/performance_label_unique.ipynb +0 -0
  23. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/notebooks/performance_napari.ipynb +0 -0
  24. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/pyproject.toml +0 -0
  25. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/setup.cfg +0 -0
  26. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/setup.py +0 -0
  27. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/__init__.py +0 -0
  28. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_fast_unique.pyi +0 -0
  29. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/_fast_unique.pyx +0 -0
  30. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/calc_bounds.pyi +0 -0
  31. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/calc_bounds.pyx +0 -0
  32. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/color_image_cython.pyi +0 -0
  33. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/color_image_cython.pyx +0 -0
  34. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/fast_unique.py +0 -0
  35. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/__init__.py +0 -0
  36. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso.cpp +0 -0
  37. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso.h +0 -0
  38. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.pyi +0 -0
  39. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/mso_bind.pyx +0 -0
  40. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/multiscale_opening/my_queue.h +0 -0
  41. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/napari_mapping.py +0 -0
  42. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/__init__.py +0 -0
  43. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/distance_utils.pxd +0 -0
  44. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/euclidean_cython.pyi +0 -0
  45. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/euclidean_cython.pyx +0 -0
  46. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/find_split.py +0 -0
  47. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/find_split.pyi +0 -0
  48. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/fuzzy_distance.pyx +0 -0
  49. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/global_consts.h +0 -0
  50. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/my_queue.h +0 -0
  51. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/path_sprawl_cython.pyi +0 -0
  52. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/path_sprawl_cython.pyx +0 -0
  53. {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
  54. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/sprawl_utils.pyi +0 -0
  55. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/sprawl_utils/sprawl_utils.pyx +0 -0
  56. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend/utils.py +0 -0
  57. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/SOURCES.txt +0 -0
  58. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/dependency_links.txt +0 -0
  59. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/requires.txt +0 -0
  60. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/PartSegCore_compiled_backend.egg-info/top_level.txt +0 -0
  61. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_calc_bounds.py +0 -0
  62. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_coloring.py +0 -0
  63. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_fast_unique.py +0 -0
  64. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_sprawl_utils/__init__.py +0 -0
  65. {PartSegCore_compiled_backend-0.15.3 → PartSegCore_compiled_backend-0.15.4}/src/tests/test_sprawl_utils/test_euclidean.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PartSegCore_compiled_backend
3
- Version: 0.15.3
3
+ Version: 0.15.4
4
4
  Summary: PartSegCore compiled backend,
5
5
  Author-email: Grzegorz Bokota <g.bokota@cent.uw.edu.pl>
6
6
  License: BSD-3-Clause
@@ -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, label_types modulo, label_types to_zero, out_types_mod[:] out):
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) % modulo) + 1
38
+ out[i] = ((modulo + ((labels[i] - 1) % modulo)) % modulo) + 1
39
39
 
40
- def _zero_preserving_modulo_par(label_types[:] labels, label_types modulo, label_types to_zero, out_types_mod[:] out):
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):
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.15.3'
16
- __version_tuple__ = version_tuple = (0, 15, 3)
15
+ __version__ = version = '0.15.4'
16
+ __version_tuple__ = version_tuple = (0, 15, 4)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PartSegCore_compiled_backend
3
- Version: 0.15.3
3
+ Version: 0.15.4
4
4
  Summary: PartSegCore compiled backend,
5
5
  Author-email: Grzegorz Bokota <g.bokota@cent.uw.edu.pl>
6
6
  License: BSD-3-Clause
@@ -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):