dclab 0.64.1__cp39-cp39-win_amd64.whl → 0.64.3__cp39-cp39-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 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()
Binary file
@@ -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=kSr6VI0UI-beS9beOEpERTUAV1NINHx_G6u1VmBm9D8,1624
2
- dclab/_version.py,sha256=mXVRd4XXSvubXnCvvibtN_3CiyIT4FFBF_TNPrxM6fk,534
2
+ dclab/_version.py,sha256=oG0oCE22mpI4pwLElHVZZIGtwJilY1oh6bGSL4EuTro,534
3
3
  dclab/cached.py,sha256=t01BYTf43VEsBYa0c-bMxgceF5vKoGV73b42UlLH6Lo,3014
4
- dclab/downsampling.cp39-win_amd64.pyd,sha256=upCIg3eG8DacoOm8Gqb8Vko9V7Hyheq7IUAvzjX8_pw,171520
4
+ dclab/downsampling.cp39-win_amd64.pyd,sha256=JFSmQx1bd5ViAVyFG_Y72O2_oNlPzp6bd8bGg7ePJgw,175104
5
5
  dclab/downsampling.pyx,sha256=Ez6MbNbzCUzs2IXXKtAYsjtYqP22kI8hdA1IE-3mqvY,7488
6
6
  dclab/http_utils.py,sha256=aIW4ATmyk02AjQmoTm7mAWdsaQD1siEPLx47IlEcYls,11234
7
7
  dclab/kde_contours.py,sha256=cYeBtvbBqLHCz5W8AiEAAd9O3yLsSBbLcRVj1WZ1pRo,288
@@ -21,7 +21,7 @@ dclab/cli/task_tdms2rtdc.py,sha256=5YjDCLl9NoZMbeZtl7csH5qx_8dvzF3p-8ndsneOhBI,8
21
21
  dclab/cli/task_verify_dataset.py,sha256=OFy7aWHvA6NInndnMBg0MVZSBibvJeNHhc_C79_9PAk,2780
22
22
  dclab/definitions/__init__.py,sha256=cubgnqpBbPgk_c1_uUPggRsmtUd-baV1haybLqbMf8k,2860
23
23
  dclab/definitions/feat_const.py,sha256=I772sd6aSNv8PzhT9MHnNKbGhx6ZJt3z3_FVs5oxMtw,9836
24
- dclab/definitions/feat_logic.py,sha256=uMHXInzESTtBWPBsk9PxqSFFrSM1vNbTDxOlso9zhT0,6006
24
+ dclab/definitions/feat_logic.py,sha256=ZZlf3-uze5qFvRtlTHJQZmE9mTF3L7TMyk8YTnCCRzw,5561
25
25
  dclab/definitions/meta_const.py,sha256=X3U3orhlY_i78TYN4DUBJaOGBltNnXaRsQauH1LxuJ0,13377
26
26
  dclab/definitions/meta_logic.py,sha256=no6fTCmKFrwpmirs_9358-Ysh5aZeib1xJrL_30WkqU,4305
27
27
  dclab/definitions/meta_parse.py,sha256=UtgSm7hkfqnyj6FAbDmctbXqfZOHU9d4uoMf3EcYWtQ,2487
@@ -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.cp39-win_amd64.pyd,sha256=0YfUCbrti-dTaJEB8xG1czK1CkcMp0qu8nbAEzWWogY,132096
38
+ dclab/external/skimage/_find_contours_cy.cp39-win_amd64.pyd,sha256=MW4KawPp-uZik_R119rlOL0KrATmjvKFA9QOQx3hMZQ,137728
39
39
  dclab/external/skimage/_find_contours_cy.pyx,sha256=c-EobLhKjZNCpuqWxmvrcH35uAY_Bu-_hZiUHbXODms,7349
40
- dclab/external/skimage/_pnpoly.cp39-win_amd64.pyd,sha256=7glj7SosQOuxQgBRBH079JIvK3889uzyEXEViVI2OmQ,145920
40
+ dclab/external/skimage/_pnpoly.cp39-win_amd64.pyd,sha256=SnEHU_5ic0fPF5IoQIpPR065xVmQzixcJSKF7xiKkZc,151040
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.cp39-win_amd64.pyd,sha256=wWOwFP5XkzYF74IG2gjTMbfscqbTIAipM3bOOmcvvIU,19456
45
+ dclab/external/skimage/_shared/geometry.cp39-win_amd64.pyd,sha256=X_aNKfU7UGhbSvFn83enivqr2dDo09n3A0eDXPShuLg,19968
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
@@ -87,9 +87,9 @@ dclab/rtdc_dataset/__init__.py,sha256=BuWKEUm7QUe-Kj1wMR0AXON_XN2mzXlbOgouHdnvAw
87
87
  dclab/rtdc_dataset/check.py,sha256=l2QoIL3gno_Z2-e8RvYHAurHZP_oLGtZk8l6jUDiuTA,35908
