dcnum 0.25.8__py3-none-any.whl → 0.25.10__py3-none-any.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.
Potentially problematic release.
This version of dcnum might be problematic. Click here for more details.
- dcnum/_version.py +2 -2
- dcnum/feat/feat_background/base.py +5 -2
- dcnum/segm/segm_torch/segm_torch_base.py +11 -4
- {dcnum-0.25.8.dist-info → dcnum-0.25.10.dist-info}/METADATA +1 -1
- {dcnum-0.25.8.dist-info → dcnum-0.25.10.dist-info}/RECORD +8 -8
- {dcnum-0.25.8.dist-info → dcnum-0.25.10.dist-info}/WHEEL +1 -1
- {dcnum-0.25.8.dist-info → dcnum-0.25.10.dist-info}/licenses/LICENSE +0 -0
- {dcnum-0.25.8.dist-info → dcnum-0.25.10.dist-info}/top_level.txt +0 -0
dcnum/_version.py
CHANGED
|
@@ -9,7 +9,7 @@ import time
|
|
|
9
9
|
import h5py
|
|
10
10
|
|
|
11
11
|
from ...meta import ppid
|
|
12
|
-
from ...read import HDF5Data
|
|
12
|
+
from ...read import HDF5Data, md5sum
|
|
13
13
|
from ...write import HDF5Writer, create_with_basins, set_default_filter_kwargs
|
|
14
14
|
|
|
15
15
|
|
|
@@ -87,6 +87,9 @@ class Background(abc.ABC):
|
|
|
87
87
|
|
|
88
88
|
# Check whether user passed an array or a path
|
|
89
89
|
if isinstance(input_data, pathlib.Path):
|
|
90
|
+
# Compute MD5 sum before opening the file so that we don't
|
|
91
|
+
# get a file-locking issue (PermissionError) on Windows.
|
|
92
|
+
md5_5m = md5sum(input_data, blocksize=65536, count=80)
|
|
90
93
|
if str(input_data.resolve()) == str(output_path.resolve()):
|
|
91
94
|
self.h5in = h5py.File(input_data, "a", libver="latest")
|
|
92
95
|
self.h5out = self.h5in
|
|
@@ -98,7 +101,7 @@ class Background(abc.ABC):
|
|
|
98
101
|
# the ImageCache. We have to go via the ImageCache route,
|
|
99
102
|
# because HDF5Data properly resolves basins and the image
|
|
100
103
|
# feature might be in a basin.
|
|
101
|
-
self.hdin = HDF5Data(self.h5in)
|
|
104
|
+
self.hdin = HDF5Data(self.h5in, md5_5m=md5_5m)
|
|
102
105
|
self.input_data = self.hdin.image.h5ds
|
|
103
106
|
else:
|
|
104
107
|
self.input_data = input_data
|
|
@@ -3,6 +3,8 @@ import pathlib
|
|
|
3
3
|
import re
|
|
4
4
|
from typing import Dict
|
|
5
5
|
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
6
8
|
from ...meta import paths
|
|
7
9
|
|
|
8
10
|
from ..segmenter import Segmenter, SegmenterNotApplicableError
|
|
@@ -116,10 +118,15 @@ class TorchSegmenterBase(Segmenter):
|
|
|
116
118
|
"""
|
|
117
119
|
key = item["key"]
|
|
118
120
|
if key in data_dict:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
valid = True
|
|
122
|
+
if "regexp" in item:
|
|
123
|
+
re_match = bool(re.search(item["regexp"], data_dict[key],
|
|
124
|
+
re.MULTILINE))
|
|
125
|
+
negate = item.get("regexp-negate", False)
|
|
126
|
+
valid = valid and (re_match if not negate else not re_match)
|
|
127
|
+
if "value" in item:
|
|
128
|
+
valid = valid and np.allclose(item["value"], data_dict[key],
|
|
129
|
+
atol=0, rtol=0.01)
|
|
123
130
|
if not valid:
|
|
124
131
|
reasons_list.append(item.get("reason", "unknown reason"))
|
|
125
132
|
elif not item.get("allow-missing-key", False):
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
dcnum/__init__.py,sha256=p0mYg01FQ6nsERYmx_FfVxqqHvYcSMEyIAMBIivAmO8,1206
|
|
2
|
-
dcnum/_version.py,sha256=
|
|
2
|
+
dcnum/_version.py,sha256=2u4bWaMdcZXyf4_yxgykEAXNXcEaVQumowHKcuxLJUI,515
|
|
3
3
|
dcnum/os_env_st.py,sha256=4psq-gPuWTTQ118kCiTx0Mhoyads4Irn6JSUzZk8gyc,3052
|
|
4
4
|
dcnum/feat/__init__.py,sha256=jUJYWTD3VIoDNKrmryXbjHb1rGwYtK4b7VPWihYgUoo,325
|
|
5
5
|
dcnum/feat/event_extractor_manager_thread.py,sha256=6D3RVYBuH7gOoGZ4Kz74n6fhq7MtlTY26kpSwZRqg3M,7972
|
|
6
6
|
dcnum/feat/gate.py,sha256=EOleB83sOlBjc8bjaZfWwGuxfCcEO5mknuFunlw_j7o,7252
|
|
7
7
|
dcnum/feat/queue_event_extractor.py,sha256=s-sC7Inkly_HYbqT3OPB6zWRvKm4TNOewujt1EuZF4M,16183
|
|
8
8
|
dcnum/feat/feat_background/__init__.py,sha256=OTmMuazHNaSrZb2XW4cnJ6PlgJLbKrPbaidpEixYa0A,341
|
|
9
|
-
dcnum/feat/feat_background/base.py,sha256=
|
|
9
|
+
dcnum/feat/feat_background/base.py,sha256=pWxMCBg2NbO6uGMPl3b-Ia1eXlfHNFsNG5JjWqAFZKI,8979
|
|
10
10
|
dcnum/feat/feat_background/bg_copy.py,sha256=Xfju4DqbrtPyaUf3x-ybrWci5ip_cEbeiEg7Jh56YIY,1182
|
|
11
11
|
dcnum/feat/feat_background/bg_roll_median.py,sha256=rb3JnFzm4aXVLMKdP9wJlRXwTwmKUz2R1RBS9GXPepg,13622
|
|
12
12
|
dcnum/feat/feat_background/bg_sparse_median.py,sha256=PbcTehk46b9l03ZA1mBdyeMPHmGgGN4-59eLy2TzwX8,22634
|
|
@@ -41,7 +41,7 @@ dcnum/segm/segmenter_manager_thread.py,sha256=vMZFBa18oO8OyVB3niy_mtEfKkGOWHEga4
|
|
|
41
41
|
dcnum/segm/segmenter_mpo.py,sha256=O6G4xzHKNMSmyX9HDXTfl-3f9Fk2filxvVrRIO2D9hg,14117
|
|
42
42
|
dcnum/segm/segmenter_sto.py,sha256=C55orEAZtMowNwtAT_WdSv46n5CzgLFuGq9kwdHc97I,3963
|
|
43
43
|
dcnum/segm/segm_torch/__init__.py,sha256=DtUqJTbj7ybrTbXlwHq1Y4SCzi22rMW9Cus6wX-iU-A,822
|
|
44
|
-
dcnum/segm/segm_torch/segm_torch_base.py,sha256=
|
|
44
|
+
dcnum/segm/segm_torch/segm_torch_base.py,sha256=wPt5QAmBDQxAA3Zxrdj3l9di0nIQmlUmKVJWtEpahH8,4814
|
|
45
45
|
dcnum/segm/segm_torch/segm_torch_mpo.py,sha256=GOva6o-6_SppxWD4BeBB3ap1TR-6rIYHavtfIstaYvc,2643
|
|
46
46
|
dcnum/segm/segm_torch/segm_torch_sto.py,sha256=PTOJrP_FkaxZZul8lM4VA2HL3KyxrheDDWWdJbmJdiw,3393
|
|
47
47
|
dcnum/segm/segm_torch/torch_model.py,sha256=5aL6SwSvg1N2gATEGBhP3aA4WTHlvGzQVYuizmh0LrU,3187
|
|
@@ -51,8 +51,8 @@ dcnum/write/__init__.py,sha256=sK79IlvCFIqf2oFABVeyYedMnHOsEIQpxAauEeNO-Tw,273
|
|
|
51
51
|
dcnum/write/deque_writer_thread.py,sha256=ao7F1yrVKyufgC4rC0Y2_Vt7snuT6KpI7W2qVxcjdhk,1994
|
|
52
52
|
dcnum/write/queue_collector_thread.py,sha256=-p5vrk9cDhtaIMFIu_cCmvlZJafrFkW68uONonMURYo,11617
|
|
53
53
|
dcnum/write/writer.py,sha256=JkVb4KDBV3oo9r3p2yy9wECO1REx7FG0PRBmVWTxJdk,20577
|
|
54
|
-
dcnum-0.25.
|
|
55
|
-
dcnum-0.25.
|
|
56
|
-
dcnum-0.25.
|
|
57
|
-
dcnum-0.25.
|
|
58
|
-
dcnum-0.25.
|
|
54
|
+
dcnum-0.25.10.dist-info/licenses/LICENSE,sha256=rX7tNSxP-EhLz-yYUyoBGwjJheA2fiZpT1Iw0LXnJ2M,1069
|
|
55
|
+
dcnum-0.25.10.dist-info/METADATA,sha256=twT_YXAb4Xxt24EKrjxEg8-4UgkHDHYOfzS-prFCXTM,2355
|
|
56
|
+
dcnum-0.25.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
57
|
+
dcnum-0.25.10.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
|
|
58
|
+
dcnum-0.25.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|