dclab 0.64.1__cp39-cp39-musllinux_1_2_x86_64.whl → 0.64.3__cp39-cp39-musllinux_1_2_x86_64.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 CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.64.1'
21
- __version_tuple__ = version_tuple = (0, 64, 1)
20
+ __version__ = version = '0.64.3'
21
+ __version_tuple__ = version_tuple = (0, 64, 3)
@@ -1,6 +1,11 @@
1
+ import re
2
+
1
3
  from . import feat_const
2
4
 
3
5
 
6
+ ML_SCORE_REGEX = re.compile(r"^ml_score_[a-z0-9]{3}$")
7
+
8
+
4
9
  def check_feature_shape(name, data):
5
10
  """Check if (non)-scalar feature matches with its data's dimensionality
6
11
 
@@ -17,11 +22,15 @@ def check_feature_shape(name, data):
17
22
  If the data's shape does not match its scalar description
18
23
  """
19
24
  if len(data.shape) == 1 and not scalar_feature_exists(name):
20
- raise ValueError(f"Feature '{name}' is not a scalar feature, but "
21
- "a 1D array was given for `data`!")
25
+ raise ValueError(
26
+ f"Feature '{name}' is not a scalar feature, but "
27
+ "a 1D array was given for `data`!"
28
+ )
22
29
  elif len(data.shape) != 1 and scalar_feature_exists(name):
23
- raise ValueError(f"Feature '{name}' is a scalar feature, but the "
24
- "`data` array is not 1D!")
30
+ raise ValueError(
31
+ f"Feature '{name}' is a scalar feature, but the "
32
+ "`data` array is not 1D!"
33
+ )
25
34
 
26
35
 
27
36
  def feature_exists(name, scalar_only=False):
@@ -56,15 +65,9 @@ def feature_exists(name, scalar_only=False):
56
65
  elif not scalar_only and name in feat_const.feature_names:
57
66
  # non-scalar feature
58
67
  valid = True
59
- else:
60
- # check whether we have an `ml_score_???` feature
61
- valid_chars = "0123456789abcdefghijklmnopqrstuvwxyz"
62
- if (name.startswith("ml_score_")
63
- and len(name) == len("ml_score_???")
64
- and name[-3] in valid_chars
65
- and name[-2] in valid_chars
66
- and name[-1] in valid_chars):
67
- valid = True
68
+ elif ML_SCORE_REGEX.match(name):
69
+ # machine-learning score feature ml_score_???
70
+ valid = True
68
71
  return valid
69
72
 
70
73
 
@@ -93,8 +96,10 @@ def feature_register(name, label=None, is_scalar=True):
93
96
  allowed_chars = "abcdefghijklmnopqrstuvwxyz_1234567890"
94
97
  feat = "".join([f for f in name if f in allowed_chars])
95
98
  if feat != name:
96
- raise ValueError("`feature` must only contain lower-case characters, "
97
- f"digits, and underscores; got '{name}'!")
99
+ raise ValueError(
100
+ "`feature` must only contain lower-case characters, "
101
+ f"digits, and underscores; got '{name}'!"
102
+ )
98
103
  if label is None:
99
104
  label = f"User-defined feature {name}"
100
105
  if feature_exists(name):
@@ -156,22 +161,16 @@ def get_feature_label(name, rtdc_ds=None, with_unit=True):
156
161
  TODO: extract feature label from ancillary information when an rtdc_ds is
157
162
  given.
