dcnum 0.23.1__py3-none-any.whl → 0.23.2__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 CHANGED
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.23.1'
16
- __version_tuple__ = version_tuple = (0, 23, 1)
15
+ __version__ = version = '0.23.2'
16
+ __version_tuple__ = version_tuple = (0, 23, 2)
dcnum/logic/ctrl.py CHANGED
@@ -1,6 +1,7 @@
1
1
  import collections
2
2
  import datetime
3
3
  import hashlib
4
+ import importlib
4
5
  import json
5
6
  import logging
6
7
  from logging.handlers import QueueListener
@@ -430,6 +431,16 @@ class DCNumJobRunner(threading.Thread):
430
431
  "build": ", ".join(platform.python_build()),
431
432
  "implementation":
432
433
  platform.python_implementation(),
434
+ "libraries": get_library_versions_dict([
435
+ "cv2",
436
+ "h5py",
437
+ "mahotas",
438
+ "numba",
439
+ "numpy",
440
+ "scipy",
441
+ "skimage",
442
+ "torch",
443
+ ]),
433
444
  "version": platform.python_version(),
434
445
  },
435
446
  "system": {
@@ -780,6 +791,19 @@ class DCNumJobRunner(threading.Thread):
780
791
  self.logger.info("Finished segmentation and feature extraction")
781
792
 
782
793
 
794
+ def get_library_versions_dict(library_name_list):
795
+ version_dict = {}
796
+ for library_name in library_name_list:
797
+ try:
798
+ lib = importlib.import_module(library_name)
799
+ except BaseException:
800
+ version = None
801
+ else:
802
+ version = lib.__version__
803
+ version_dict[library_name] = version
804
+ return version_dict
805
+
806
+
783
807
  def join_thread_helper(thr, timeout, retries, logger, name):
784
808
  for _ in range(retries):
785
809
  thr.join(timeout=timeout)
dcnum/logic/job.py CHANGED
@@ -182,3 +182,25 @@ class DCNumPipelineJob:
182
182
  if len(ret) == 1:
183
183
  ret = ret[0]
184
184
  return ret
185
+
186
+ def validate(self):
187
+ """Make sure the pipeline will run given the job kwargs
188
+
189
+ Returns
190
+ -------
191
+ True:
192
+ for testing convenience
193
+
194
+ Raises
195
+ ------
196
+ dcnum.segm.SegmenterNotApplicableError:
197
+ the segmenter is incompatible with the input path
198
+ """
199
+ # Check segmenter applicability applicability
200
+ seg_cls = get_available_segmenters()[self.kwargs["segmenter_code"]]
201
+ with HDF5Data(self.kwargs["path_in"]) as hd:
202
+ seg_cls.validate_applicability(
203
+ segmenter_kwargs=self.kwargs["segmenter_kwargs"],
204
+ logs=hd.logs,
205
+ meta=hd.meta)
206
+ return True
@@ -1,16 +1,20 @@
1
1
  import importlib
2
+ import warnings
2
3
 
3
4
  try:
4
5
  torch = importlib.import_module("torch")
5
6
  req_maj = 2
6
- req_min = 3
7
+ req_min = 2
7
8
  ver_tuple = torch.__version__.split(".")
8
9
  act_maj = int(ver_tuple[0])
9
10
  act_min = int(ver_tuple[1])
10
11
  if act_maj < req_maj or (act_maj == req_maj and act_min < req_min):
11
- raise ValueError(f"Your PyTorch version {act_maj}.{act_min} is not "
12
- f"supported, please update to at least "
13
- f"{req_maj}.{req_min}")
12
+ warnings.warn(f"Your PyTorch version {act_maj}.{act_min} is "
13
+ f"not supported, please update to at least "
14
+ f"{req_maj}.{req_min} to use dcnum's PyTorch"
15
+ f"segmenters")
16
+ raise ImportError(
17
+ f"Could not find PyTorch {req_maj}.{req_min}")
14
18
  except ImportError:
15
19
  pass
16
20
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcnum
3
- Version: 0.23.1
3
+ Version: 0.23.2
4
4
  Summary: numerics toolbox for imaging deformability cytometry
5
5
  Author: Maximilian Schlögel, Paul Müller, Raghava Alajangi
6
6
  Maintainer-email: Paul Müller <dev@craban.de>
@@ -26,7 +26,7 @@ Requires-Dist: opencv-python-headless
26
26
  Requires-Dist: scikit-image
27
27
  Requires-Dist: scipy >=1.8.0
28
28
  Provides-Extra: torch
29
- Requires-Dist: torch >=2.3 ; extra == 'torch'
29
+ Requires-Dist: torch >=2.2 ; extra == 'torch'
30
30
 
31
31
  |dcnum|
32
32
  =======
@@ -1,5 +1,5 @@
1
1
  dcnum/__init__.py,sha256=hcawIKS7utYiOyVhOAX9t7K3xYzP1b9862VV0b6qSrQ,74
2
- dcnum/_version.py,sha256=FvSfCBPqaPzqv_nSHIaBJNolXopVkF1cRxifqhCXk4g,413
2
+ dcnum/_version.py,sha256=GmxD5FOokmDsV6mmMcLj8aWXLveU0OeVRPLBT4HJfDk,413
3
3
  dcnum/feat/__init__.py,sha256=jUJYWTD3VIoDNKrmryXbjHb1rGwYtK4b7VPWihYgUoo,325
4
4
  dcnum/feat/event_extractor_manager_thread.py,sha256=5HdCQCywyQ5QC56AMjSqCroqif9oOFyiSFWCe07JojM,7820
5
5
  dcnum/feat/gate.py,sha256=Yhxq80JoRMmQzBxl35C8NT91c9QcmQa-EIKLuxK6WvE,7221
@@ -20,8 +20,8 @@ dcnum/feat/feat_texture/__init__.py,sha256=6StM9S540UVtdFFR3bHa7nfCTomeVdoo7Uy9C
20
20
  dcnum/feat/feat_texture/common.py,sha256=COXHpXS-7DMouGu3WF83I76L02Sr7P9re4lxajh6g0E,439
21
21
  dcnum/feat/feat_texture/tex_all.py,sha256=_5H3sXYRN0Uq2eUHn3XUyEHkU_tncEqbqJTC-HZcnGY,5198
22
22
  dcnum/logic/__init__.py,sha256=7J3GrwJInNQbrLk61HRIV7X7p69TAIbMYpR34hh6u14,177
23
- dcnum/logic/ctrl.py,sha256=FyVlizHOIaIGMqINvM-outPywAQU0-5NM7t1dEDml4c,35332
24
- dcnum/logic/job.py,sha256=H1uDZ1nnNHNWWCe6mS8OWB0Uxc6XUKLISx5xExeplZY,7015
23
+ dcnum/logic/ctrl.py,sha256=9QFNudpaZfL3hKYskOgMiscOOQPU2xbupVzI23aNWiE,36193
24
+ dcnum/logic/job.py,sha256=9BN2WjYqjjJuLnfNZAtQ2Nn47Glo2jVrivDodGJoqlQ,7713
25
25
  dcnum/logic/json_encoder.py,sha256=cxMnqisbKEVf-rVcw6rK2BBAb6iz_hKFaGl81kK36lQ,571
26
26
  dcnum/meta/__init__.py,sha256=AVqRgyKXO1orKnE305h88IBvoZ1oz6X11HN1WP5nGvg,60
27
27
  dcnum/meta/paths.py,sha256=J_ikeHzd7gEeRgAKjuayz3x6q4h1fOiDadM-ZxhAGm4,1053
@@ -37,7 +37,7 @@ dcnum/segm/segmenter.py,sha256=FWLFDBR-x_85ku2rObA2F-QBrM4IUaUL-YHChLagVvM,14902
37
37
  dcnum/segm/segmenter_manager_thread.py,sha256=frM0sMxC7f7TQiFjmpRxuwG2kUBFpW1inV8dtpADHiI,5924
38
38
  dcnum/segm/segmenter_mpo.py,sha256=o6mQlITHgEWvQt9v6oCWwAcZUvxE7MOeLE9DFManzpY,13757
39
39
  dcnum/segm/segmenter_sto.py,sha256=e6MtN_RWusA0wTExV-FLGpDXNJs1CbSyXcSdWUPBMvM,3959
40
- dcnum/segm/segm_torch/__init__.py,sha256=re9jVLYvV1GgC7J5vx2LHKeFYVZPpiwubecAV9f_2kA,670
40
+ dcnum/segm/segm_torch/__init__.py,sha256=DtUqJTbj7ybrTbXlwHq1Y4SCzi22rMW9Cus6wX-iU-A,822
41
41
  dcnum/segm/segm_torch/segm_torch_base.py,sha256=G9AhVyD6LkAmk0tkbYnJUSpvcj3_HYf0uqfILZQsyus,4479
42
42
  dcnum/segm/segm_torch/segm_torch_mpo.py,sha256=N01dVXai_4eIGfHJrPjg5C2Bkyq1TOeXeJhw3YbGidw,2504
43
43
  dcnum/segm/segm_torch/segm_torch_sto.py,sha256=PTOJrP_FkaxZZul8lM4VA2HL3KyxrheDDWWdJbmJdiw,3393
@@ -48,8 +48,8 @@ dcnum/write/__init__.py,sha256=QvWHeZmjHI18i-YlGYuzN3i7dVWY9UCReKchrJ-gif0,260
48
48
  dcnum/write/deque_writer_thread.py,sha256=ao7F1yrVKyufgC4rC0Y2_Vt7snuT6KpI7W2qVxcjdhk,1994
49
49
  dcnum/write/queue_collector_thread.py,sha256=d_WfdsZdFnFsiAY0zVMwUlA4juIMeiWYmE_-rezBQCE,11734
50
50
  dcnum/write/writer.py,sha256=e6J8YVqhS7kzkpPIMoDMokJpqSy1WWNdOrwaJof1oVc,15601
51
- dcnum-0.23.1.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
52
- dcnum-0.23.1.dist-info/METADATA,sha256=NL79bLTjTqm5R4HW0TNcVZ9YXqbxH7Xcfl6xuk-hfw4,2280
53
- dcnum-0.23.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
- dcnum-0.23.1.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
55
- dcnum-0.23.1.dist-info/RECORD,,
51
+ dcnum-0.23.2.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
52
+ dcnum-0.23.2.dist-info/METADATA,sha256=HLyOwJN79qpOR5yXjWtt5XjkT3nRQujPlxuvQZSYLbI,2280
53
+ dcnum-0.23.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
54
+ dcnum-0.23.2.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
55
+ dcnum-0.23.2.dist-info/RECORD,,
File without changes