dclab 0.64.1__cp312-cp312-macosx_11_0_arm64.whl → 0.64.3__cp312-cp312-macosx_11_0_arm64.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,5 +1,5 @@
1
1
  dclab/kde_methods.py,sha256=f0-zDN7ETintvGB3gSzxwgBb53YtT9jZtzI70EAX50g,365
2
- dclab/_version.py,sha256=9r4reeZylDKkIG06-4LPXZLfHirJkjSSEYOAOeaEme8,513
2
+ dclab/_version.py,sha256=JHoO4OvpmaE3KGtpKkOT4qLarDtYaIQTa9jOD_gb43s,513
3
3
  dclab/util.py,sha256=HFT5ZQV6AW8GIIruVMldukbVVdlMyKH50GUfOogAcxI,5860
4
4
  dclab/downsampling.pyx,sha256=OK7zbgGLl5gVyoU8ZBHo9EWwb8C9ChavmLNEvQvC9T0,7258
5
5
  dclab/__init__.py,sha256=wyJWhElQRPcq09vUqUnuquTU_KHgHxv6wQxuxQ988Iw,1583
@@ -9,7 +9,7 @@ dclab/http_utils.py,sha256=XHicbHQts5LY3zSNmYqNgAZpKTktotEiwQgJ8d2sBlk,10912
9
9
  dclab/polygon_filter.py,sha256=qexmo-rXe06CUPZhN6EMJy4y4B5gXZeqejdvIB2arOE,13480
10
10
  dclab/statistics.py,sha256=DWBG_Kj7cn89b_s5mqWYDCMGB881jHcCRFY-KAOBnhE,7598
11
11
  dclab/kde_contours.py,sha256=UlU64lrzMQUZH11oZndW7xf7NFCzwP3FcVujwuqXDCI,278
12
- dclab/downsampling.cpython-312-darwin.so,sha256=laVUjEHHWs4cP61s3sXjJKQo-RmeQ0BhGETOgRUSPgw,244288
12
+ dclab/downsampling.cpython-312-darwin.so,sha256=m2KoeJ1MrxUefFuVib9_yh9OKwp4dvzjpBNGS9Hxw4k,244288
13
13
  dclab/isoelastics/iso_LE-2D-FEM-19-volume-deform.txt,sha256=vTcazOlOXo3BQ0NQtGB_IdHKA0neOLXZ_d3JuMU--RE,83358
14
14
  dclab/isoelastics/iso_HE-3D-FEM-22-area_um-deform.txt,sha256=IjULG1KO-hClaYPoJJnwPbF2TkS9i9jxF1tbhhQTClY,71350
15
15
  dclab/isoelastics/iso_HE-2D-FEM-22-volume-deform.txt,sha256=aLOWxev_hvyP2yWquomcogn3Ze4SBfvqz-qmTOOibNw,97512
@@ -65,19 +65,19 @@ dclab/external/statsmodels/nonparametric/kernel_density.py,sha256=3UyzLuZS68TkNT
65
65
  dclab/external/statsmodels/nonparametric/__init__.py,sha256=-GEWgwsF27ems5WTBvR1zo4SWJ0pRTWyHVagnIYer3g,43
66
66
  dclab/external/statsmodels/nonparametric/kernels.py,sha256=fuy4kStFz2ZA9pqgfUb4cly-YBpXLu4TJ9-ZujayuIw,1075
67
67
  dclab/external/skimage/measure.py,sha256=y1idCqD9TUxp3-QnOiWR_d674OKaeqBJ4MN2-gVP6ro,247
68
- dclab/external/skimage/_pnpoly.cpython-312-darwin.so,sha256=xgBu609hu1fTitcRO92_y9YvO9Yzrqtx8VElSHNJwpU,207344
68
+ dclab/external/skimage/_pnpoly.cpython-312-darwin.so,sha256=Wx9eNPZ5yu3MIKnjdWD2kTeMgKNA9TaHMixvFeU900U,207344
69
69
  dclab/external/skimage/LICENSE,sha256=ivsSBvn3c0R9mOctWRRdza7C7wdZSRYgCVxlVqUdlB8,1452
70
70
  dclab/external/skimage/pnpoly.py,sha256=r8hFNiTz5XlUoNZjosqA0iyv1FPn0l7ewbplgFgkdaw,1347
71
71
  dclab/external/skimage/_find_contours.py,sha256=16v5eeTZBmevG8SSuXtJ6yUpVPhwfSmtc8pDD0nuuOU,9340
72
72
  dclab/external/skimage/__init__.py,sha256=-B2QUKHAFzQuBWuuKvPDC5JIl0Zb-x3OGmbwPaE9VwQ,72
73
- dclab/external/skimage/_find_contours_cy.cpython-312-darwin.so,sha256=EC6mACVljkYYgDyCnpNN9SoUOUr4rTKRd0S56qSV3Sk,189016
73
+ dclab/external/skimage/_find_contours_cy.cpython-312-darwin.so,sha256=a1E0SNa0KlIFuBJtBkN3zNAzux2ExEuJoHKNOvazmic,189016
74
74
  dclab/external/skimage/_pnpoly.pyx,sha256=Qdn6xPazDschBqbr46DzB75MB2MnqvdnoTSBMK7kUGE,2504
75
75
  dclab/external/skimage/_find_contours_cy.pyx,sha256=pZJOBhMHzYEMkcz4WQVyjn7jDNrdjCfet47FU1hRAxk,7161
76
76
  dclab/external/skimage/_shared/geometry.pxd,sha256=kRsu9ifv_rL3kbRIgSLf86p0hn2oTMp6s013lZ9bBZM,346
