dclab 0.62.11__cp311-cp311-win_amd64.whl → 2.18.0__cp311-cp311-win_amd64.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 dclab might be problematic. Click here for more details.
- dclab/_version.py +2 -2
- dclab/definitions/meta_const.py +1 -11
- dclab/downsampling.cp311-win_amd64.pyd +0 -0
- dclab/external/skimage/_find_contours_cy.cp311-win_amd64.pyd +0 -0
- dclab/external/skimage/_pnpoly.cp311-win_amd64.pyd +0 -0
- dclab/external/skimage/_shared/geometry.cp311-win_amd64.pyd +0 -0
- dclab/http_utils.py +2 -12
- dclab/lme4/__init__.py +4 -4
- dclab/lme4/rlibs.py +93 -0
- dclab/lme4/rsetup.py +153 -150
- dclab/lme4/wrapr.py +129 -93
- dclab/rtdc_dataset/check.py +6 -74
- dclab/rtdc_dataset/copier.py +19 -73
- dclab/rtdc_dataset/core.py +2 -12
- dclab/rtdc_dataset/export.py +12 -16
- dclab/rtdc_dataset/feat_basin.py +3 -30
- dclab/rtdc_dataset/fmt_dcor/tables.py +4 -6
- dclab/rtdc_dataset/fmt_hdf5/base.py +2 -7
- dclab/rtdc_dataset/fmt_hdf5/events.py +3 -3
- dclab/rtdc_dataset/fmt_hierarchy/base.py +1 -0
- dclab/rtdc_dataset/fmt_hierarchy/events.py +3 -4
- dclab/rtdc_dataset/linker.py +124 -0
- dclab/rtdc_dataset/writer.py +11 -30
- dclab/util.py +0 -6
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/METADATA +5 -3
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/RECORD +30 -29
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/WHEEL +1 -1
- dclab/lme4/lme4_template.R +0 -94
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/LICENSE +0 -0
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/entry_points.txt +0 -0
- {dclab-0.62.11.dist-info → dclab-2.18.0.dist-info}/top_level.txt +0 -0
dclab/rtdc_dataset/export.py
CHANGED
|
@@ -224,7 +224,6 @@ class Export(object):
|
|
|
224
224
|
skip_checks: bool
|
|
225
225
|
Disable checking whether all features have the same length.
|
|
226
226
|
|
|
227
|
-
|
|
228
227
|
.. versionchanged:: 0.58.0
|
|
229
228
|
|
|
230
229
|
The ``basins`` keyword argument was added, and it is now possible
|
|
@@ -319,21 +318,18 @@ class Export(object):
|
|
|
319
318
|
|
|
320
319
|
# write export log
|
|
321
320
|
hw.store_log(time.strftime("dclab-export_%Y-%m-%d_%H.%M.%S"),
|
|
322
|
-
json.dumps(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
indent=2,
|
|
335
|
-
sort_keys=True,
|
|
336
|
-
).split("\n"))
|
|
321
|
+
json.dumps({
|
|
322
|
+
"dclab version": version_tuple,
|
|
323
|
+
"kwargs": {
|
|
324
|
+
"features": features,
|
|
325
|
+
"filtered": filtered,
|
|
326
|
+
"logs": logs,
|
|
327
|
+
"tables": tables,
|
|
328
|
+
"basins": basins,
|
|
329
|
+
"meta_prefix": meta_prefix,
|
|
330
|
+
"skip_checks": skip_checks
|
|
331
|
+
}
|
|
332
|
+
}).split("\n"))
|
|
337
333
|
|
|
338
334
|
if logs:
|
|
339
335
|
# write logs
|
dclab/rtdc_dataset/feat_basin.py
CHANGED
|
@@ -9,18 +9,11 @@ import abc
|
|
|
9
9
|
import numbers
|
|
10
10
|
import threading
|
|
11
11
|
from typing import Dict, List, Literal
|
|
12
|
-
import uuid
|
|
13
12
|
import warnings
|
|
14
13
|
import weakref
|
|
15
14
|
|
|
16
15
|
import numpy as np
|
|
17
16
|
|
|
18
|
-
from ..util import copy_if_needed
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class BasinFeatureMissingWarning(UserWarning):
|
|
22
|
-
"""Used when a badin feature is defined but not stored"""
|
|
23
|
-
|
|
24
17
|
|
|
25
18
|
class CyclicBasinDependencyFoundWarning(UserWarning):
|
|
26
19
|
"""Used when a basin is defined in one of its sub-basins"""
|
|
@@ -75,7 +68,6 @@ class Basin(abc.ABC):
|
|
|
75
68
|
] = "same",
|
|
76
69
|
mapping_referrer: Dict = None,
|
|
77
70
|
ignored_basins: List[str] = None,
|
|
78
|
-
key: str = None,
|
|
79
71
|
**kwargs):
|
|
80
72
|
"""
|
|
81
73
|
|
|
@@ -111,10 +103,6 @@ class Basin(abc.ABC):
|
|
|
111
103
|
:class:`.RTDCBase`.
|
|
112
104
|
ignored_basins: list of str
|
|
113
105
|
List of basins to ignore in subsequent basin instantiations
|
|
114
|
-
key: str
|
|
115
|
-
Unique key to identify this basin; normally computed from
|
|
116
|
-
a JSON dump of the basin definition. A random string is used
|
|
117
|
-
if None is specified.
|
|
118
106
|
kwargs:
|
|
119
107
|
Additional keyword arguments passed to the `load_dataset`
|
|
120
108
|
method of the `Basin` subclass.
|
|
@@ -130,8 +118,6 @@ class Basin(abc.ABC):
|
|
|
130
118
|
self.name = name
|
|
131
119
|
#: lengthy description of the basin
|
|
132
120
|
self.description = description
|
|
133
|
-
# defining key of the basin
|
|
134
|
-
self.key = key or str(uuid.uuid4())
|
|
135
121
|
# features this basin provides
|
|
136
122
|
self._features = features
|
|
137
123
|
#: measurement identifier of the referencing dataset
|
|
@@ -375,7 +361,6 @@ class BasinProxy:
|
|
|
375
361
|
dataset to the downstream dataset
|
|
376
362
|
"""
|
|
377
363
|
self.ds = ds
|
|
378
|
-
self.basins_get_dicts = ds.basins_get_dicts
|
|
379
364
|
self.basinmap = basinmap
|
|
380
365
|
self._features = {}
|
|
381
366
|
|
|
@@ -420,7 +405,7 @@ class BasinProxyFeature(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
420
405
|
self._cache = None
|
|
421
406
|
self.is_scalar = bool(len(self.feat_obj.shape) == 1)
|
|
422
407
|
|
|
423
|
-
def __array__(self, dtype=None, copy=
|
|
408
|
+
def __array__(self, dtype=None, copy=False, *args, **kwargs):
|
|
424
409
|
if self._cache is None and self.is_scalar:
|
|
425
410
|
self._cache = self.feat_obj[:][self.basinmap]
|
|
426
411
|
else:
|
|
@@ -511,19 +496,6 @@ class InternalH5DatasetBasin(Basin):
|
|
|
511
496
|
if self._features is None:
|
|
512
497
|
raise ValueError("You must specify features when defining "
|
|
513
498
|
"internal basins.")
|
|
514
|
-
# Redefine the features if necessary
|
|
515
|
-
h5root = self._basinmap_referrer().h5file
|
|
516
|
-
available_features = []
|
|
517
|
-
for feat in self._features:
|
|
518
|
-
if self.location in h5root and feat in h5root[self.location]:
|
|
519
|
-
available_features.append(feat)
|
|
520
|
-
else:
|
|
521
|
-
warnings.warn(
|
|
522
|
-
f"Feature '{feat}' is defined as an internal basin, "
|
|
523
|
-
f"but it cannot be found in '{self.location}'.",
|
|
524
|
-
BasinFeatureMissingWarning)
|
|
525
|
-
self._features.clear()
|
|
526
|
-
self._features += available_features
|
|
527
499
|
|
|
528
500
|
def _load_dataset(self, location, **kwargs):
|
|
529
501
|
from .fmt_dict import RTDC_Dict
|
|
@@ -535,7 +507,8 @@ class InternalH5DatasetBasin(Basin):
|
|
|
535
507
|
return RTDC_Dict(ds_dict)
|
|
536
508
|
|
|
537
509
|
def is_available(self):
|
|
538
|
-
|
|
510
|
+
h5root = self._basinmap_referrer().h5file
|
|
511
|
+
return self.location in h5root
|
|
539
512
|
|
|
540
513
|
def verify_basin(self, *args, **kwargs):
|
|
541
514
|
"""It's not necessary to verify internal basins"""
|
|
@@ -30,13 +30,11 @@ class DCORTables:
|
|
|
30
30
|
tables = {}
|
|
31
31
|
for key in table_data:
|
|
32
32
|
columns, data = table_data[key]
|
|
33
|
+
ds_dt = np.dtype({'names': columns,
|
|
34
|
+
'formats': [np.float64] * len(columns)})
|
|
33
35
|
tab_data = np.asarray(data)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
ds_dt = np.dtype({'names': columns,
|
|
37
|
-
'formats': [np.float64] * len(columns)})
|
|
38
|
-
tab_data = np.rec.array(tab_data, dtype=ds_dt)
|
|
39
|
-
tables[key] = tab_data
|
|
36
|
+
rec_arr = np.rec.array(tab_data, dtype=ds_dt)
|
|
37
|
+
tables[key] = rec_arr
|
|
40
38
|
|
|
41
39
|
self._tables_cache = tables
|
|
42
40
|
return self._tables_cache
|
|
@@ -175,15 +175,10 @@ class RTDC_HDF5(RTDCBase):
|
|
|
175
175
|
|
|
176
176
|
def basins_get_dicts(self):
|
|
177
177
|
"""Return list of dicts for all basins defined in `self.h5file`"""
|
|
178
|
-
return self.basin_get_dicts_from_h5file(self.h5file)
|
|
179
|
-
|
|
180
|
-
@staticmethod
|
|
181
|
-
def basin_get_dicts_from_h5file(h5file):
|
|
182
|
-
"""Return list of dicts for all basins defined in `h5file`"""
|
|
183
178
|
basins = []
|
|
184
179
|
# Do not sort anything here, sorting is done in `RTDCBase`.
|
|
185
|
-
for bk in h5file.get("basins", []):
|
|
186
|
-
bdat = list(h5file["basins"][bk])
|
|
180
|
+
for bk in self.h5file.get("basins", []):
|
|
181
|
+
bdat = list(self.h5file["basins"][bk])
|
|
187
182
|
if isinstance(bdat[0], bytes):
|
|
188
183
|
bdat = [bi.decode("utf") for bi in bdat]
|
|
189
184
|
bdict = json.loads(" ".join(bdat))
|
|
@@ -7,7 +7,7 @@ import numbers
|
|
|
7
7
|
import numpy as np
|
|
8
8
|
|
|
9
9
|
from ... import definitions as dfn
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
|
|
12
12
|
from . import feat_defect
|
|
13
13
|
|
|
@@ -140,7 +140,7 @@ class H5MaskEvent:
|
|
|
140
140
|
self.identifier = (self.h5dataset.file.filename, self.h5dataset.name)
|
|
141
141
|
self.dtype = np.dtype(bool)
|
|
142
142
|
|
|
143
|
-
def __array__(self, dtype=np.bool_, copy=
|
|
143
|
+
def __array__(self, dtype=np.bool_, copy=False, *args, **kwargs):
|
|
144
144
|
if dtype is not np.uint8:
|
|
145
145
|
warnings.warn("Please avoid calling the `__array__` method of the "
|
|
146
146
|
"`H5MaskEvent`. It may consume a lot of memory.",
|
|
@@ -180,7 +180,7 @@ class H5ScalarEvent(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
180
180
|
# attrs
|
|
181
181
|
self._ufunc_attrs = dict(self.h5ds.attrs)
|
|
182
182
|
|
|
183
|
-
def __array__(self, dtype=None, copy=
|
|
183
|
+
def __array__(self, dtype=None, copy=False, *args, **kwargs):
|
|
184
184
|
if self._array is None:
|
|
185
185
|
self._array = np.asarray(self.h5ds, *args, **kwargs)
|
|
186
186
|
return np.array(self._array, dtype=dtype, copy=copy)
|
|
@@ -3,7 +3,6 @@ import warnings
|
|
|
3
3
|
|
|
4
4
|
import numpy as np
|
|
5
5
|
|
|
6
|
-
from ...util import copy_if_needed
|
|
7
6
|
from .mapper import map_indices_child2parent
|
|
8
7
|
|
|
9
8
|
|
|
@@ -38,7 +37,7 @@ class ChildNDArray(ChildBase):
|
|
|
38
37
|
super(ChildNDArray, self).__init__(child)
|
|
39
38
|
self.feat = feat
|
|
40
39
|
|
|
41
|
-
def __array__(self, dtype=None, copy=
|
|
40
|
+
def __array__(self, dtype=None, copy=False, *args, **kwargs):
|
|
42
41
|
warnings.warn("Please avoid calling the `__array__` method of the "
|
|
43
42
|
"`ChildNDArray`. It may consume a lot of memory. "
|
|
44
43
|
"Consider using a generator instead.",
|
|
@@ -70,7 +69,7 @@ class ChildScalar(np.lib.mixins.NDArrayOperatorsMixin):
|
|
|
70
69
|
self._ufunc_attrs = {}
|
|
71
70
|
self.ndim = 1 # matplotlib might expect this from an array
|
|
72
71
|
|
|
73
|
-
def __array__(self, dtype=None, copy=
|
|
72
|
+
def __array__(self, dtype=None, copy=False, *args, **kwargs):
|
|
74
73
|
if self._array is None:
|
|
75
74
|
hparent = self.child.hparent
|
|
76
75
|
filt_arr = hparent.filter.all
|
|
@@ -122,7 +121,7 @@ class ChildTraceItem(ChildBase):
|
|
|
122
121
|
super(ChildTraceItem, self).__init__(child)
|
|
123
122
|
self.flname = flname
|
|
124
123
|
|
|
125
|
-
def __array__(self, dtype=None, copy=
|
|
124
|
+
def __array__(self, dtype=None, copy=False, *args, **kwargs):
|
|
126
125
|
warnings.warn("Please avoid calling the `__array__` method of the "
|
|
127
126
|
"`ChildTraceItem`. It may consume a lot of memory. "
|
|
128
127
|
"Consider using a generator instead.",
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"""Tools for linking HDF5 datasets across files"""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import io
|
|
5
|
+
import pathlib
|
|
6
|
+
from typing import BinaryIO, Literal
|
|
7
|
+
|
|
8
|
+
import h5py
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class ExternalDataForbiddenError(BaseException):
|
|
12
|
+
"""Raised when a dataset contains external data
|
|
13
|
+
|
|
14
|
+
External data are a security risk, because they could be
|
|
15
|
+
used to access data that are not supposed to be accessed.
|
|
16
|
+
This is especially critical when the data are accessed within
|
|
17
|
+
a web server process (e.g. in DCOR).
|
|
18
|
+
"""
|
|
19
|
+
pass
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def assert_no_external(h5):
|
|
23
|
+
"""Raise ExternalDataForbiddenError if `h5` refers to external data"""
|
|
24
|
+
has_ext, path_ext = check_external(h5)
|
|
25
|
+
if has_ext:
|
|
26
|
+
raise ExternalDataForbiddenError(
|
|
27
|
+
f"Dataset {h5.file.filename} contains external data, but these "
|
|
28
|
+
f"are not permitted for security reasons ({path_ext})!")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def check_external(h5):
|
|
32
|
+
"""Check recursively, whether an h5py object contains external data
|
|
33
|
+
|
|
34
|
+
External data includes binary data in external files, virtual
|
|
35
|
+
datasets, and external links.
|
|
36
|
+
|
|
37
|
+
Returns a tuple of either
|
|
38
|
+
|
|
39
|
+
- `(True, path_ext)` if the object contains external data
|
|
40
|
+
- `(False, None)` if this is not the case
|
|
41
|
+
|
|
42
|
+
where `path_ext` is the path to the group or dataset in `h5`.
|
|
43
|
+
|
|
44
|
+
.. versionadded:: 0.51.0
|
|
45
|
+
|
|
46
|
+
"""
|
|
47
|
+
for key in h5:
|
|
48
|
+
obj = h5[key]
|
|
49
|
+
if (obj.file != h5.file # not in same file
|
|
50
|
+
or (isinstance(obj, h5py.Dataset)
|
|
51
|
+
and (obj.is_virtual # virtual dataset
|
|
52
|
+
or obj.external))): # external dataset
|
|
53
|
+
# These are external data
|
|
54
|
+
return True, f"{h5.name}/{key}".replace("//", "/")
|
|
55
|
+
elif isinstance(obj, h5py.Group):
|
|
56
|
+
# Perform recursive check for external data
|
|
57
|
+
has_ext, path_ext = check_external(obj)
|
|
58
|
+
if has_ext:
|
|
59
|
+
return True, path_ext
|
|
60
|
+
else:
|
|
61
|
+
return False, None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def combine_h5files(
|
|
65
|
+
paths: list,
|
|
66
|
+
external: Literal["follow", "raise"] = "follow"
|
|
67
|
+
) -> BinaryIO:
|
|
68
|
+
"""Create an in-memory file that combines multiple .rtdc files
|
|
69
|
+
|
|
70
|
+
The .rtdc files must have the same number of events. The in-memory
|
|
71
|
+
file is populated with the "events" data from `paths` according to
|
|
72
|
+
the order that `paths` are given in. Metadata, including logs, basins,
|
|
73
|
+
and tables are only taken from the first path.
|
|
74
|
+
|
|
75
|
+
.. versionadded:: 0.51.0
|
|
76
|
+
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
paths: list of str or pathlib.Path
|
|
80
|
+
Paths of the input .rtdc files. The first input file is always
|
|
81
|
+
used as a source for the metadata. The other files only complement
|
|
82
|
+
the features.
|
|
83
|
+
external: str
|
|
84
|
+
Defines how external (links, binary, virtual) data in `paths`
|
|
85
|
+
should be handled. The default is to "follow" external datasets or
|
|
86
|
+
links to external data. In a zero-trust context, you can set this
|
|
87
|
+
to "raise" which will cause an :class:`.ExternalDataForbiddenError`
|
|
88
|
+
exception when external data are encountered.
|
|
89
|
+
|
|
90
|
+
Returns
|
|
91
|
+
-------
|
|
92
|
+
fd: BinaryIO
|
|
93
|
+
seekable, file-like object representing an HDF5 file opened in
|
|
94
|
+
binary mode; This can be passed to `:class:h5py.File`
|
|
95
|
+
"""
|
|
96
|
+
fd = io.BytesIO()
|
|
97
|
+
with h5py.File(fd, "w", libver="latest") as hv:
|
|
98
|
+
for ii, pp in enumerate(paths):
|
|
99
|
+
pp = pathlib.Path(pp).resolve()
|
|
100
|
+
with h5py.File(pp, libver="latest") as h5:
|
|
101
|
+
if external == "raise":
|
|
102
|
+
# Check for external data
|
|
103
|
+
assert_no_external(h5)
|
|
104
|
+
if ii == 0:
|
|
105
|
+
# Only write attributes once.
|
|
106
|
+
# Interestingly, writing the attributes takes
|
|
107
|
+
# the most time. Maybe there is some shortcut
|
|
108
|
+
# that can be taken (since e.g. we know we don't have to
|
|
109
|
+
# check for existing attributes).
|
|
110
|
+
# https://github.com/h5py/h5py/blob/master/
|
|
111
|
+
# h5py/_hl/attrs.py
|
|
112
|
+
hv.attrs.update(h5.attrs)
|
|
113
|
+
# Also, write basins/logs/tables/... (anything that is
|
|
114
|
+
# not events) only once.
|
|
115
|
+
for group in h5:
|
|
116
|
+
if group != "events":
|
|
117
|
+
hv[group] = h5py.ExternalLink(str(pp), group)
|
|
118
|
+
# Append features
|
|
119
|
+
hve = hv.require_group("events")
|
|
120
|
+
for feat in h5["events"]:
|
|
121
|
+
if feat not in hve:
|
|
122
|
+
hve[feat] = h5py.ExternalLink(str(pp),
|
|
123
|
+
f"/events/{feat}")
|
|
124
|
+
return fd
|
dclab/rtdc_dataset/writer.py
CHANGED
|
@@ -389,7 +389,7 @@ class RTDCWriter:
|
|
|
389
389
|
flocs.append(str(pp.resolve()))
|
|
390
390
|
# Also store the relative path for user convenience.
|
|
391
391
|
# Don't use pathlib.Path.relative_to, because that
|
|
392
|
-
#
|
|
392
|
+
# is deprecated in Python 3.12.
|
|
393
393
|
# Also, just look in subdirectories which simplifies
|
|
394
394
|
# path resolution.
|
|
395
395
|
this_parent = str(self.path.parent) + os.sep
|
|
@@ -408,7 +408,7 @@ class RTDCWriter:
|
|
|
408
408
|
else:
|
|
409
409
|
raise ValueError(f"Unknown basin type '{basin_type}'")
|
|
410
410
|
|
|
411
|
-
b_lines = json.dumps(b_data, indent=2
|
|
411
|
+
b_lines = json.dumps(b_data, indent=2).split("\n")
|
|
412
412
|
basins = self.h5file.require_group("basins")
|
|
413
413
|
key = hashobj(b_lines)
|
|
414
414
|
if key not in basins:
|
|
@@ -616,7 +616,7 @@ class RTDCWriter:
|
|
|
616
616
|
convfunc = dfn.get_config_value_func(sec, ck)
|
|
617
617
|
self.h5file.attrs[idk] = convfunc(value)
|
|
618
618
|
|
|
619
|
-
def store_table(self, name, cmp_array
|
|
619
|
+
def store_table(self, name, cmp_array):
|
|
620
620
|
"""Store a compound array table
|
|
621
621
|
|
|
622
622
|
Tables are semi-metadata. They may contain information collected
|
|
@@ -629,33 +629,16 @@ class RTDCWriter:
|
|
|
629
629
|
----------
|
|
630
630
|
name: str
|
|
631
631
|
Name of the table
|
|
632
|
-
cmp_array: np.recarray, h5py.Dataset,
|
|
632
|
+
cmp_array: np.recarray, h5py.Dataset, or dict
|
|
633
633
|
If a np.recarray or h5py.Dataset are provided, then they
|
|
634
634
|
are written as-is to the file. If a dictionary is provided,
|
|
635
635
|
then the dictionary is converted into a numpy recarray.
|
|
636
|
-
If a numpy array is provided, then the array is written
|
|
637
|
-
as a raw table (no column names) to the file.
|
|
638
|
-
h5_attrs: dict, optional
|
|
639
|
-
Attributes to store alongside the corresponding HDF5 dataset
|
|
640
636
|
"""
|
|
641
|
-
if
|
|
642
|
-
h5_attrs = {}
|
|
643
|
-
|
|
644
|
-
if isinstance(cmp_array, np.recarray):
|
|
637
|
+
if isinstance(cmp_array, (np.recarray, h5py.Dataset)):
|
|
645
638
|
# A table is a compound array (np.recarray). If we are here,
|
|
646
|
-
# this means that the user passed an instance of np.recarray
|
|
647
|
-
|
|
648
|
-
elif isinstance(cmp_array, h5py.Dataset):
|
|
649
|
-
# An instance of h5py.Dataset (which we trust to be a proper
|
|
639
|
+
# this means that the user passed an instance of np.recarray
|
|
640
|
+
# or an instance h5py.Dataset (which we trust to be a proper
|
|
650
641
|
# compound dataset at this point). No additional steps needed.
|
|
651
|
-
h5_attrs.update(cmp_array.attrs)
|
|
652
|
-
pass
|
|
653
|
-
elif isinstance(cmp_array, np.ndarray):
|
|
654
|
-
# A numpy array was passed. This usually means we have something
|
|
655
|
-
# that we can look at, so we add image tags.
|
|
656
|
-
h5_attrs['CLASS'] = np.bytes_('IMAGE')
|
|
657
|
-
h5_attrs['IMAGE_VERSION'] = np.bytes_('1.2')
|
|
658
|
-
h5_attrs['IMAGE_SUBCLASS'] = np.bytes_('IMAGE_GRAYSCALE')
|
|
659
642
|
pass
|
|
660
643
|
elif isinstance(cmp_array, dict):
|
|
661
644
|
# The user passed a dict which we now have to convert to a
|
|
@@ -676,18 +659,16 @@ class RTDCWriter:
|
|
|
676
659
|
else:
|
|
677
660
|
raise NotImplementedError(
|
|
678
661
|
f"Cannot convert {type(cmp_array)} to table!")
|
|
679
|
-
|
|
680
|
-
# data
|
|
681
662
|
group = self.h5file.require_group("tables")
|
|
682
663
|
tab = group.create_dataset(
|
|
683
664
|
name,
|
|
684
665
|
data=cmp_array,
|
|
685
666
|
fletcher32=True,
|
|
686
667
|
**self.compression_kwargs)
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
668
|
+
# Also store metadata
|
|
669
|
+
if hasattr(cmp_array, "attrs"):
|
|
670
|
+
for key in cmp_array.attrs:
|
|
671
|
+
tab.attrs[key] = cmp_array.attrs[key]
|
|
691
672
|
|
|
692
673
|
def version_brand(self, old_version=None, write_attribute=True):
|
|
693
674
|
"""Perform version branding
|
dclab/util.py
CHANGED
|
@@ -10,12 +10,6 @@ import numpy as np
|
|
|
10
10
|
from .rtdc_dataset.config import Configuration, ConfigurationDict
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
if np.lib.NumpyVersion(np.__version__) >= "2.0.0":
|
|
14
|
-
copy_if_needed = None
|
|
15
|
-
else:
|
|
16
|
-
copy_if_needed = False
|
|
17
|
-
|
|
18
|
-
|
|
19
13
|
class file_monitoring_lru_cache:
|
|
20
14
|
"""Decorator for caching data extracted from files
|
|
21
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
2
|
Name: dclab
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.18.0
|
|
4
4
|
Summary: Library for real-time deformability cytometry (RT-DC)
|
|
5
5
|
Author: Benedikt Hartmann, Eoghan O'Connell, Maik Herbig, Maximilian Schlögel, Nadia Sbaa, Paul Müller, Philipp Rosendahl, Raghava Alajangi
|
|
6
6
|
Maintainer-email: Paul Müller <dev@craban.de>
|
|
@@ -23,7 +23,7 @@ Requires-Dist: importlib-resources>=6.0
|
|
|
23
23
|
Requires-Dist: numpy<3,>=1.21
|
|
24
24
|
Requires-Dist: scipy<2,>=1.10.0
|
|
25
25
|
Provides-Extra: all
|
|
26
|
-
Requires-Dist: dclab[dcor,export,http,s3,tdms]; extra == "all"
|
|
26
|
+
Requires-Dist: dclab[dcor,export,http,lme4,s3,tdms]; extra == "all"
|
|
27
27
|
Provides-Extra: dcor
|
|
28
28
|
Requires-Dist: requests<3,>=2.31.0; extra == "dcor"
|
|
29
29
|
Provides-Extra: export
|
|
@@ -31,6 +31,8 @@ Requires-Dist: fcswrite>=0.5.0; extra == "export"
|
|
|
31
31
|
Requires-Dist: imageio[ffmpeg]; extra == "export"
|
|
32
32
|
Provides-Extra: http
|
|
33
33
|
Requires-Dist: requests<3,>=2.31.0; extra == "http"
|
|
34
|
+
Provides-Extra: lme4
|
|
35
|
+
Requires-Dist: rpy2>=2.9.4; extra == "lme4"
|
|
34
36
|
Provides-Extra: s3
|
|
35
37
|
Requires-Dist: boto3>=1.34.31; extra == "s3"
|
|
36
38
|
Provides-Extra: tdms
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
dclab/__init__.py,sha256=7_y6YtYcoL_a5M6Q9PiwZPzHSxS66yCTgs_uuK5C1dg,835
|
|
2
|
-
dclab/_version.py,sha256=
|
|
2
|
+
dclab/_version.py,sha256=FtxqWMMTICqFm_T17FM6lxcr-fqIwqwRcXNbxZPVYdg,429
|
|
3
3
|
dclab/cached.py,sha256=t01BYTf43VEsBYa0c-bMxgceF5vKoGV73b42UlLH6Lo,3014
|
|
4
|
-
dclab/downsampling.cp311-win_amd64.pyd,sha256=
|
|
4
|
+
dclab/downsampling.cp311-win_amd64.pyd,sha256=sn3f2qOTHpfeh-d5Rfb5CbUd-np9xuHu0MJ_N2-bdmc,187392
|
|
5
5
|
dclab/downsampling.pyx,sha256=Ez6MbNbzCUzs2IXXKtAYsjtYqP22kI8hdA1IE-3mqvY,7488
|
|
6
|
-
dclab/http_utils.py,sha256=
|
|
6
|
+
dclab/http_utils.py,sha256=IBRKlad0irZOZ0anjdGEGwrcNorKNiE_SIBMMJ3pMpo,10874
|
|
7
7
|
dclab/kde_contours.py,sha256=k0Y1UsJNtuYY8iqYmfQ-Nml-dFpJAcigd3vmt9U6zsY,6967
|
|
8
8
|
dclab/kde_methods.py,sha256=_Fm91_cJZoTGQEgfuK5To4nEFcW7lolNsldY8a_AUoM,9509
|
|
9
9
|
dclab/polygon_filter.py,sha256=C4uBvK8zzT8irUOIgITvASlCtc0EEMM5edp4dFx-9jw,13878
|
|
10
10
|
dclab/statistics.py,sha256=6saNuiXCcYmI8_cmb8Tb7E34BbsxHzTvNNlbKeNoDIw,6558
|
|
11
|
-
dclab/util.py,sha256=
|
|
11
|
+
dclab/util.py,sha256=YxX8u8DHhMDGD6lEswArM40o51zYYmhhjvikQHNVvXc,5291
|
|
12
12
|
dclab/warn.py,sha256=pv_W9cKBJg-mUn-_6O4xBwRmwI9QaEIW9EBEIiyL0iU,538
|
|
13
13
|
dclab/cli/__init__.py,sha256=IB33_cscv866CAwXnP1ZO9tlBpOldB0UQuR5P87FmSQ,493
|
|
14
14
|
dclab/cli/common.py,sha256=_YEmejfizH54aBI2q5solRMz8HN421rDkLj1dRXp7Tk,7461
|
|
@@ -22,7 +22,7 @@ dclab/cli/task_verify_dataset.py,sha256=OFy7aWHvA6NInndnMBg0MVZSBibvJeNHhc_C79_9
|
|
|
22
22
|
dclab/definitions/__init__.py,sha256=cubgnqpBbPgk_c1_uUPggRsmtUd-baV1haybLqbMf8k,2860
|
|
23
23
|
dclab/definitions/feat_const.py,sha256=I772sd6aSNv8PzhT9MHnNKbGhx6ZJt3z3_FVs5oxMtw,9836
|
|
24
24
|
dclab/definitions/feat_logic.py,sha256=uMHXInzESTtBWPBsk9PxqSFFrSM1vNbTDxOlso9zhT0,6006
|
|
25
|
-
dclab/definitions/meta_const.py,sha256=
|
|
25
|
+
dclab/definitions/meta_const.py,sha256=WnCUyfSdpwWIM4FsNJjiPomEgXM95C4pyGRSP2QzESI,12641
|
|
26
26
|
dclab/definitions/meta_logic.py,sha256=no6fTCmKFrwpmirs_9358-Ysh5aZeib1xJrL_30WkqU,4305
|
|
27
27
|
dclab/definitions/meta_parse.py,sha256=UtgSm7hkfqnyj6FAbDmctbXqfZOHU9d4uoMf3EcYWtQ,2487
|
|
28
28
|
dclab/external/__init__.py,sha256=cnwVRsdIQOHQrys3-g_dslbTEUi1hfTL709TaZ6hFVY,97
|
|
@@ -35,14 +35,14 @@ dclab/external/packaging/version.py,sha256=NgEgv7me4UCvFMyiNYD-nc_28b9UHUvBVh8RD
|
|
|
35
35
|
dclab/external/skimage/LICENSE,sha256=Tdv08zzxYV32WRdYnco9P3nVyS5w17OTxIAFeRSd1wc,1480
|
|
36
36
|
dclab/external/skimage/__init__.py,sha256=icOIlThkyn_hxmnM_i7OpbU7fhvqYWNpGdNGD38qthU,74
|
|
37
37
|
dclab/external/skimage/_find_contours.py,sha256=auRMNfZg7B73DX7kPXxgD8gMXXB3Lk9QDWt4wlQnUWg,9556
|
|
38
|
-
dclab/external/skimage/_find_contours_cy.cp311-win_amd64.pyd,sha256=
|
|
38
|
+
dclab/external/skimage/_find_contours_cy.cp311-win_amd64.pyd,sha256=cZta5ehQWv8S_Q2D9Fm1NAfiEKZrJy2cEFLAVy3WqVU,142848
|
|
39
39
|
dclab/external/skimage/_find_contours_cy.pyx,sha256=c-EobLhKjZNCpuqWxmvrcH35uAY_Bu-_hZiUHbXODms,7349
|
|
40
|
-
dclab/external/skimage/_pnpoly.cp311-win_amd64.pyd,sha256
|
|
40
|
+
dclab/external/skimage/_pnpoly.cp311-win_amd64.pyd,sha256=-EvORRshHVLo6O8-5fAKi-VhcVF2LvOL4UgR2P7OXOc,158720
|
|
41
41
|
dclab/external/skimage/_pnpoly.pyx,sha256=eHV3DlIGcBhAQ12-Y58EYq8xcq0Sibyc4xTxzX9NJsk,2603
|
|
42
42
|
dclab/external/skimage/measure.py,sha256=rzyI0HCr9O9GJNieVW8pcqDjTGRAdSehDUawD8QkIAE,254
|
|
43
43
|
dclab/external/skimage/pnpoly.py,sha256=zB4rSxjHJyY1OsGZ7QfFQqxIEDLGK8CWPehwutoFqm4,1400
|
|
44
44
|
dclab/external/skimage/_shared/__init__.py,sha256=q29esTsNh0HfQxcd2EuwdYNbEBJwo_qY4dfv7RihzoA,38
|
|
45
|
-
dclab/external/skimage/_shared/geometry.cp311-win_amd64.pyd,sha256=
|
|
45
|
+
dclab/external/skimage/_shared/geometry.cp311-win_amd64.pyd,sha256=Ufez4pyv6lOsbg46fzwpUjNkMJOsI6QunFvYcCDOXvI,21504
|
|
46
46
|
dclab/external/skimage/_shared/geometry.pxd,sha256=3gJ7fbXXsxJunSN4biE0dzEbZpX9ZqzR4cUDDN0JnAU,352
|
|
47
47
|
dclab/external/skimage/_shared/geometry.pyx,sha256=b6hADE8chse63haO1Kdt13_oQ54J9tkBf7dVA22-s-M,1722
|
|
48
48
|
dclab/external/statsmodels/LICENSE,sha256=8D7nwukc6YgsZCdN9mG0psM3I9j-z8fuUgFyVhnMXpU,1672
|
|
@@ -75,24 +75,25 @@ dclab/isoelastics/iso_HE-3D-FEM-22-volume-deform.txt,sha256=NlaE7yKz7N8yF65ri3H8
|
|
|
75
75
|
dclab/isoelastics/iso_LE-2D-FEM-19-area_um-deform.txt,sha256=lcTjUUnIwj_bVBrG2T2OWBK1ApuLjxJkvL2KAuU51OM,79694
|
|
76
76
|
dclab/isoelastics/iso_LE-2D-FEM-19-volume-deform.txt,sha256=vTcazOlOXo3BQ0NQtGB_IdHKA0neOLXZ_d3JuMU--RE,83358
|
|
77
77
|
dclab/isoelastics/iso_LE-2D-ana-18-area_um-deform.txt,sha256=KD2RkhCfkrna20pLJ3UzNZZapMkhQydMYz0iKdMtRRE,46805
|
|
78
|
-
dclab/lme4/__init__.py,sha256=
|
|
79
|
-
dclab/lme4/
|
|
80
|
-
dclab/lme4/rsetup.py,sha256=
|
|
81
|
-
dclab/lme4/wrapr.py,sha256=
|
|
78
|
+
dclab/lme4/__init__.py,sha256=_l1dvI1yL06D3wdtst-aUE02N-rZu-dZJXK8xvgvYVc,240
|
|
79
|
+
dclab/lme4/rlibs.py,sha256=FCV2919MMKbdvEvy61O0dYvt0EUZhiPHuP7OyyZ4esM,2632
|
|
80
|
+
dclab/lme4/rsetup.py,sha256=1svUQqJIuMPYNX_Kxs2Jcq1N4RsOtAv87gda5c1bpM8,7158
|
|
81
|
+
dclab/lme4/wrapr.py,sha256=zTlDmDFJgpVbLxjSxLeag17zKPkOfsK7Mr3r72jqdGY,17399
|
|
82
82
|
dclab/rtdc_dataset/__init__.py,sha256=BuWKEUm7QUe-Kj1wMR0AXON_XN2mzXlbOgouHdnvAw4,501
|
|
83
|
-
dclab/rtdc_dataset/check.py,sha256=
|
|
83
|
+
dclab/rtdc_dataset/check.py,sha256=dt535xuyjTs8kTf2LITruWeh4WRWci9rjfjczs170Xc,33240
|
|
84
84
|
dclab/rtdc_dataset/config.py,sha256=HVJiqKlqd-SpYqnNTKSr1yUsq2Bkfq5s5zluT-8PUc0,17965
|
|
85
|
-
dclab/rtdc_dataset/copier.py,sha256=
|
|
86
|
-
dclab/rtdc_dataset/core.py,sha256=
|
|
87
|
-
dclab/rtdc_dataset/export.py,sha256=
|
|
88
|
-
dclab/rtdc_dataset/feat_basin.py,sha256
|
|
85
|
+
dclab/rtdc_dataset/copier.py,sha256=zg9iuokrH6E-yqF-guZhvDs6JyaDK0kAK9tNzWEJI-I,12289
|
|
86
|
+
dclab/rtdc_dataset/core.py,sha256=yTxpOPqb6Ihaqmq5wJLRtkxHzpPQNUN3O3DyOw0dZJ4,38663
|
|
87
|
+
dclab/rtdc_dataset/export.py,sha256=4hvuRM2Ta7RW0H7Dp7sD4QojBdcbMDD6vhrxJACLVjI,30217
|
|
88
|
+
dclab/rtdc_dataset/feat_basin.py,sha256=-kMXEC06_ZG6cJQB0iW84VsvFet5fVJGpfKMvJ6WzoU,20520
|
|
89
89
|
dclab/rtdc_dataset/feat_temp.py,sha256=5QiF8Nc8MVoTtinYlvfoSuoopND-uvWVWKjMggBTHLw,3796
|
|
90
90
|
dclab/rtdc_dataset/filter.py,sha256=IRaEUt0tWtZGLKYvtqzfYO2kN5yhqx9eLoHd3VOLCTE,10286
|
|
91
91
|
dclab/rtdc_dataset/fmt_dict.py,sha256=-tlzOwsOCh4Vt3rSiBUvMKW7vBgrRNubU7ZHdGMB3gE,3112
|
|
92
92
|
dclab/rtdc_dataset/fmt_http.py,sha256=XzcgvJ4lm-eWbveBraBc5PPJeGWeUGC35p8ptnxBycc,3476
|
|
93
93
|
dclab/rtdc_dataset/fmt_s3.py,sha256=35ZNCSbfpn75QHqrciMur2MUAiViddCAZsXkzql6uv0,10962
|
|
94
|
+
dclab/rtdc_dataset/linker.py,sha256=sQ4GUc0p6ATRrhxM4dSh24dpLN4EL1LIUFiB3W-6ciI,4753
|
|
94
95
|
dclab/rtdc_dataset/load.py,sha256=IKRtlZbHGAHNCNaZQPRXFxJjnnMH5HXnhNuIwqYmHzo,2545
|
|
95
|
-
dclab/rtdc_dataset/writer.py,sha256=
|
|
96
|
+
dclab/rtdc_dataset/writer.py,sha256=Actk8Xan-TbZEOQs0joLf5IBMvfwMw7JFlfkiTi2aPQ,41393
|
|
96
97
|
dclab/rtdc_dataset/feat_anc_core/__init__.py,sha256=j7vtbQGJid3hchXryo19cxnwanepdDQ_RuJVf740mZs,488
|
|
97
98
|
dclab/rtdc_dataset/feat_anc_core/af_basic.py,sha256=7pM6Gn1ZkuttHNfkaLijPudddAu0jMDPGJS9HzKh8rE,2268
|
|
98
99
|
dclab/rtdc_dataset/feat_anc_core/af_emodulus.py,sha256=lsJpQ409EsxnMtyhO7igquWnJxIhXz_w9f8vtIq7F1M,6830
|
|
@@ -109,17 +110,17 @@ dclab/rtdc_dataset/fmt_dcor/api.py,sha256=v7xAxZtjPpQiSRq9AgYhrV6I9iM7KpPv38WzSE
|
|
|
109
110
|
dclab/rtdc_dataset/fmt_dcor/base.py,sha256=i9VWbKtPlY3K1WeFll3iAKXEhznVvJjQE1jVaEM2c9g,6788
|
|
110
111
|
dclab/rtdc_dataset/fmt_dcor/basin.py,sha256=JzofdU45r-TTBGl8Nnvo-j-YsnT23X2gXnvaOSINJxg,2599
|
|
111
112
|
dclab/rtdc_dataset/fmt_dcor/logs.py,sha256=e1BiJ8we4IghbxVAZM56K4P4IjJDHIBfHH_Uz-p2w9g,609
|
|
112
|
-
dclab/rtdc_dataset/fmt_dcor/tables.py,sha256=
|
|
113
|
+
dclab/rtdc_dataset/fmt_dcor/tables.py,sha256=rCkKnSoJpQPhjhCgG9hAd6L1wimlIMd7qM5vaNATgbM,1109
|
|
113
114
|
dclab/rtdc_dataset/fmt_hdf5/__init__.py,sha256=UnitCqiMkY8mMcUKgfLBRVBP5srpTNLrZd3BIRr2tZE,276
|
|
114
|
-
dclab/rtdc_dataset/fmt_hdf5/base.py,sha256=
|
|
115
|
+
dclab/rtdc_dataset/fmt_hdf5/base.py,sha256=hwcOc7vvdzqdWX-C3WBKJig7ecPivvpeGUigifYAzCE,6393
|
|
115
116
|
dclab/rtdc_dataset/fmt_hdf5/basin.py,sha256=qbYgj0RKS9k6RTu5XmYEtgdcbqnVNokD3rAxogyrWrU,822
|
|
116
|
-
dclab/rtdc_dataset/fmt_hdf5/events.py,sha256=
|
|
117
|
+
dclab/rtdc_dataset/fmt_hdf5/events.py,sha256=Fuhcv0RM6Z1kE3iPFm6MmZWbH6lgIC3GOJ-GOPmGQuc,8436
|
|
117
118
|
dclab/rtdc_dataset/fmt_hdf5/feat_defect.py,sha256=w7dfs6pULUVJ8Ypz2VBYIKokKVhCn6as6fn3GL8Z7s0,6704
|
|
118
119
|
dclab/rtdc_dataset/fmt_hdf5/logs.py,sha256=c33YLC70h7RR4uw-RPc-vvTPTMZgSfd_0Nz9pAeA6d4,1037
|
|
119
120
|
dclab/rtdc_dataset/fmt_hdf5/tables.py,sha256=9MJtLfDUyCr6bpBY7awaLSBBxeabbTo4yrkz0iYsRH8,902
|
|
120
121
|
dclab/rtdc_dataset/fmt_hierarchy/__init__.py,sha256=NB8Tz6-AquG0rAiCeCSQGIzw_W1y7mNz4V4MI-yaEJ0,366
|
|
121
|
-
dclab/rtdc_dataset/fmt_hierarchy/base.py,sha256=
|
|
122
|
-
dclab/rtdc_dataset/fmt_hierarchy/events.py,sha256=
|
|
122
|
+
dclab/rtdc_dataset/fmt_hierarchy/base.py,sha256=_fw48sCssdy9nxXhFmSsBztdFFpWK-GqbyHro23PVtA,9747
|
|
123
|
+
dclab/rtdc_dataset/fmt_hierarchy/events.py,sha256=TOmLsOLFlJPRbiXDyAD-_9qGxFgAwc54sffZfakdI8U,4630
|
|
123
124
|
dclab/rtdc_dataset/fmt_hierarchy/hfilter.py,sha256=EQhA8grohdMYOdbzJdB4rGv7hjtnDkpXWG7REOopmB4,5992
|
|
124
125
|
dclab/rtdc_dataset/fmt_hierarchy/mapper.py,sha256=lTnHKtTOpljcdzDflucsFKW4SfxP62bl_VpAvIhRBts,4344
|
|
125
126
|
dclab/rtdc_dataset/fmt_tdms/__init__.py,sha256=2aQki_mZeiPl0yxmDhdpveXiUOFnzjlj-fa28-mbGj4,19399
|
|
@@ -129,9 +130,9 @@ dclab/rtdc_dataset/fmt_tdms/event_mask.py,sha256=cW-Tw2PIe6X1Hc4UZJ22-mI_qFaIMWA
|
|
|
129
130
|
dclab/rtdc_dataset/fmt_tdms/event_trace.py,sha256=ktWnXfMir1v5Wfeo7tOd0txSOe1bgsXotf9Ul5T5-B4,5361
|
|
130
131
|
dclab/rtdc_dataset/fmt_tdms/exc.py,sha256=FfxUY4LGIMPGJTYmGITmEm7X5iu8GBsj7OfZR8Zb-IE,850
|
|
131
132
|
dclab/rtdc_dataset/fmt_tdms/naming.py,sha256=SFeWiwIN7sg0qNe0Aya2bZshN1Zbw4YcOKunZ6kfIGM,5524
|
|
132
|
-
dclab-
|
|
133
|
-
dclab-
|
|
134
|
-
dclab-
|
|
135
|
-
dclab-
|
|
136
|
-
dclab-
|
|
137
|
-
dclab-
|
|
133
|
+
dclab-2.18.0.dist-info/LICENSE,sha256=ayjnuJcdf_kpkDyD61tUcVqVAQaNSYXJ73m5HVB4G8s,18474
|
|
134
|
+
dclab-2.18.0.dist-info/METADATA,sha256=AgCQASKJSpYGXuc8qJNOS16uigVQaQ6EsXoSSQzuiuU,4972
|
|
135
|
+
dclab-2.18.0.dist-info/WHEEL,sha256=WRbBgi9HBHR6yzaPlBW1thcwhnq7JwQcoZZASdBlCwA,101
|
|
136
|
+
dclab-2.18.0.dist-info/entry_points.txt,sha256=eOpjgznu-eW-9utUpLU-77O5098YyUEgGF3ksGMdtec,273
|
|
137
|
+
dclab-2.18.0.dist-info/top_level.txt,sha256=irvwZMgs1edY1Zj60ZFk7Almb9Zhk4k6E6aC4YPFnnM,6
|
|
138
|
+
dclab-2.18.0.dist-info/RECORD,,
|