dcnum 0.25.5__py3-none-any.whl → 0.25.7__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 +9 -4
- dcnum/feat/event_extractor_manager_thread.py +29 -14
- dcnum/feat/feat_background/base.py +19 -11
- dcnum/feat/feat_background/bg_copy.py +4 -0
- dcnum/feat/feat_background/bg_roll_median.py +24 -15
- dcnum/feat/feat_background/bg_sparse_median.py +32 -17
- dcnum/feat/feat_contour/volume.py +2 -2
- dcnum/feat/gate.py +11 -11
- dcnum/feat/queue_event_extractor.py +39 -20
- dcnum/logic/ctrl.py +5 -4
- dcnum/logic/job.py +3 -1
- dcnum/logic/json_encoder.py +9 -0
- dcnum/meta/paths.py +1 -0
- dcnum/meta/ppid.py +4 -2
- dcnum/os_env_st.py +2 -2
- dcnum/read/cache.py +3 -1
- dcnum/read/const.py +5 -2
- dcnum/read/detect_flicker.py +1 -1
- dcnum/segm/segm_torch/segm_torch_base.py +3 -2
- dcnum/segm/segm_torch/torch_postproc.py +1 -0
- dcnum/segm/segm_torch/torch_preproc.py +1 -0
- dcnum/segm/segmenter.py +31 -20
- dcnum/segm/segmenter_manager_thread.py +19 -12
- dcnum/segm/segmenter_mpo.py +4 -4
- dcnum/segm/segmenter_sto.py +2 -2
- dcnum/write/queue_collector_thread.py +35 -18
- dcnum/write/writer.py +4 -3
- {dcnum-0.25.5.dist-info → dcnum-0.25.7.dist-info}/METADATA +1 -1
- dcnum-0.25.7.dist-info/RECORD +57 -0
- {dcnum-0.25.5.dist-info → dcnum-0.25.7.dist-info}/WHEEL +1 -1
- dcnum-0.25.5.dist-info/RECORD +0 -57
- {dcnum-0.25.5.dist-info → dcnum-0.25.7.dist-info}/LICENSE +0 -0
- {dcnum-0.25.5.dist-info → dcnum-0.25.7.dist-info}/top_level.txt +0 -0
dcnum/meta/paths.py
CHANGED
dcnum/meta/ppid.py
CHANGED
|
@@ -9,9 +9,11 @@ import warnings
|
|
|
9
9
|
|
|
10
10
|
import numpy as np
|
|
11
11
|
|
|
12
|
-
#: Increment this string if there are breaking changes that make
|
|
13
|
-
#: previous pipelines unreproducible.
|
|
14
12
|
DCNUM_PPID_GENERATION = "11"
|
|
13
|
+
"""The dcnum pipeline generation.
|
|
14
|
+
Increment this string if there are breaking changes that make
|
|
15
|
+
previous pipelines unreproducible.
|
|
16
|
+
"""
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
class ClassWithPPIDCapabilities(Protocol):
|
dcnum/os_env_st.py
CHANGED
|
@@ -4,7 +4,6 @@ import os
|
|
|
4
4
|
|
|
5
5
|
logger = logging.getLogger(__name__)
|
|
6
6
|
|
|
7
|
-
#: environment variables that set number of threads
|
|
8
7
|
os_env_threading = [
|
|
9
8
|
"MKL_NUM_THREADS",
|
|
10
9
|
"NUMBA_NUM_THREADS",
|
|
@@ -14,13 +13,14 @@ os_env_threading = [
|
|
|
14
13
|
"OPENBLAS_NUM_THREADS",
|
|
15
14
|
"VECLIB_MAXIMUM_THREADS",
|
|
16
15
|
]
|
|
16
|
+
"""environment variables that define number of threads libraries will use"""
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class RequestSingleThreaded:
|
|
20
20
|
"""Context manager for starting a process with specific environment
|
|
21
21
|
|
|
22
22
|
When entering the context, the environment variables defined in
|
|
23
|
-
|
|
23
|
+
``os_env_threading`` are all set to "1", telling the relevant libraries
|
|
24
24
|
that they should work in single-threaded mode.
|
|
25
25
|
When exiting the context, these environment variables are reset to
|
|
26
26
|
their original values (or unset if applicable).
|
dcnum/read/cache.py
CHANGED
|
@@ -25,8 +25,10 @@ class BaseImageChunkCache(abc.ABC):
|
|
|
25
25
|
self._dtype = None
|
|
26
26
|
chunk_size = min(shape[0], chunk_size)
|
|
27
27
|
self._len = self.shape[0]
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
self.cache = collections.OrderedDict()
|
|
30
|
+
"""This is a FILO cache for the chunks"""
|
|
31
|
+
|
|
30
32
|
self.image_shape = self.shape[1:]
|
|
31
33
|
self.chunk_shape = (chunk_size,) + self.shape[1:]
|
|
32
34
|
self.chunk_size = chunk_size
|
dcnum/read/const.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
#: Scalar features that apply to all events in a frame and which are
|
|
2
|
-
#: not computed for individual events.
|
|
3
1
|
PROTECTED_FEATURES = [
|
|
4
2
|
"bg_off",
|
|
5
3
|
"flow_rate",
|
|
@@ -10,6 +8,11 @@ PROTECTED_FEATURES = [
|
|
|
10
8
|
"temp_amb",
|
|
11
9
|
"time",
|
|
12
10
|
]
|
|
11
|
+
"""Frame-defined scalar features.
|
|
12
|
+
Scalar features that apply to all events in a frame and which are
|
|
13
|
+
not computed for individual events
|
|
14
|
+
"""
|
|
15
|
+
|
|
13
16
|
|
|
14
17
|
# User-defined features may be anything, but if the user needs something
|
|
15
18
|
# very specific for the pipeline, having them protected is a nice feature.
|
dcnum/read/detect_flicker.py
CHANGED
|
@@ -17,7 +17,7 @@ def detect_flickering(image_data: np.ndarray | HDF5Data,
|
|
|
17
17
|
triggering signal.
|
|
18
18
|
|
|
19
19
|
If flickering is detected, you should use the "sparsemed" background
|
|
20
|
-
computation with
|
|
20
|
+
computation with ``offset_correction`` set to True.
|
|
21
21
|
|
|
22
22
|
Parameters
|
|
23
23
|
----------
|
|
@@ -52,9 +52,10 @@ class TorchSegmenterBase(Segmenter):
|
|
|
52
52
|
segmenter_kwargs: dict
|
|
53
53
|
Keyword arguments for the segmenter
|
|
54
54
|
meta: dict
|
|
55
|
-
Dictionary of metadata from an :class
|
|
55
|
+
Dictionary of metadata from an :class:`.hdf5_data.HDF5Data`
|
|
56
|
+
instance
|
|
56
57
|
logs: dict
|
|
57
|
-
Dictionary of logs from an :class
|
|
58
|
+
Dictionary of logs from an :class:`.hdf5_data.HDF5Data` instance
|
|
58
59
|
|
|
59
60
|
Returns
|
|
60
61
|
-------
|
|
@@ -11,6 +11,7 @@ def postprocess_masks(masks,
|
|
|
11
11
|
"""Postprocess mask images from ML segmenters
|
|
12
12
|
|
|
13
13
|
The transformation includes:
|
|
14
|
+
|
|
14
15
|
- Revert the cropping and padding operations done in
|
|
15
16
|
:func:`.preprocess_images` by padding with zeros and cropping.
|
|
16
17
|
- If the original image shape is larger than the mask image shape,
|
|
@@ -11,6 +11,7 @@ def preprocess_images(images: np.ndarray,
|
|
|
11
11
|
"""Transform image data to something torch models expect
|
|
12
12
|
|
|
13
13
|
The transformation includes:
|
|
14
|
+
|
|
14
15
|
- normalization (division by 255, subtraction of mean, division by std)
|
|
15
16
|
- cropping and padding of the input images to `image_shape`. For padding,
|
|
16
17
|
the median of each *individual* image is used.
|
dcnum/segm/segmenter.py
CHANGED
|
@@ -26,17 +26,23 @@ class SegmenterNotApplicableError(BaseException):
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class Segmenter(abc.ABC):
|
|
29
|
-
#: Required hardware ("cpu" or "gpu") defined in first-level subclass.
|
|
30
29
|
hardware_processor = "none"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#: have to call `process_mask` in your `segment_algorithm` implementation.
|
|
30
|
+
"""Required hardware ("cpu" or "gpu") defined in first-level subclass."""
|
|
31
|
+
|
|
34
32
|
mask_postprocessing = True
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
"""Whether to enable mask post-processing.
|
|
34
|
+
If disabled, you should make sure that your mask is properly defined
|
|
35
|
+
and cleaned or you have to call `process_mask` in your
|
|
36
|
+
``segment_algorithm`` implementation.
|
|
37
|
+
"""
|
|
38
|
+
|
|
37
39
|
mask_default_kwargs = {}
|
|
38
|
-
|
|
40
|
+
"""Default keyword arguments for mask post-processing.
|
|
41
|
+
See `process_mask` for available options.
|
|
42
|
+
"""
|
|
43
|
+
|
|
39
44
|
requires_background_correction = False
|
|
45
|
+
"""Whether the segmenter requires a background-corrected image"""
|
|
40
46
|
|
|
41
47
|
def __init__(self,
|
|
42
48
|
*,
|
|
@@ -46,10 +52,11 @@ class Segmenter(abc.ABC):
|
|
|
46
52
|
"""Base segmenter class
|
|
47
53
|
|
|
48
54
|
This is the base segmenter class for the multiprocessing operation
|
|
49
|
-
segmenter :class:`.MPOSegmenter` (multiple
|
|
50
|
-
and each of them works on a queue of images)
|
|
51
|
-
|
|
52
|
-
segmentation on
|
|
55
|
+
segmenter :class:`.segmenter_mpo.MPOSegmenter` (multiple
|
|
56
|
+
subprocesses are spawned and each of them works on a queue of images)
|
|
57
|
+
and the single-threaded operation segmenter
|
|
58
|
+
:class:`.segmenter_sto.STOSegmenter` (e.g. for batch segmentation on
|
|
59
|
+
a GPU).
|
|
53
60
|
|
|
54
61
|
Parameters
|
|
55
62
|
----------
|
|
@@ -64,12 +71,15 @@ class Segmenter(abc.ABC):
|
|
|
64
71
|
self.logger = logging.getLogger(__name__).getChild(
|
|
65
72
|
self.__class__.__name__)
|
|
66
73
|
spec = inspect.getfullargspec(self.segment_algorithm)
|
|
67
|
-
|
|
74
|
+
|
|
68
75
|
self.kwargs = spec.kwonlydefaults or {}
|
|
76
|
+
"""custom keyword arguments for the subclassing segmenter"""
|
|
77
|
+
|
|
69
78
|
self.kwargs.update(kwargs)
|
|
70
79
|
|
|
71
|
-
#: keyword arguments for mask post-processing
|
|
72
80
|
self.kwargs_mask = {}
|
|
81
|
+
"""keyword arguments for mask post-processing"""
|
|
82
|
+
|
|
73
83
|
if self.mask_postprocessing:
|
|
74
84
|
spec_mask = inspect.getfullargspec(self.process_mask)
|
|
75
85
|
self.kwargs_mask.update(spec_mask.kwonlydefaults or {})
|
|
@@ -108,7 +118,7 @@ class Segmenter(abc.ABC):
|
|
|
108
118
|
KEY:KW_APPROACH:KW_MASK
|
|
109
119
|
|
|
110
120
|
Where KEY is e.g. "legacy" or "watershed", and KW_APPROACH is a
|
|
111
|
-
list of keyword arguments for
|
|
121
|
+
list of keyword arguments for ``segment_algorithm``, e.g.::
|
|
112
122
|
|
|
113
123
|
thresh=-6^blur=0
|
|
114
124
|
|
|
@@ -296,10 +306,10 @@ class Segmenter(abc.ABC):
|
|
|
296
306
|
|
|
297
307
|
@functools.cache
|
|
298
308
|
def segment_algorithm_wrapper(self):
|
|
299
|
-
"""Wraps
|
|
309
|
+
"""Wraps ``self.segment_algorithm`` to only accept an image
|
|
300
310
|
|
|
301
|
-
The static method
|
|
302
|
-
keyword arguments
|
|
311
|
+
The static method ``self.segment_algorithm`` may optionally accept
|
|
312
|
+
keyword arguments ``self.kwargs``. This wrapper returns the
|
|
303
313
|
wrapped method that only accepts the image as an argument. This
|
|
304
314
|
makes sense if you want to unify
|
|
305
315
|
"""
|
|
@@ -336,7 +346,7 @@ class Segmenter(abc.ABC):
|
|
|
336
346
|
additional background offset values that should be subtracted
|
|
337
347
|
from the image data before segmentation. Should only be
|
|
338
348
|
used in combination with segmenters that have
|
|
339
|
-
|
|
349
|
+
``requires_background_correction`` set to True.
|
|
340
350
|
"""
|
|
341
351
|
images = image_data.get_chunk(chunk)
|
|
342
352
|
if bg_off is not None:
|
|
@@ -364,9 +374,10 @@ class Segmenter(abc.ABC):
|
|
|
364
374
|
segmenter_kwargs: dict
|
|
365
375
|
Keyword arguments for the segmenter
|
|
366
376
|
meta: dict
|
|
367
|
-
Dictionary of metadata from an :class
|
|
377
|
+
Dictionary of metadata from an :class:`.hdf5_data.HDF5Data`
|
|
378
|
+
instance
|
|
368
379
|
logs: dict
|
|
369
|
-
Dictionary of logs from an :class
|
|
380
|
+
Dictionary of logs from an :class:`.hdf5_data.HDF5Data` instance
|
|
370
381
|
|
|
371
382
|
Returns
|
|
372
383
|
-------
|
|
@@ -36,8 +36,8 @@ class SegmenterManagerThread(threading.Thread):
|
|
|
36
36
|
its job for a slot, the slot value will be set to "e" (for
|
|
37
37
|
"task is with feature extractor").
|
|
38
38
|
slot_chunks:
|
|
39
|
-
For each slot in
|
|
40
|
-
on which chunk in
|
|
39
|
+
For each slot in ``slot_states``, this shared array defines
|
|
40
|
+
on which chunk in ``image_data`` the segmentation took place.
|
|
41
41
|
bg_off:
|
|
42
42
|
1d array containing additional background image offset values
|
|
43
43
|
that are added to each background image before subtraction
|
|
@@ -45,10 +45,10 @@ class SegmenterManagerThread(threading.Thread):
|
|
|
45
45
|
|
|
46
46
|
Notes
|
|
47
47
|
-----
|
|
48
|
-
This manager keeps a list
|
|
49
|
-
slots just like
|
|
48
|
+
This manager keeps a list ``labels_list`` which enumerates the
|
|
49
|
+
slots just like ``slot_states` and ``slot_chunks`` do. For each
|
|
50
50
|
slot, this list contains the labeled image data (integer-valued)
|
|
51
|
-
for the input
|
|
51
|
+
for the input ``image_data`` chunks.
|
|
52
52
|
|
|
53
53
|
The working principle of this `SegmenterManagerThread` allows
|
|
54
54
|
the user to define a fixed number of slots on which the segmenter
|
|
@@ -61,21 +61,28 @@ class SegmenterManagerThread(threading.Thread):
|
|
|
61
61
|
super(SegmenterManagerThread, self).__init__(
|
|
62
62
|
name="SegmenterManager", *args, **kwargs)
|
|
63
63
|
self.logger = logging.getLogger("dcnum.segm.SegmenterManagerThread")
|
|
64
|
-
|
|
64
|
+
|
|
65
65
|
self.segmenter = segmenter
|
|
66
|
-
|
|
66
|
+
"""Segmenter instance"""
|
|
67
|
+
|
|
67
68
|
self.image_data = image_data
|
|
68
|
-
|
|
69
|
+
"""Image data which is being segmented"""
|
|
70
|
+
|
|
69
71
|
self.bg_off = (
|
|
70
72
|
bg_off if self.segmenter.requires_background_correction else None)
|
|
71
|
-
|
|
73
|
+
"""Additional, optional background offset"""
|
|
74
|
+
|
|
72
75
|
self.slot_states = slot_states
|
|
73
|
-
|
|
76
|
+
"""Slot states"""
|
|
77
|
+
|
|
74
78
|
self.slot_chunks = slot_chunks
|
|
75
|
-
|
|
79
|
+
"""Current slot chunk index for the slot states"""
|
|
80
|
+
|
|
76
81
|
self.labels_list = [None] * len(self.slot_states)
|
|
77
|
-
|
|
82
|
+
"""List containing the segmented labels of each slot"""
|
|
83
|
+
|
|
78
84
|
self.t_count = 0
|
|
85
|
+
"""Time counter for segmentation"""
|
|
79
86
|
|
|
80
87
|
def run(self):
|
|
81
88
|
num_slots = len(self.slot_states)
|
dcnum/segm/segmenter_mpo.py
CHANGED
|
@@ -35,7 +35,7 @@ class MPOSegmenter(Segmenter, abc.ABC):
|
|
|
35
35
|
debug: bool
|
|
36
36
|
Debugging parameters
|
|
37
37
|
kwargs:
|
|
38
|
-
Additional, optional keyword arguments for
|
|
38
|
+
Additional, optional keyword arguments for ``segment_algorithm``
|
|
39
39
|
defined in the subclass.
|
|
40
40
|
"""
|
|
41
41
|
super(MPOSegmenter, self).__init__(kwargs_mask=kwargs_mask,
|
|
@@ -145,7 +145,7 @@ class MPOSegmenter(Segmenter, abc.ABC):
|
|
|
145
145
|
"""Perform batch segmentation of `images`
|
|
146
146
|
|
|
147
147
|
Before segmentation, an optional background offset correction with
|
|
148
|
-
|
|
148
|
+
``bg_off`` is performed. After segmentation, mask postprocessing is
|
|
149
149
|
performed according to the class definition.
|
|
150
150
|
|
|
151
151
|
Parameters
|
|
@@ -264,7 +264,7 @@ class MPOSegmenter(Segmenter, abc.ABC):
|
|
|
264
264
|
"""Return the integer label image for an input image
|
|
265
265
|
|
|
266
266
|
Before segmentation, an optional background offset correction with
|
|
267
|
-
|
|
267
|
+
``bg_off`` is performed. After segmentation, mask postprocessing is
|
|
268
268
|
performed according to the class definition.
|
|
269
269
|
"""
|
|
270
270
|
segm_wrap = self.segment_algorithm_wrapper()
|
|
@@ -296,7 +296,7 @@ class MPOSegmenterWorker:
|
|
|
296
296
|
|
|
297
297
|
Parameters
|
|
298
298
|
----------
|
|
299
|
-
segmenter: MPOSegmenter
|
|
299
|
+
segmenter: .segmenter_mpo.MPOSegmenter
|
|
300
300
|
The segmentation instance
|
|
301
301
|
sl_start: int
|
|
302
302
|
Start of slice of input array to process
|
dcnum/segm/segmenter_sto.py
CHANGED
|
@@ -27,7 +27,7 @@ class STOSegmenter(Segmenter, abc.ABC):
|
|
|
27
27
|
debug: bool
|
|
28
28
|
Debugging parameters
|
|
29
29
|
kwargs:
|
|
30
|
-
Additional, optional keyword arguments for
|
|
30
|
+
Additional, optional keyword arguments for ``segment_algorithm``
|
|
31
31
|
defined in the subclass.
|
|
32
32
|
"""
|
|
33
33
|
if num_workers not in [None, 1]:
|
|
@@ -46,7 +46,7 @@ class STOSegmenter(Segmenter, abc.ABC):
|
|
|
46
46
|
"""Perform batch segmentation of `images`
|
|
47
47
|
|
|
48
48
|
Before segmentation, an optional background offset correction with
|
|
49
|
-
|
|
49
|
+
``bg_off`` is performed. After segmentation, mask postprocessing is
|
|
50
50
|
performed according to the class definition.
|
|
51
51
|
|
|
52
52
|
Parameters
|
|
@@ -26,23 +26,31 @@ class EventStash:
|
|
|
26
26
|
List that defines how many events there are for each input
|
|
27
27
|
frame. If summed up, this defines `self.size`.
|
|
28
28
|
"""
|
|
29
|
-
#: Dictionary containing the event arrays
|
|
30
29
|
self.events = {}
|
|
31
|
-
|
|
30
|
+
"""Dictionary containing the event arrays"""
|
|
31
|
+
|
|
32
32
|
self.feat_nevents = feat_nevents
|
|
33
|
-
|
|
33
|
+
"""List containing the number of events per input frame"""
|
|
34
|
+
|
|
34
35
|
self.nev_idx = np.cumsum(feat_nevents)
|
|
35
|
-
|
|
36
|
+
"""Cumulative sum of `feat_nevents` for determining sorting offsets"""
|
|
37
|
+
|
|
36
38
|
self.size = int(np.sum(feat_nevents))
|
|
37
|
-
|
|
39
|
+
"""Number of events in this stash"""
|
|
40
|
+
|
|
38
41
|
self.num_frames = len(feat_nevents)
|
|
39
|
-
|
|
42
|
+
"""Number of frames in this stash"""
|
|
43
|
+
|
|
40
44
|
self.index_offset = index_offset
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
"""Global offset compared to the original data instance."""
|
|
46
|
+
|
|
43
47
|
self.indices_for_data = np.zeros(self.size, dtype=np.uint32)
|
|
44
|
-
|
|
48
|
+
"""Array containing the indices in the original data instance.
|
|
49
|
+
These indices correspond to the events in `events`.
|
|
50
|
+
"""
|
|
51
|
+
|
|
45
52
|
self._tracker = np.zeros(self.num_frames, dtype=bool)
|
|
53
|
+
"""Private array that tracks the progress."""
|
|
46
54
|
|
|
47
55
|
def is_complete(self):
|
|
48
56
|
"""Determine whether the event stash is complete (all events added)"""
|
|
@@ -141,22 +149,31 @@ class QueueCollectorThread(threading.Thread):
|
|
|
141
149
|
super(QueueCollectorThread, self).__init__(
|
|
142
150
|
name="QueueCollector", *args, **kwargs)
|
|
143
151
|
self.logger = logging.getLogger("dcnum.write.QueueCollector")
|
|
144
|
-
|
|
152
|
+
|
|
145
153
|
self.event_queue = event_queue
|
|
146
|
-
|
|
154
|
+
"""Event queue from which to collect event data"""
|
|
155
|
+
|
|
147
156
|
self.writer_dq = writer_dq
|
|
148
|
-
|
|
149
|
-
|
|
157
|
+
"""Writer deque to which event arrays are appended"""
|
|
158
|
+
|
|
150
159
|
self.buffer_dq = deque()
|
|
151
|
-
|
|
152
|
-
|
|
160
|
+
"""Buffer deque
|
|
161
|
+
Events that do not not belong to the current chunk
|
|
162
|
+
(chunk defined by `write_threshold`) go here.
|
|
163
|
+
"""
|
|
164
|
+
|
|
153
165
|
self.feat_nevents = feat_nevents
|
|
154
|
-
|
|
166
|
+
"""shared array containing the number of events
|
|
167
|
+
for each frame in `data`."""
|
|
168
|
+
|
|
155
169
|
self.write_threshold = write_threshold
|
|
156
|
-
|
|
170
|
+
"""Number of frames to send to `writer_dq` at a time."""
|
|
171
|
+
|
|
157
172
|
self.written_events = 0
|
|
158
|
-
|
|
173
|
+
"""Number of events sent to `writer_dq`"""
|
|
174
|
+
|
|
159
175
|
self.written_frames = 0
|
|
176
|
+
"""Number of frames from `data` written to `writer_dq`"""
|
|
160
177
|
|
|
161
178
|
def run(self):
|
|
162
179
|
# We are not writing to `event_queue` so we can safely cancel
|
dcnum/write/writer.py
CHANGED
|
@@ -275,13 +275,13 @@ class HDF5Writer:
|
|
|
275
275
|
def store_log(self,
|
|
276
276
|
log: str,
|
|
277
277
|
data: List[str],
|
|
278
|
-
override: bool = False):
|
|
278
|
+
override: bool = False) -> h5py.Dataset:
|
|
279
279
|
"""Store log data
|
|
280
280
|
|
|
281
281
|
Store the log data under the key `log`. The `data`
|
|
282
282
|
kwarg must be a list of strings. If the log entry
|
|
283
283
|
already exists, `ValueError` is raised unless
|
|
284
|
-
|
|
284
|
+
``override`` is set to True.
|
|
285
285
|
"""
|
|
286
286
|
logs = self.h5.require_group("logs")
|
|
287
287
|
if log in logs:
|
|
@@ -290,7 +290,7 @@ class HDF5Writer:
|
|
|
290
290
|
else:
|
|
291
291
|
raise ValueError(
|
|
292
292
|
f"Log '{log}' already exists in {self.h5.filename}!")
|
|
293
|
-
logs.create_dataset(
|
|
293
|
+
log_ds = logs.create_dataset(
|
|
294
294
|
name=log,
|
|
295
295
|
data=data,
|
|
296
296
|
shape=(len(data),),
|
|
@@ -298,6 +298,7 @@ class HDF5Writer:
|
|
|
298
298
|
dtype=f"S{max([len(ll) for ll in data])}",
|
|
299
299
|
chunks=True,
|
|
300
300
|
**self.ds_kwds)
|
|
301
|
+
return log_ds
|
|
301
302
|
|
|
302
303
|
|
|
303
304
|
def create_with_basins(
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
dcnum/__init__.py,sha256=hcawIKS7utYiOyVhOAX9t7K3xYzP1b9862VV0b6qSrQ,74
|
|
2
|
+
dcnum/_version.py,sha256=hjm1pvHN0ZX7nlIod7PG7Fba0cyr_wIaCY9stsERSag,513
|
|
3
|
+
dcnum/os_env_st.py,sha256=4psq-gPuWTTQ118kCiTx0Mhoyads4Irn6JSUzZk8gyc,3052
|
|
4
|
+
dcnum/feat/__init__.py,sha256=jUJYWTD3VIoDNKrmryXbjHb1rGwYtK4b7VPWihYgUoo,325
|
|
5
|
+
dcnum/feat/event_extractor_manager_thread.py,sha256=6D3RVYBuH7gOoGZ4Kz74n6fhq7MtlTY26kpSwZRqg3M,7972
|
|
6
|
+
dcnum/feat/gate.py,sha256=EOleB83sOlBjc8bjaZfWwGuxfCcEO5mknuFunlw_j7o,7252
|
|
7
|
+
dcnum/feat/queue_event_extractor.py,sha256=s-sC7Inkly_HYbqT3OPB6zWRvKm4TNOewujt1EuZF4M,16183
|
|
8
|
+
dcnum/feat/feat_background/__init__.py,sha256=OTmMuazHNaSrZb2XW4cnJ6PlgJLbKrPbaidpEixYa0A,341
|
|
9
|
+
dcnum/feat/feat_background/base.py,sha256=N2_CqA1LJwvsfhr3xMPbicVs3DVDXtvlNDZ-uPrJi5w,8749
|
|
10
|
+
dcnum/feat/feat_background/bg_copy.py,sha256=Xfju4DqbrtPyaUf3x-ybrWci5ip_cEbeiEg7Jh56YIY,1182
|
|
11
|
+
dcnum/feat/feat_background/bg_roll_median.py,sha256=rb3JnFzm4aXVLMKdP9wJlRXwTwmKUz2R1RBS9GXPepg,13622
|
|
12
|
+
dcnum/feat/feat_background/bg_sparse_median.py,sha256=PbcTehk46b9l03ZA1mBdyeMPHmGgGN4-59eLy2TzwX8,22634
|
|
13
|
+
dcnum/feat/feat_brightness/__init__.py,sha256=o6AebVlmydwNgVF5kW6ITqJyFreoKrU3Ki_3EC8If-s,155
|
|
14
|
+
dcnum/feat/feat_brightness/bright_all.py,sha256=vf8xaYBdKD24hHUXdkI0_S7nbr7m49KW6gvuWvbHDVg,4545
|
|
15
|
+
dcnum/feat/feat_brightness/common.py,sha256=JX49EszYDmnvoOKXFVV1CalEIWRmOuY5EryNbqGbdac,156
|
|
16
|
+
dcnum/feat/feat_contour/__init__.py,sha256=Td4Hs47kUgJj0VXm3q5ofXhaUWr9QTfVgbwh5EELA-I,163
|
|
17
|
+
dcnum/feat/feat_contour/contour.py,sha256=_qyHCGvylVxruMWafvVbVOzhWGXLoFi10LReNxGcWhY,463
|
|
18
|
+
dcnum/feat/feat_contour/moments.py,sha256=W8sD2X7JqIBq-9nL82hf4Hm2uJkfca8EvAl_hqI_IDg,5109
|
|
19
|
+
dcnum/feat/feat_contour/volume.py,sha256=ScxP_VdLRchDFnYJCR3srUa_stVbP3T4toQX0o-91jk,6645
|
|
20
|
+
dcnum/feat/feat_texture/__init__.py,sha256=6StM9S540UVtdFFR3bHa7nfCTomeVdoo7Uy9CjuTgH0,137
|
|
21
|
+
dcnum/feat/feat_texture/common.py,sha256=COXHpXS-7DMouGu3WF83I76L02Sr7P9re4lxajh6g0E,439
|
|
22
|
+
dcnum/feat/feat_texture/tex_all.py,sha256=_5H3sXYRN0Uq2eUHn3XUyEHkU_tncEqbqJTC-HZcnGY,5198
|
|
23
|
+
dcnum/logic/__init__.py,sha256=7J3GrwJInNQbrLk61HRIV7X7p69TAIbMYpR34hh6u14,177
|
|
24
|
+
dcnum/logic/ctrl.py,sha256=c06ZOUD0T4_FdQDHbigkLAPQTyoeFxhETg-K3W1UyeM,37520
|
|
25
|
+
dcnum/logic/job.py,sha256=MprDL6DwXWmvtGgy7W9A7s2rVRx68ObdJB8mvGFwVcw,7718
|
|
26
|
+
dcnum/logic/json_encoder.py,sha256=wb6uk6EeTkXyrvwtLm9uWe0cfmiBannzcsKLsDLHuQo,843
|
|
27
|
+
dcnum/meta/__init__.py,sha256=AVqRgyKXO1orKnE305h88IBvoZ1oz6X11HN1WP5nGvg,60
|
|
28
|
+
dcnum/meta/paths.py,sha256=aIG39JYbZpOlCbPQIlp0SqGumjbGINYhL2AAoznJt5o,1113
|
|
29
|
+
dcnum/meta/ppid.py,sha256=JInGtwSCsO9nr1E1aishm0k9iQIFB-essBKvv5aBE98,8510
|
|
30
|
+
dcnum/read/__init__.py,sha256=LYHyZHgiNTpjV5oEcty-7Kh5topLpHT_cFlNl-QX8gg,262
|
|
31
|
+
dcnum/read/cache.py,sha256=ChxokVuMaTfi6N6ZbOTWpNYkPgAAYi1lR8nD7JbzjPQ,6497
|
|
32
|
+
dcnum/read/const.py,sha256=x6LfRwWvIxm6nDWlSADVWqDuzMX6bLzy5kQprwLPzA4,496
|
|
33
|
+
dcnum/read/detect_flicker.py,sha256=XVf7nqaHx6weRTtS7KPa5_WRU2flDQIZTbKspeguqdU,1829
|
|
34
|
+
dcnum/read/hdf5_data.py,sha256=Q4sFT1HBrkrKCX1TUaOpibvz8VFj0ETMa9lw_xIF6tw,26360
|
|
35
|
+
dcnum/read/mapped.py,sha256=zU2fYdZfLNHn0rKHxDzBhNFMu4--WWa8nSeE2likyZA,3637
|
|
36
|
+
dcnum/segm/__init__.py,sha256=9cLEAd3JWE8IGqDHV-eSDIYOGBfOepd8OcebtNs8Omk,309
|
|
37
|
+
dcnum/segm/segm_thresh.py,sha256=iVhvIhzO0Gw0t3rXOgH71rOI0CNjJJQq4Gg6BulUhK8,948
|
|
38
|
+
dcnum/segm/segmenter.py,sha256=k130BoriJJ3cXHZjKXkL7rlBFEeAOQI-3Hp6FM_DdvM,15000
|
|
39
|
+
dcnum/segm/segmenter_manager_thread.py,sha256=vMZFBa18oO8OyVB3niy_mtEfKkGOWHEga41E0K-S6Tc,5963
|
|
40
|
+
dcnum/segm/segmenter_mpo.py,sha256=O6G4xzHKNMSmyX9HDXTfl-3f9Fk2filxvVrRIO2D9hg,14117
|
|
41
|
+
dcnum/segm/segmenter_sto.py,sha256=C55orEAZtMowNwtAT_WdSv46n5CzgLFuGq9kwdHc97I,3963
|
|
42
|
+
dcnum/segm/segm_torch/__init__.py,sha256=DtUqJTbj7ybrTbXlwHq1Y4SCzi22rMW9Cus6wX-iU-A,822
|
|
43
|
+
dcnum/segm/segm_torch/segm_torch_base.py,sha256=Z2c9_lZI4qEljQEMXuN_6CpBti57PbbjlDq0NGX3-EU,4514
|
|
44
|
+
dcnum/segm/segm_torch/segm_torch_mpo.py,sha256=GOva6o-6_SppxWD4BeBB3ap1TR-6rIYHavtfIstaYvc,2643
|
|
45
|
+
dcnum/segm/segm_torch/segm_torch_sto.py,sha256=PTOJrP_FkaxZZul8lM4VA2HL3KyxrheDDWWdJbmJdiw,3393
|
|
46
|
+
dcnum/segm/segm_torch/torch_model.py,sha256=5aL6SwSvg1N2gATEGBhP3aA4WTHlvGzQVYuizmh0LrU,3187
|
|
47
|
+
dcnum/segm/segm_torch/torch_postproc.py,sha256=3WUuBvcNyFJF-b-T0MEaj-8yZs-cYKTsq_i55uu5s54,3312
|
|
48
|
+
dcnum/segm/segm_torch/torch_preproc.py,sha256=m4Dd2URdvS7ifA1MkbEkc9d9T30lA_1qbE6P_Gsa0r4,4003
|
|
49
|
+
dcnum/write/__init__.py,sha256=sK79IlvCFIqf2oFABVeyYedMnHOsEIQpxAauEeNO-Tw,273
|
|
50
|
+
dcnum/write/deque_writer_thread.py,sha256=ao7F1yrVKyufgC4rC0Y2_Vt7snuT6KpI7W2qVxcjdhk,1994
|
|
51
|
+
dcnum/write/queue_collector_thread.py,sha256=-p5vrk9cDhtaIMFIu_cCmvlZJafrFkW68uONonMURYo,11617
|
|
52
|
+
dcnum/write/writer.py,sha256=JkVb4KDBV3oo9r3p2yy9wECO1REx7FG0PRBmVWTxJdk,20577
|
|
53
|
+
dcnum-0.25.7.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
|
|
54
|
+
dcnum-0.25.7.dist-info/METADATA,sha256=X3578YE2gN-g5mMPHH8bMnFyU9E64PP_ivRsIHPKcYc,2321
|
|
55
|
+
dcnum-0.25.7.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
|
56
|
+
dcnum-0.25.7.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
|
|
57
|
+
dcnum-0.25.7.dist-info/RECORD,,
|
dcnum-0.25.5.dist-info/RECORD
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
dcnum/__init__.py,sha256=hcawIKS7utYiOyVhOAX9t7K3xYzP1b9862VV0b6qSrQ,74
|
|
2
|
-
dcnum/_version.py,sha256=9fxGcLLejSq2kXz456dcZ6KQ3PScn-5vo0OgINlsUs0,413
|
|
3
|
-
dcnum/os_env_st.py,sha256=ujEVzn1G5sxZfJSITOMw48e2O_oMFu2VD6oj5QCUFSU,3025
|
|
4
|
-
dcnum/feat/__init__.py,sha256=jUJYWTD3VIoDNKrmryXbjHb1rGwYtK4b7VPWihYgUoo,325
|
|
5
|
-
dcnum/feat/event_extractor_manager_thread.py,sha256=FAxSyRfaNAuBWNplxHngp5h-44s0qIP24XX_oETdfMk,7836
|
|
6
|
-
dcnum/feat/gate.py,sha256=Yhxq80JoRMmQzBxl35C8NT91c9QcmQa-EIKLuxK6WvE,7221
|
|
7
|
-
dcnum/feat/queue_event_extractor.py,sha256=KA7K7fOUbLYRfHjdfmN6mVuPPjCJbWMCHv0-b41lBMs,16038
|
|
8
|
-
dcnum/feat/feat_background/__init__.py,sha256=OTmMuazHNaSrZb2XW4cnJ6PlgJLbKrPbaidpEixYa0A,341
|
|
9
|
-
dcnum/feat/feat_background/base.py,sha256=bQBPvztrku-8YSVk8YBUUNh7MaYcnztgyD2-dQHxpzw,8674
|
|
10
|
-
dcnum/feat/feat_background/bg_copy.py,sha256=PK8x4_Uph-_A6uszZC5uhe1gD1dSRdHnDMEsN0HSGHA,1034
|
|
11
|
-
dcnum/feat/feat_background/bg_roll_median.py,sha256=NqdgVYm-iUhgDZEonZxQrDvh5e26NoryQKCge8pNGoM,13571
|
|
12
|
-
dcnum/feat/feat_background/bg_sparse_median.py,sha256=QrerkPENHkC9PBgivamu-N1Od6-0b61Ohy_oZYL4www,22449
|
|
13
|
-
dcnum/feat/feat_brightness/__init__.py,sha256=o6AebVlmydwNgVF5kW6ITqJyFreoKrU3Ki_3EC8If-s,155
|
|
14
|
-
dcnum/feat/feat_brightness/bright_all.py,sha256=vf8xaYBdKD24hHUXdkI0_S7nbr7m49KW6gvuWvbHDVg,4545
|
|
15
|
-
dcnum/feat/feat_brightness/common.py,sha256=JX49EszYDmnvoOKXFVV1CalEIWRmOuY5EryNbqGbdac,156
|
|
16
|
-
dcnum/feat/feat_contour/__init__.py,sha256=Td4Hs47kUgJj0VXm3q5ofXhaUWr9QTfVgbwh5EELA-I,163
|
|
17
|
-
dcnum/feat/feat_contour/contour.py,sha256=_qyHCGvylVxruMWafvVbVOzhWGXLoFi10LReNxGcWhY,463
|
|
18
|
-
dcnum/feat/feat_contour/moments.py,sha256=W8sD2X7JqIBq-9nL82hf4Hm2uJkfca8EvAl_hqI_IDg,5109
|
|
19
|
-
dcnum/feat/feat_contour/volume.py,sha256=xVHWtv6USUHJZ5dM1Ur7fI7OwoPT5N2Ps0gKVWylfl8,6639
|
|
20
|
-
dcnum/feat/feat_texture/__init__.py,sha256=6StM9S540UVtdFFR3bHa7nfCTomeVdoo7Uy9CjuTgH0,137
|
|
21
|
-
dcnum/feat/feat_texture/common.py,sha256=COXHpXS-7DMouGu3WF83I76L02Sr7P9re4lxajh6g0E,439
|
|
22
|
-
dcnum/feat/feat_texture/tex_all.py,sha256=_5H3sXYRN0Uq2eUHn3XUyEHkU_tncEqbqJTC-HZcnGY,5198
|
|
23
|
-
dcnum/logic/__init__.py,sha256=7J3GrwJInNQbrLk61HRIV7X7p69TAIbMYpR34hh6u14,177
|
|
24
|
-
dcnum/logic/ctrl.py,sha256=RZ2xl0496Iv91cdCdbkIg2W1fClqsTUDq7YlHHwWQfk,37514
|
|
25
|
-
dcnum/logic/job.py,sha256=9BN2WjYqjjJuLnfNZAtQ2Nn47Glo2jVrivDodGJoqlQ,7713
|
|
26
|
-
dcnum/logic/json_encoder.py,sha256=cxMnqisbKEVf-rVcw6rK2BBAb6iz_hKFaGl81kK36lQ,571
|
|
27
|
-
dcnum/meta/__init__.py,sha256=AVqRgyKXO1orKnE305h88IBvoZ1oz6X11HN1WP5nGvg,60
|
|
28
|
-
dcnum/meta/paths.py,sha256=J_ikeHzd7gEeRgAKjuayz3x6q4h1fOiDadM-ZxhAGm4,1053
|
|
29
|
-
dcnum/meta/ppid.py,sha256=RnDkJSdV1kDznAsOhQN5WI7uC9UwSMCjyADP7yWNvkM,8478
|
|
30
|
-
dcnum/read/__init__.py,sha256=LYHyZHgiNTpjV5oEcty-7Kh5topLpHT_cFlNl-QX8gg,262
|
|
31
|
-
dcnum/read/cache.py,sha256=LNA5nnDyrw8Nj07E7XfG2GcHEoWm6vA6Qo_8N-n-sGw,6492
|
|
32
|
-
dcnum/read/const.py,sha256=GG9iyXDtEldvJYOBnhZjlimzIeBMAt4bSr2-xn2gzzc,464
|
|
33
|
-
dcnum/read/detect_flicker.py,sha256=CeUyxI6LaX_lCNvBPm_yzsiWmiNcZYqbNZCtvKPdkcU,1827
|
|
34
|
-
dcnum/read/hdf5_data.py,sha256=Q4sFT1HBrkrKCX1TUaOpibvz8VFj0ETMa9lw_xIF6tw,26360
|
|
35
|
-
dcnum/read/mapped.py,sha256=zU2fYdZfLNHn0rKHxDzBhNFMu4--WWa8nSeE2likyZA,3637
|
|
36
|
-
dcnum/segm/__init__.py,sha256=9cLEAd3JWE8IGqDHV-eSDIYOGBfOepd8OcebtNs8Omk,309
|
|
37
|
-
dcnum/segm/segm_thresh.py,sha256=iVhvIhzO0Gw0t3rXOgH71rOI0CNjJJQq4Gg6BulUhK8,948
|
|
38
|
-
dcnum/segm/segmenter.py,sha256=FWLFDBR-x_85ku2rObA2F-QBrM4IUaUL-YHChLagVvM,14902
|
|
39
|
-
dcnum/segm/segmenter_manager_thread.py,sha256=frM0sMxC7f7TQiFjmpRxuwG2kUBFpW1inV8dtpADHiI,5924
|
|
40
|
-
dcnum/segm/segmenter_mpo.py,sha256=XcYMKTnCu6-D-TJ62V18S3OE9DhaPhqFkhGhUaDWJFg,14096
|
|
41
|
-
dcnum/segm/segmenter_sto.py,sha256=e6MtN_RWusA0wTExV-FLGpDXNJs1CbSyXcSdWUPBMvM,3959
|
|
42
|
-
dcnum/segm/segm_torch/__init__.py,sha256=DtUqJTbj7ybrTbXlwHq1Y4SCzi22rMW9Cus6wX-iU-A,822
|
|
43
|
-
dcnum/segm/segm_torch/segm_torch_base.py,sha256=G9AhVyD6LkAmk0tkbYnJUSpvcj3_HYf0uqfILZQsyus,4479
|
|
44
|
-
dcnum/segm/segm_torch/segm_torch_mpo.py,sha256=GOva6o-6_SppxWD4BeBB3ap1TR-6rIYHavtfIstaYvc,2643
|
|
45
|
-
dcnum/segm/segm_torch/segm_torch_sto.py,sha256=PTOJrP_FkaxZZul8lM4VA2HL3KyxrheDDWWdJbmJdiw,3393
|
|
46
|
-
dcnum/segm/segm_torch/torch_model.py,sha256=5aL6SwSvg1N2gATEGBhP3aA4WTHlvGzQVYuizmh0LrU,3187
|
|
47
|
-
dcnum/segm/segm_torch/torch_postproc.py,sha256=ctirQTmsZnuZGIxkwFWN9arRneHRYJUxaJ_ZyCgjByM,3311
|
|
48
|
-
dcnum/segm/segm_torch/torch_preproc.py,sha256=kjabu76paw23kO7RP7Ik6IY60Kk1VBAHKBAedflA0aQ,4002
|
|
49
|
-
dcnum/write/__init__.py,sha256=sK79IlvCFIqf2oFABVeyYedMnHOsEIQpxAauEeNO-Tw,273
|
|
50
|
-
dcnum/write/deque_writer_thread.py,sha256=ao7F1yrVKyufgC4rC0Y2_Vt7snuT6KpI7W2qVxcjdhk,1994
|
|
51
|
-
dcnum/write/queue_collector_thread.py,sha256=KwwNIDFEF2DU83woKES5K05MxxOhDxPMZLLeyPugfDo,11542
|
|
52
|
-
dcnum/write/writer.py,sha256=oHlq4bDHQxb33-3Fw1xnzJwACecLyH-6koGK8SN0cSk,20528
|
|
53
|
-
dcnum-0.25.5.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
|
|
54
|
-
dcnum-0.25.5.dist-info/METADATA,sha256=sZNOKsa8U5IYQKn0jDGFzTVQvnJfMREuv_4ctHNU5Js,2321
|
|
55
|
-
dcnum-0.25.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
56
|
-
dcnum-0.25.5.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
|
|
57
|
-
dcnum-0.25.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|