77
77
  dclab/external/skimage/_shared/__init__.py,sha256=2sHZwTtJSlMTa3Q2YSvQW7jrPLMUSqDJQa-ROe5zfcw,37
78
- dclab/external/skimage/_shared/geometry.cpython-312-darwin.so,sha256=UjeGBbiiX-coaSQ509IJgiIvQRnEYBcGZVWyeJhXmL0,55360
78
+ dclab/external/skimage/_shared/geometry.cpython-312-darwin.so,sha256=OGHnzibizqJ-PKVU3k6d2cUvakMfsPreWtM5MZkCJvo,55360
79
79
  dclab/external/skimage/_shared/geometry.pyx,sha256=miCHUh6mBDbRRIoaF_0xAER1MRzsCAzFdlYQZhV7RmE,1667
80
- dclab/definitions/feat_logic.py,sha256=SXsSlAusgtE3uXcPu84dQwYZ07zxmV37DmPednA3_dM,5823
80
+ dclab/definitions/feat_logic.py,sha256=_Rr2vK-nbRNjxk5Kf8Iohs_Q3jzUe9EZJgxB9vMwxwE,5379
81
81
  dclab/definitions/meta_parse.py,sha256=YdaTdM8DAMsIFn5ITH9OHYGTXeAOBGWtx22oVjxXcWk,2393
82
82
  dclab/definitions/__init__.py,sha256=56VL7rNTjP61gpGgN2GEUKicds2aBz_nWNwzfNxO_l8,2781
83
83
  dclab/definitions/meta_const.py,sha256=zqE-SrD2tJMCFWdtp_IenwnbIQg0lulvbQAw9dK0Gho,13125
@@ -86,11 +86,11 @@ dclab/definitions/meta_logic.py,sha256=wCgb7DPRHaR8DCWw_VbwNkpslUnazzWfgX0iS8oEe
86
86
  dclab/rtdc_dataset/config.py,sha256=MvBteFya3R6Ch3U6UgTakCsJoBgVykTxS_Z25STWPHU,17432
87
87
  dclab/rtdc_dataset/check.py,sha256=lJNaz4QTe2WNlxik6zSohRHTiAYuP_bKOzSDjPGTUS0,35006
88
88
  dclab/rtdc_dataset/meta_table.py,sha256=ucqBNrgI6rDAuQFuMRckY8lp1LpnYAoRgEsLObWTJCE,648
89
- dclab/rtdc_dataset/feat_basin.py,sha256=i1J6iKQQEJXdi3u-TB9y_OdxbkFPBK6_G2jeaGcBsLY,26172
89
+ dclab/rtdc_dataset/feat_basin.py,sha256=iBGhuRkIy-zbonIjYHCQdLd3V3_cebpBfDTvqyLzJK4,26921
90
90
  dclab/rtdc_dataset/fmt_s3.py,sha256=bU3V_WGyqJhxPCH80X_nlNqq-jXcgoZKv_aUBIqwaL8,11877
91
91
  dclab/rtdc_dataset/feat_temp.py,sha256=XbDIS1iUUkRH0Zp9uVlwvK_untJ7hkOnKshK1Drsnt8,3694
92
92
  dclab/rtdc_dataset/__init__.py,sha256=MUHSGVQJ4Zc0IyU2lf01dpDWyOyNveHip-UjSkmPNvQ,486
93
- dclab/rtdc_dataset/core.py,sha256=p1Wy9Dq1Ny4i-cfvgPfCZov_lQAhGz0--x59j-g4mTs,34753
93
+ dclab/rtdc_dataset/core.py,sha256=LjddGHdqZINXKUQcvCyCDmOofdBzyJIXN_z_C-zWGnM,34777
94
94
  dclab/rtdc_dataset/export.py,sha256=Ukmdz-Mm9iei6vhfp1lh7oNQiAbXvA2o3tRx1XlBWCM,33416
95
95
  dclab/rtdc_dataset/fmt_dict.py,sha256=gumVQOiVVDFUKow_483PY7cxInqo-NiBBnBhIU8s4lg,3009
96
96
  dclab/rtdc_dataset/writer.py,sha256=BqP4QSzHxCSxp9z7_cJF2v04taO3ZXE3Wg6zJY6fMao,41819
@@ -134,9 +134,9 @@ dclab/rtdc_dataset/fmt_tdms/event_image.py,sha256=-jp7Z-N91e4ieumYQ1huMicj7PMJqw
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/event_contour.py,sha256=kjo0wJx9F0gmmOOyR0NoLw6VEtSl3h63WXXkcbfnoS8,9627
137
- dclab-0.64.1.dist-info/RECORD,,
138
- dclab-0.64.1.dist-info/WHEEL,sha256=V1loQ6TpxABu1APUg0MoTRBOzSKT5xVc3skizX-ovCU,136
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/METADATA,sha256=WoNkTGPhcp_6fJpJQ2r9HPAJoxE_lRtwE4mQGj56tCE,4766
142
- dclab-0.64.1.dist-info/licenses/LICENSE,sha256=gLDaVZWRrlnLdyfOrR0qfWjLbOVcjvoJ-kCLUK0fyXA,15360
137
+ dclab-0.64.3.dist-info/RECORD,,
138
+ dclab-0.64.3.dist-info/WHEEL,sha256=V1loQ6TpxABu1APUg0MoTRBOzSKT5xVc3skizX-ovCU,136
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/METADATA,sha256=j9pzLR5wQCpAnhWmOjvo8yH9ijCimv5H1_CGlxM-Los,4766
142
+ dclab-0.64.3.dist-info/licenses/LICENSE,sha256=gLDaVZWRrlnLdyfOrR0qfWjLbOVcjvoJ-kCLUK0fyXA,15360
File without changes