158
163
  """
159
- # TODO: Is there another way of avoiding this circular import?
160
- from ..rtdc_dataset.feat_anc_core.ancillary_feature import AncillaryFeature
161
- assert feature_exists(name)
162
164
  if name in feat_const.feature_name2label:
163
165
  label = feat_const.feature_name2label[name]
166
+ elif ML_SCORE_REGEX.match(name):
167
+ # use a generic name for machine-learning features
168
+ label = f"ML score {name[-3:].upper()}"
164
169
  else:
165
- # First check whether an ancillary feature with that
166
- # name exists.
167
- for af in AncillaryFeature.features:
168
- if af.feature_name == name:
169
- labelid = af.data.outputs.index(name)
170
- label = af.data.output_labels[labelid]
171
- break
172
- else:
173
- # If that did not work, use a generic name.
174
- label = "ML score {}".format(name[-3:].upper())
170
+ exists = feature_exists(name)
171
+ msg = f"Could not find label for '{name}'"
172
+ msg += " (feature does not exist)" if not exists else ""
173
+ raise ValueError(msg)
175
174
  if not with_unit:
176
175
  if label.endswith("]") and label.count("["):
177
176
  label = label.rsplit("[", 1)[0].strip()
@@ -835,9 +835,9 @@ class RTDCBase(abc.ABC):
835
835
  identifier = self.config.get("experiment", {}).get("run identifier",
836
836
  None)
837
837
  if identifier is None:
838
- time = self.config.get("experiment", {}).get("time", None)
839
- date = self.config.get("experiment", {}).get("date", None)
840
- sid = self.config.get("setup", {}).get("identifier", None)
838
+ time = self.config.get("experiment", {}).get("time", None) or None
839
+ date = self.config.get("experiment", {}).get("date", None) or None
840
+ sid = self.config.get("setup", {}).get("identifier", None) or None
841
841
  if None not in [time, date, sid]:
842
842
  # only compute an identifier if all of the above are defined.
843
843
  hasher = hashlib.md5(f"{time}_{date}_{sid}".encode("utf-8"))
@@ -458,22 +458,30 @@ class Basin(abc.ABC):
458
458
  if not self._measurement_identifier_verified:
459
459
  if self.measurement_identifier is None:
460
460
  # No measurement identifier was presented by the
461
- # referencing dataset. Don't perform any checks.
461
+ # referencing dataset. We are in the dark.
462
+ # Don't perform any checks.
462
463
  self._measurement_identifier_verified = True
463
464
  else:
464
- if self.mapping == "same":
465
- # When we have identical mapping, then the measurement
466
- # identifier has to match exactly.
467
- verifier = str.__eq__
465
+ # This is the measurement identifier of the basin.
466
+ basin_identifier = self.get_measurement_identifier()
467
+ if basin_identifier is None:
468
+ # Again, we are in the dark, because the basin dataset
469
+ # does not have an identifier. This is an undesirable
470
+ # situation, but there is nothing we can do about it.
471
+ self._measurement_identifier_verified = True
468
472
  else:
469
- # When we have non-identical mapping (e.g. exported
470
- # data), then the measurement identifier has to
471
- # partially match.
472
- verifier = str.startswith
473
- self._measurement_identifier_verified = verifier(
474
- self.measurement_identifier,
475
- self.get_measurement_identifier()
476
- )
473
+ if self.mapping == "same":
474
+ # When we have identical mapping, then the
475
+ # measurement identifier has to match exactly.
476
+ verifier = str.__eq__
477
+ else:
478
+ # When we have non-identical mapping (e.g. exported
479
+ # data), then the measurement identifier has to
480
+ # partially match.
481
+ verifier = str.startswith
482
+ self._measurement_identifier_verified = verifier(
483
+ self.measurement_identifier, basin_identifier)
484
+
477
485
  check_rid = self._measurement_identifier_verified
478
486
  else:
479
487
  check_rid = True
@@ -538,8 +546,12 @@ class BasinProxy:
538
546
 
539
547
  def __getitem__(self, feat):
540
548
  if feat not in self._features:
541
- feat_obj = BasinProxyFeature(feat_obj=self.ds[feat],
542
- basinmap=self.basinmap)
549
+ if feat == "contour":
550
+ raise NotImplementedError("Feature 'contour' cannot be "
551
+ "handled by BasinProxy.")
552
+ else:
553
+ feat_obj = BasinProxyFeature(feat_obj=self.ds[feat],
554
+ basinmap=self.basinmap)
543
555
  self._features[feat] = feat_obj
544
556
  return self._features[feat]
545
557
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dclab
3
- Version: 0.64.1
3
+ Version: 0.64.3
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>
@@ -1,7 +1,7 @@
1
1
  dclab/__init__.py,sha256=wyJWhElQRPcq09vUqUnuquTU_KHgHxv6wQxuxQ988Iw,1583
2
- dclab/_version.py,sha256=9r4reeZylDKkIG06-4LPXZLfHirJkjSSEYOAOeaEme8,513
2
+ dclab/_version.py,sha256=JHoO4OvpmaE3KGtpKkOT4qLarDtYaIQTa9jOD_gb43s,513
3
3
  dclab/cached.py,sha256=eWTYBiI-HQM7JuPH-oxa5LLnhAX32GpRwlYg2kQ3sTA,2917
4
- dclab/downsampling.cpython-39-x86_64-linux-gnu.so,sha256=wnfaivm5GKLyiNuPzzM8bNYJnVHamtL8GjY7ndteK14,1483768
4
+ dclab/downsampling.cpython-39-x86_64-linux-gnu.so,sha256=Eo82laqRL7W9Pq7513j2OI_sO2EDYdbbpk265o80bAw,1483768
5
5
  dclab/downsampling.pyx,sha256=OK7zbgGLl5gVyoU8ZBHo9EWwb8C9ChavmLNEvQvC9T0,7258
6
6
  dclab/http_utils.py,sha256=XHicbHQts5LY3zSNmYqNgAZpKTktotEiwQgJ8d2sBlk,10912
7
7
  dclab/kde_contours.py,sha256=UlU64lrzMQUZH11oZndW7xf7NFCzwP3FcVujwuqXDCI,278
@@ -21,7 +21,7 @@ dclab/cli/task_tdms2rtdc.py,sha256=u0L1Fq9rXIeQG9b72SuUIh_qYC6fG2xXxht9_rcdCao,8
21
21
  dclab/cli/task_verify_dataset.py,sha256=aqBNCA5pjBL6r9wdEgzmSl5BWPIBEgPAmoQpeFw4Nts,2705
22
22
  dclab/definitions/__init__.py,sha256=56VL7rNTjP61gpGgN2GEUKicds2aBz_nWNwzfNxO_l8,2781
23
23
  dclab/definitions/feat_const.py,sha256=3zii5bXN0d0lMtkiI8dR9ivNlNQYosZASAlOg1UKKPA,9634
24
- dclab/definitions/feat_logic.py,sha256=SXsSlAusgtE3uXcPu84dQwYZ07zxmV37DmPednA3_dM,5823
24
+ dclab/definitions/feat_logic.py,sha256=_Rr2vK-nbRNjxk5Kf8Iohs_Q3jzUe9EZJgxB9vMwxwE,5379
25
25
  dclab/definitions/meta_const.py,sha256=zqE-SrD2tJMCFWdtp_IenwnbIQg0lulvbQAw9dK0Gho,13125
26
26
  dclab/definitions/meta_logic.py,sha256=wCgb7DPRHaR8DCWw_VbwNkpslUnazzWfgX0iS8oEe90,4194
27
27
  dclab/definitions/meta_parse.py,sha256=YdaTdM8DAMsIFn5ITH9OHYGTXeAOBGWtx22oVjxXcWk,2393
@@ -37,7 +37,7 @@ dclab/external/skimage/__init__.py,sha256=-B2QUKHAFzQuBWuuKvPDC5JIl0Zb-x3OGmbwPa
37
37
  dclab/external/skimage/_find_contours.py,sha256=16v5eeTZBmevG8SSuXtJ6yUpVPhwfSmtc8pDD0nuuOU,9340
38
38
  dclab/external/skimage/_find_contours_cy.cpython-39-x86_64-linux-gnu.so,sha256=JXzKyRa9rWsmzTzzkoDH4uDqME1wEMWUR4MPQRycx6k,1093120
39
39
  dclab/external/skimage/_find_contours_cy.pyx,sha256=pZJOBhMHzYEMkcz4WQVyjn7jDNrdjCfet47FU1hRAxk,7161
40
- dclab/external/skimage/_pnpoly.cpython-39-x86_64-linux-gnu.so,sha256=EHYkrjuLby_l_I0jaZSjoEvda-bYOfJSiqzy_JPow8k,1198928
40
+ dclab/external/skimage/_pnpoly.cpython-39-x86_64-linux-gnu.so,sha256=xIIm4PqK7E8qnaaiWZ_FYGSN907Gsr21Jbzp3BO2uYg,1198928
41
41
  dclab/external/skimage/_pnpoly.pyx,sha256=Qdn6xPazDschBqbr46DzB75MB2MnqvdnoTSBMK7kUGE,2504
42
42
  dclab/external/skimage/measure.py,sha256=y1idCqD9TUxp3-QnOiWR_d674OKaeqBJ4MN2-gVP6ro,247
43
43
  dclab/external/skimage/pnpoly.py,sha256=r8hFNiTz5XlUoNZjosqA0iyv1FPn0l7ewbplgFgkdaw,1347
@@ -87,9 +87,9 @@ dclab/rtdc_dataset/__init__.py,sha256=MUHSGVQJ4Zc0IyU2lf01dpDWyOyNveHip-UjSkmPNv
87
87
  dclab/rtdc_dataset/check.py,sha256=lJNaz4QTe2WNlxik6zSohRHTiAYuP_bKOzSDjPGTUS0,35006
88
88
  dclab/rtdc_dataset/config.py,sha256=MvBteFya3R6Ch3U6UgTakCsJoBgVykTxS_Z25STWPHU,17432
89
89
  dclab/rtdc_dataset/copier.py,sha256=-2ISiOs4ytxN_ttXQGhaepuD2Ppy80G9UlDSZVyEoOU,14175
90
- dclab/rtdc_dataset/core.py,sha256=p1Wy9Dq1Ny4i-cfvgPfCZov_lQAhGz0--x59j-g4mTs,34753
90
+ dclab/rtdc_dataset/core.py,sha256=LjddGHdqZINXKUQcvCyCDmOofdBzyJIXN_z_C-zWGnM,34777
91
91
  dclab/rtdc_dataset/export.py,sha256=Ukmdz-Mm9iei6vhfp1lh7oNQiAbXvA2o3tRx1XlBWCM,33416
92
- dclab/rtdc_dataset/feat_basin.py,sha256=i1J6iKQQEJXdi3u-TB9y_OdxbkFPBK6_G2jeaGcBsLY,26172
92
+ dclab/rtdc_dataset/feat_basin.py,sha256=iBGhuRkIy-zbonIjYHCQdLd3V3_cebpBfDTvqyLzJK4,26921
93
93
  dclab/rtdc_dataset/feat_temp.py,sha256=XbDIS1iUUkRH0Zp9uVlwvK_untJ7hkOnKshK1Drsnt8,3694
94
94
  dclab/rtdc_dataset/filter.py,sha256=AFPUBzOIi3pqXgUdMQ5CIi9ZeGOKC71rfSZKLMLgtog,10023
95
95
  dclab/rtdc_dataset/fmt_dict.py,sha256=gumVQOiVVDFUKow_483PY7cxInqo-NiBBnBhIU8s4lg,3009
@@ -134,9 +134,9 @@ dclab/rtdc_dataset/fmt_tdms/event_mask.py,sha256=eZiDHAGG3MCVckEMHsV-YBbL-pETVLo
134
134
  dclab/rtdc_dataset/fmt_tdms/event_trace.py,sha256=Vkym0QKSw2mq1XZl5n8wDkgHXmaZwQGiMAV5AuRSJkE,5215
135
135
  dclab/rtdc_dataset/fmt_tdms/exc.py,sha256=WzrMqnyrzp8gsT8Pf7JKqGGv43ewx7d_qgtirURppRI,813
136
136
  dclab/rtdc_dataset/fmt_tdms/naming.py,sha256=biI9l1EO6BuSYgwZG0deacj4i1fMHQcW78AKXEcm5Wc,5373
137
- dclab-0.64.1.dist-info/METADATA,sha256=WoNkTGPhcp_6fJpJQ2r9HPAJoxE_lRtwE4mQGj56tCE,4766
138
- dclab-0.64.1.dist-info/WHEEL,sha256=1lQ8uVaF0e0KhYU1_N6mtUH8lO3rq4o3quRVE11_OcQ,110
139
- dclab-0.64.1.dist-info/entry_points.txt,sha256=eOpjgznu-eW-9utUpLU-77O5098YyUEgGF3ksGMdtec,273
140
- dclab-0.64.1.dist-info/top_level.txt,sha256=irvwZMgs1edY1Zj60ZFk7Almb9Zhk4k6E6aC4YPFnnM,6
141
- dclab-0.64.1.dist-info/RECORD,,
142
- dclab-0.64.1.dist-info/licenses/LICENSE,sha256=gLDaVZWRrlnLdyfOrR0qfWjLbOVcjvoJ-kCLUK0fyXA,15360
137
+ dclab-0.64.3.dist-info/METADATA,sha256=j9pzLR5wQCpAnhWmOjvo8yH9ijCimv5H1_CGlxM-Los,4766
138
+ dclab-0.64.3.dist-info/WHEEL,sha256=1lQ8uVaF0e0KhYU1_N6mtUH8lO3rq4o3quRVE11_OcQ,110
139
+ dclab-0.64.3.dist-info/entry_points.txt,sha256=eOpjgznu-eW-9utUpLU-77O5098YyUEgGF3ksGMdtec,273
140
+ dclab-0.64.3.dist-info/top_level.txt,sha256=irvwZMgs1edY1Zj60ZFk7Almb9Zhk4k6E6aC4YPFnnM,6
141
+ dclab-0.64.3.dist-info/RECORD,,
142
+ dclab-0.64.3.dist-info/licenses/LICENSE,sha256=gLDaVZWRrlnLdyfOrR0qfWjLbOVcjvoJ-kCLUK0fyXA,15360
File without changes