dcnum 0.25.0__py3-none-any.whl → 0.25.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.25.0'
16
- __version_tuple__ = version_tuple = (0, 25, 0)
15
+ __version__ = version = '0.25.2'
16
+ __version_tuple__ = version_tuple = (0, 25, 2)
dcnum/logic/ctrl.py CHANGED
@@ -679,8 +679,14 @@ class DCNumJobRunner(threading.Thread):
679
679
  self.logger.debug(f"Creating basin for {feats}")
680
680
  # Relative and absolute paths.
681
681
  pin = pathlib.Path(hin.filename).resolve()
682
+ paths = [pin]
682
683
  pout = pathlib.Path(hout.filename).resolve().parent
683
- paths = [pin, os.path.relpath(pin, pout)]
684
+ try:
685
+ paths.append(os.path.relpath(pin, pout))
686
+ except ValueError:
687
+ # This means it is impossible to compute a relative
688
+ # path (e.g. different drive letter on Windows).
689
+ pass
684
690
  hw.store_basin(name="dcnum basin",
685
691
  features=feats,
686
692
  mapping=basinmap0,
@@ -776,7 +782,6 @@ class DCNumJobRunner(threading.Thread):
776
782
 
777
783
  # Start the data collection thread
778
784
  thr_coll = QueueCollectorThread(
779
- data=self.dtin,
780
785
  event_queue=fe_kwargs["event_queue"],
781
786
  writer_dq=writer_dq,
782
787
  feat_nevents=fe_kwargs["feat_nevents"],
@@ -8,8 +8,6 @@ from typing import List
8
8
 
9
9
  import numpy as np
10
10
 
11
- from ..read import HDF5Data
12
-
13
11
 
14
12
  class EventStash:
15
13
  def __init__(self,
@@ -61,11 +59,10 @@ class EventStash:
61
59
  Event dictionary
62
60
  """
63
61
  idx_loc = index - self.index_offset
64
- idx_stop = self.nev_idx[idx_loc]
65
- self._tracker[idx_loc] = True
66
62
 
67
63
  if events:
68
64
  slice_loc = None
65
+ idx_stop = self.nev_idx[idx_loc]
69
66
  for feat in events:
70
67
  dev = events[feat]
71
68
  if dev.size:
@@ -76,6 +73,8 @@ class EventStash:
76
73
  if slice_loc:
77
74
  self.indices_for_data[slice_loc] = index
78
75
 
76
+ self._tracker[idx_loc] = True
77
+
79
78
  def require_feature(self, feat, sample_data):
80
79
  """Create a new empty feature array in `self.events` and return it
81
80
 
@@ -87,10 +86,10 @@ class EventStash:
87
86
  Sample data for one event of the feature (used to determine
88
87
  shape and dtype of the feature array)
89
88
  """
90
- sample_data = np.array(sample_data)
91
- event_shape = sample_data.shape
92
- dtype = sample_data.dtype
93
89
  if feat not in self.events:
90
+ sample_data = np.array(sample_data)
91
+ event_shape = sample_data.shape
92
+ dtype = sample_data.dtype
94
93
  darr = np.zeros((self.size,) + tuple(event_shape),
95
94
  dtype=dtype)
96
95
  self.events[feat] = darr
@@ -99,7 +98,6 @@ class EventStash:
99
98
 
100
99
  class QueueCollectorThread(threading.Thread):
101
100
  def __init__(self,
102
- data: HDF5Data,
103
101
  event_queue: mp.Queue,
104
102
  writer_dq: deque,
105
103
  feat_nevents: mp.Array,
@@ -115,9 +113,6 @@ class QueueCollectorThread(threading.Thread):
115
113
 
116
114
  Parameters
117
115
  ----------
118
- data:
119
- Data source object. This is used for appending additional
120
- information
121
116
  event_queue:
122
117
  A queue object to which other processes or threads write
123
118
  events as tuples `(frame_index, events_dict)`.
@@ -146,8 +141,6 @@ class QueueCollectorThread(threading.Thread):
146
141
  super(QueueCollectorThread, self).__init__(
147
142
  name="QueueCollector", *args, **kwargs)
148
143
  self.logger = logging.getLogger("dcnum.write.QueueCollector")
149
- #: HDF5 data instance
150
- self.data = data
151
144
  #: Event queue from which to collect event data
152
145
  self.event_queue = event_queue
153
146
  #: Writer deque to which event arrays are appended
@@ -169,7 +162,7 @@ class QueueCollectorThread(threading.Thread):
169
162
  # We are not writing to `event_queue` so we can safely cancel
170
163
  # our queue thread if we are told to stop.
171
164
  self.event_queue.cancel_join_thread()
172
- # Indexes the current frame in `self.data`.
165
+ # Indexes the current frame in the input HDF5Data instance.
173
166
  last_idx = 0
174
167
  self.logger.debug("Started collector thread")
175
168
  while True:
dcnum/write/writer.py CHANGED
@@ -140,10 +140,10 @@ class HDF5Writer:
140
140
  feat_dtype=feat_dtype),
141
141
  **ds_kwds)
142
142
  if len(item_shape) == 2:
143
- dset.attrs.create('CLASS', np.string_('IMAGE'))
144
- dset.attrs.create('IMAGE_VERSION', np.string_('1.2'))
143
+ dset.attrs.create('CLASS', np.bytes_('IMAGE'))
144
+ dset.attrs.create('IMAGE_VERSION', np.bytes_('1.2'))
145
145
  dset.attrs.create('IMAGE_SUBCLASS',
146
- np.string_('IMAGE_GRAYSCALE'))
146
+ np.bytes_('IMAGE_GRAYSCALE'))
147
147
  offset = 0
148
148
  else:
149
149
  dset = egroup[feat]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcnum
3
- Version: 0.25.0
3
+ Version: 0.25.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>
@@ -17,14 +17,14 @@ Classifier: Intended Audience :: Science/Research
17
17
  Requires-Python: <4,>=3.10
18
18
  Description-Content-Type: text/x-rst
19
19
  License-File: LICENSE
20
- Requires-Dist: h5py >=3.0.0
21
- Requires-Dist: hdf5plugin >=3.3.1
22
- Requires-Dist: mahotas
23
- Requires-Dist: numba
24
- Requires-Dist: numpy >=1.21
25
- Requires-Dist: opencv-python-headless
26
- Requires-Dist: scikit-image
27
- Requires-Dist: scipy >=1.8.0
20
+ Requires-Dist: h5py <4,>=3.0.0
21
+ Requires-Dist: hdf5plugin <6,>=3.3.1
22
+ Requires-Dist: mahotas <2,>=1
23
+ Requires-Dist: numba <1,>=0.60
24
+ Requires-Dist: numpy <3,>=1.21
25
+ Requires-Dist: opencv-python-headless <5,>=4
26
+ Requires-Dist: scikit-image <1,>=0.24
27
+ Requires-Dist: scipy <2,>=1.8.0
28
28
  Provides-Extra: torch
29
29
  Requires-Dist: torch >=2.2 ; extra == 'torch'
30
30
 
@@ -1,5 +1,5 @@
1
1
  dcnum/__init__.py,sha256=hcawIKS7utYiOyVhOAX9t7K3xYzP1b9862VV0b6qSrQ,74
2
- dcnum/_version.py,sha256=nhq2LDshqyJE9A3DLIz_6mBkgGLKSQrYmHfzZ_jVCbc,413
2
+ dcnum/_version.py,sha256=O16YsGa9nckhVhnz7jJ3nC69Kk6pQkIag-qsDHQCsBY,413
3
3
  dcnum/feat/__init__.py,sha256=jUJYWTD3VIoDNKrmryXbjHb1rGwYtK4b7VPWihYgUoo,325
4
4
  dcnum/feat/event_extractor_manager_thread.py,sha256=FAxSyRfaNAuBWNplxHngp5h-44s0qIP24XX_oETdfMk,7836
5
5
  dcnum/feat/gate.py,sha256=Yhxq80JoRMmQzBxl35C8NT91c9QcmQa-EIKLuxK6WvE,7221
@@ -20,7 +20,7 @@ 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=3ovEkaxy4ASpXvLsZMO0pSueqZfQgLkoy3fnH2Gweq8,38791
23
+ dcnum/logic/ctrl.py,sha256=FwzrCou4YBPBaaRRTqJkPt6jenFev9JfnxxjUMS0B-w,39042
24
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
@@ -47,10 +47,10 @@ dcnum/segm/segm_torch/torch_postproc.py,sha256=ctirQTmsZnuZGIxkwFWN9arRneHRYJUxa
47
47
  dcnum/segm/segm_torch/torch_preproc.py,sha256=kjabu76paw23kO7RP7Ik6IY60Kk1VBAHKBAedflA0aQ,4002
48
48
  dcnum/write/__init__.py,sha256=sK79IlvCFIqf2oFABVeyYedMnHOsEIQpxAauEeNO-Tw,273
49
49
  dcnum/write/deque_writer_thread.py,sha256=ao7F1yrVKyufgC4rC0Y2_Vt7snuT6KpI7W2qVxcjdhk,1994
50
- dcnum/write/queue_collector_thread.py,sha256=d_WfdsZdFnFsiAY0zVMwUlA4juIMeiWYmE_-rezBQCE,11734
51
- dcnum/write/writer.py,sha256=sFt4O9O4uUabxmBZu776b5pBf_DPDpsz-jLpSsswQ1g,20531
52
- dcnum-0.25.0.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
53
- dcnum-0.25.0.dist-info/METADATA,sha256=CNZS4i26iGkFnwde0p0I8xzD80cRqKrDRQssMXnqkSo,2280
54
- dcnum-0.25.0.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
55
- dcnum-0.25.0.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
56
- dcnum-0.25.0.dist-info/RECORD,,
50
+ dcnum/write/queue_collector_thread.py,sha256=KwwNIDFEF2DU83woKES5K05MxxOhDxPMZLLeyPugfDo,11542
51
+ dcnum/write/writer.py,sha256=oHlq4bDHQxb33-3Fw1xnzJwACecLyH-6koGK8SN0cSk,20528
52
+ dcnum-0.25.2.dist-info/LICENSE,sha256=YRChA1C8A2E-amJbudwMcbTCZy_HzmeY0hMIvduh1MM,1089
53
+ dcnum-0.25.2.dist-info/METADATA,sha256=8x1L3Y9upiMz-WC0GmOFYSkdcA9OMByyi2z88HRlX94,2326
54
+ dcnum-0.25.2.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
55
+ dcnum-0.25.2.dist-info/top_level.txt,sha256=Hmh38rgG_MFTVDpUDGuO2HWTSq80P585Het4COQzFTg,6
56
+ dcnum-0.25.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (71.1.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5