88
88
  dclab/rtdc_dataset/config.py,sha256=HVJiqKlqd-SpYqnNTKSr1yUsq2Bkfq5s5zluT-8PUc0,17965
89
89
  dclab/rtdc_dataset/copier.py,sha256=imD0ijAz9BY0nksF2zUBeoGmeo_dUTUnBgY9TqRaD4g,14528
90
- dclab/rtdc_dataset/core.py,sha256=qbxcCBJOSb8433CEnTGaYTw5OeSDZNDL22rc9UlPXyg,35647
90
+ dclab/rtdc_dataset/core.py,sha256=jOE21lhOC3ViA68QiykGVOs437SlCotTYRTcA9Tk2MQ,35671
91
91
  dclab/rtdc_dataset/export.py,sha256=zY88vbIJvO6duqrjzrUboa0WnFI0fEf3cao_0x7Qyfk,34250
92
- dclab/rtdc_dataset/feat_basin.py,sha256=Q7Eqt9iyNh-ooXLOb3IUXEu5UgkYq4m5jj5VOViJFAo,26857
92
+ dclab/rtdc_dataset/feat_basin.py,sha256=nMDw5T_lvhbllG1SmCy6dBrOc5yeNp7eX0uWyTTE1tY,27618
93
93
  dclab/rtdc_dataset/feat_temp.py,sha256=5QiF8Nc8MVoTtinYlvfoSuoopND-uvWVWKjMggBTHLw,3796
94
94
  dclab/rtdc_dataset/filter.py,sha256=IRaEUt0tWtZGLKYvtqzfYO2kN5yhqx9eLoHd3VOLCTE,10286
95
95
  dclab/rtdc_dataset/fmt_dict.py,sha256=-tlzOwsOCh4Vt3rSiBUvMKW7vBgrRNubU7ZHdGMB3gE,3112
@@ -134,9 +134,9 @@ dclab/rtdc_dataset/fmt_tdms/event_mask.py,sha256=cW-Tw2PIe6X1Hc4UZJ22-mI_qFaIMWA
134
134
  dclab/rtdc_dataset/fmt_tdms/event_trace.py,sha256=ktWnXfMir1v5Wfeo7tOd0txSOe1bgsXotf9Ul5T5-B4,5361
135
135
  dclab/rtdc_dataset/fmt_tdms/exc.py,sha256=FfxUY4LGIMPGJTYmGITmEm7X5iu8GBsj7OfZR8Zb-IE,850
136
136
  dclab/rtdc_dataset/fmt_tdms/naming.py,sha256=SFeWiwIN7sg0qNe0Aya2bZshN1Zbw4YcOKunZ6kfIGM,5524
137
- dclab-0.64.1.dist-info/licenses/LICENSE,sha256=Aq3cYb2xLk3Y_aIOhaoZxi8FlVeMVs3-3FMEBvAEixM,15643
138
- dclab-0.64.1.dist-info/METADATA,sha256=g2ygLFICqk7MKmTDzdSZIdHfR4YVuCpqytG8HSy69qo,4913
139
- dclab-0.64.1.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
140
- dclab-0.64.1.dist-info/entry_points.txt,sha256=eOpjgznu-eW-9utUpLU-77O5098YyUEgGF3ksGMdtec,273
141
- dclab-0.64.1.dist-info/top_level.txt,sha256=irvwZMgs1edY1Zj60ZFk7Almb9Zhk4k6E6aC4YPFnnM,6
142
- dclab-0.64.1.dist-info/RECORD,,
137
+ dclab-0.64.3.dist-info/licenses/LICENSE,sha256=Aq3cYb2xLk3Y_aIOhaoZxi8FlVeMVs3-3FMEBvAEixM,15643
138
+ dclab-0.64.3.dist-info/METADATA,sha256=HRU1DmQGPSVWb9pHmDnJkEQfXphuKkoohQXxuK-Diko,4913
139
+ dclab-0.64.3.dist-info/WHEEL,sha256=XkFE14KmFh7mutkkb-qn_ueuH2lwfT8rLdfc5xpQ7wE,99
140
+ dclab-0.64.3.dist-info/entry_points.txt,sha256=eOpjgznu-eW-9utUpLU-77O5098YyUEgGF3ksGMdtec,273
141
+ dclab-0.64.3.dist-info/top_level.txt,sha256=irvwZMgs1edY1Zj60ZFk7Almb9Zhk4k6E6aC4YPFnnM,6
142
+ dclab-0.64.3.dist-info/RECORD,,
File without changes