dcnum 0.22.0__tar.gz → 0.22.1__tar.gz

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.

Files changed (107) hide show
  1. {dcnum-0.22.0 → dcnum-0.22.1}/CHANGELOG +2 -0
  2. {dcnum-0.22.0/src/dcnum.egg-info → dcnum-0.22.1}/PKG-INFO +1 -1
  3. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/_version.py +2 -2
  4. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/ctrl.py +12 -3
  5. {dcnum-0.22.0 → dcnum-0.22.1/src/dcnum.egg-info}/PKG-INFO +1 -1
  6. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_pipeline.py +67 -2
  7. {dcnum-0.22.0 → dcnum-0.22.1}/.github/workflows/check.yml +0 -0
  8. {dcnum-0.22.0 → dcnum-0.22.1}/.github/workflows/deploy_pypi.yml +0 -0
  9. {dcnum-0.22.0 → dcnum-0.22.1}/.gitignore +0 -0
  10. {dcnum-0.22.0 → dcnum-0.22.1}/.readthedocs.yml +0 -0
  11. {dcnum-0.22.0 → dcnum-0.22.1}/LICENSE +0 -0
  12. {dcnum-0.22.0 → dcnum-0.22.1}/README.rst +0 -0
  13. {dcnum-0.22.0 → dcnum-0.22.1}/docs/conf.py +0 -0
  14. {dcnum-0.22.0 → dcnum-0.22.1}/docs/extensions/github_changelog.py +0 -0
  15. {dcnum-0.22.0 → dcnum-0.22.1}/docs/index.rst +0 -0
  16. {dcnum-0.22.0 → dcnum-0.22.1}/docs/requirements.txt +0 -0
  17. {dcnum-0.22.0 → dcnum-0.22.1}/pyproject.toml +0 -0
  18. {dcnum-0.22.0 → dcnum-0.22.1}/setup.cfg +0 -0
  19. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/__init__.py +0 -0
  20. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/__init__.py +0 -0
  21. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/event_extractor_manager_thread.py +0 -0
  22. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/__init__.py +0 -0
  23. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/base.py +0 -0
  24. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_copy.py +0 -0
  25. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_roll_median.py +0 -0
  26. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_sparse_median.py +0 -0
  27. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/__init__.py +0 -0
  28. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/bright_all.py +0 -0
  29. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/common.py +0 -0
  30. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/__init__.py +0 -0
  31. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/contour.py +0 -0
  32. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/moments.py +0 -0
  33. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/volume.py +0 -0
  34. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/__init__.py +0 -0
  35. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/common.py +0 -0
  36. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/tex_all.py +0 -0
  37. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/gate.py +0 -0
  38. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/queue_event_extractor.py +0 -0
  39. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/__init__.py +0 -0
  40. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/job.py +0 -0
  41. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/json_encoder.py +0 -0
  42. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/__init__.py +0 -0
  43. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/paths.py +0 -0
  44. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/ppid.py +0 -0
  45. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/__init__.py +0 -0
  46. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/cache.py +0 -0
  47. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/const.py +0 -0
  48. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/hdf5_data.py +0 -0
  49. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/mapped.py +0 -0
  50. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/__init__.py +0 -0
  51. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segm_thresh.py +0 -0
  52. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter.py +0 -0
  53. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_manager_thread.py +0 -0
  54. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_mpo.py +0 -0
  55. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_sto.py +0 -0
  56. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/__init__.py +0 -0
  57. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/deque_writer_thread.py +0 -0
  58. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/queue_collector_thread.py +0 -0
  59. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/writer.py +0 -0
  60. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/SOURCES.txt +0 -0
  61. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/dependency_links.txt +0 -0
  62. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/requires.txt +0 -0
  63. {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/top_level.txt +0 -0
  64. {dcnum-0.22.0 → dcnum-0.22.1}/tests/conftest.py +0 -0
  65. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_extended-moments-features.zip +0 -0
  66. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_2023.zip +0 -0
  67. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_2024.zip +0 -0
  68. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_legacy_allev_2023.zip +0 -0
  69. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_shapein_empty.zip +0 -0
  70. {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_shapein_raw-with-variable-length-logs.zip +0 -0
  71. {dcnum-0.22.0 → dcnum-0.22.1}/tests/helper_methods.py +0 -0
  72. {dcnum-0.22.0 → dcnum-0.22.1}/tests/requirements.txt +0 -0
  73. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_base.py +0 -0
  74. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_copy.py +0 -0
  75. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_roll_median.py +0 -0
  76. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_sparsemed.py +0 -0
  77. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_brightness.py +0 -0
  78. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_event_extractor_manager.py +0 -0
  79. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_gate.py +0 -0
  80. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_haralick.py +0 -0
  81. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_moments_based.py +0 -0
  82. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_moments_based_extended.py +0 -0
  83. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_volume.py +0 -0
  84. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_init.py +0 -0
  85. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_job.py +0 -0
  86. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_join.py +0 -0
  87. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_json.py +0 -0
  88. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_paths.py +0 -0
  89. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_base.py +0 -0
  90. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_bg.py +0 -0
  91. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_data.py +0 -0
  92. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_feat.py +0 -0
  93. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_gate.py +0 -0
  94. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_segm.py +0 -0
  95. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_basin.py +0 -0
  96. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_concat_hdf5.py +0 -0
  97. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5.py +0 -0
  98. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5_basins.py +0 -0
  99. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5_index_mapping.py +0 -0
  100. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_base.py +0 -0
  101. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_mpo.py +0 -0
  102. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_no_mask_proc.py +0 -0
  103. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_sto.py +0 -0
  104. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_thresh.py +0 -0
  105. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_deque_writer_thread.py +0 -0
  106. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_queue_collector_thread.py +0 -0
  107. {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_writer.py +0 -0
@@ -1,3 +1,5 @@
1
+ 0.22.1
2
+ - fix: compute pipeline identifier of origin dataset for basin mapping
1
3
  0.22.0
2
4
  - fix: GPUSegmenter did not perform mask postprocessing
3
5
  (this was not actually fixed in 0.21.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcnum
3
- Version: 0.22.0
3
+ Version: 0.22.1
4
4
  Summary: numerics toolbox for imaging deformability cytometry
5
5
  Author: Maximilian Schlögel, Paul Müller
6
6
  Maintainer-email: Paul Müller <dev@craban.de>
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.22.0'
16
- __version_tuple__ = version_tuple = (0, 22, 0)
15
+ __version__ = version = '0.22.1'
16
+ __version_tuple__ = version_tuple = (0, 22, 1)
@@ -1,5 +1,6 @@
1
1
  import collections
2
2
  import datetime
3
+ import hashlib
3
4
  import json
4
5
  import logging
5
6
  from logging.handlers import QueueListener
@@ -461,9 +462,17 @@ class DCNumJobRunner(threading.Thread):
461
462
  # This is the identifier appendix that we use to identify this
462
463
  # dataset. Note that we only override the run identifier when
463
464
  # segmentation did actually take place.
464
- mid_ap = "dcn-" + self.pphash[:7]
465
- # This is the current measurement identifier (may be empty).
466
- mid_cur = hw.h5.attrs.get("experiment:run identifier", "")
465
+ mid_ap = f"dcn-{self.pphash[:7]}"
466
+ # This is the current measurement identifier
467
+ mid_cur = hw.h5.attrs.get("experiment:run identifier")
468
+ if not mid_cur:
469
+ # Compute a measurement identifier from the metadata
470
+ m_time = hw.h5.attrs.get("experiment:time", "none")
471
+ m_date = hw.h5.attrs.get("experiment:date", "none")
472
+ m_sid = hw.h5.attrs.get("setup:identifier", "none")
473
+ hasher = hashlib.md5(
474
+ f"{m_time}_{m_date}_{m_sid}".encode("utf-8"))
475
+ mid_cur = str(uuid.UUID(hex=hasher.hexdigest()))
467
476
  # The new measurement identifier is a combination of both.
468
477
  mid_new = f"{mid_cur}_{mid_ap}" if mid_cur else mid_ap
469
478
  hw.h5.attrs["experiment:run identifier"] = mid_new
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dcnum
3
- Version: 0.22.0
3
+ Version: 0.22.1
4
4
  Summary: numerics toolbox for imaging deformability cytometry
5
5
  Author: Maximilian Schlögel, Paul Müller
6
6
  Maintainer-email: Paul Müller <dev@craban.de>
@@ -21,6 +21,67 @@ def get_log(hd: read.HDF5Data,
21
21
  raise KeyError(f"Log starting with {startswith} not found!")
22
22
 
23
23
 
24
+ @pytest.mark.parametrize("override_attrs,delete_keys,meas_id", [
25
+ # standard
26
+ [{"experiment:run identifier": "peter"},
27
+ [],
28
+ "peter"],
29
+ # from metadata (input file)
30
+ [{"experiment:run identifier": ""},
31
+ [],
32
+ "d5a40aed-0b6c-0412-e87c-59789fdd28d0"],
33
+ # from metadata (input file)
34
+ [{},
35
+ ["experiment:run identifier"],
36
+ "d5a40aed-0b6c-0412-e87c-59789fdd28d0"],
37
+ # from metadata (manual)
38
+ [{"experiment:time": "12:01",
39
+ "experiment:date": "2024-06-23",
40
+ "setup:identifier": "RC-peter-pan-and-friends",
41
+ },
42
+ ["experiment:run identifier"],
43
+ "f0cfdc6f-93c7-c093-d135-a20f3e5bdbfa"],
44
+ # delete everything, this is the hash of none-none-none
45
+ [{},
46
+ ["setup:identifier", "experiment:time", "experiment:run identifier",
47
+ "setup:identifier"],
48
+ "07d18822-3045-4e6b-da0b-f1a16c80132a"],
49
+ ])
50
+ def test_basin_experiment_identifier_correct(
51
+ override_attrs, delete_keys, meas_id):
52
+ """Make sure the measurement identifier computed by dcnum is correct"""
53
+ path_orig = retrieve_data("fmt-hdf5_cytoshot_full-features_2023.zip")
54
+ path_out = path_orig.with_name("out.rtdc")
55
+
56
+ # modify input file
57
+ with h5py.File(path_orig, "a") as h5in:
58
+ for key in override_attrs:
59
+ h5in.attrs[key] = override_attrs[key]
60
+ for key in delete_keys:
61
+ if key in h5in.attrs:
62
+ h5in.attrs.pop(key)
63
+
64
+ job = logic.DCNumPipelineJob(path_in=path_orig,
65
+ path_out=path_out,
66
+ background_code="copy",
67
+ segmenter_code="thresh",
68
+ segmenter_kwargs={"thresh": -5},
69
+ feature_kwargs={"volume": False,
70
+ "haralick": False,
71
+ "brightness": False,
72
+ },
73
+ basin_strategy="tap",
74
+ debug=True)
75
+ with logic.DCNumJobRunner(job=job) as runner:
76
+ runner.run()
77
+
78
+ with h5py.File(path_out) as hout:
79
+ appid = hout.attrs["pipeline:dcnum hash"]
80
+ eri_exp = f"{meas_id}_dcn-{appid[:7]}"
81
+ # this is the actual test
82
+ assert hout.attrs["experiment:run identifier"] == eri_exp
83
+
84
+
24
85
  def test_basin_strategy_drain_mapped_input():
25
86
  """When basin strategy is "drain", features are mapped from the input
26
87
 
@@ -683,7 +744,9 @@ def test_simple_pipeline(debug):
683
744
  # test for general metadata
684
745
  assert h5.attrs["experiment:sample"] == "data"
685
746
  assert h5.attrs["experiment:date"] == "2022-04-21"
686
- assert h5.attrs["experiment:run identifier"] == f"dcn-{pp_hash[:7]}"
747
+ assert h5.attrs["experiment:run identifier"] == \
748
+ (f"d5a40aed-0b6c-0412-e87c-59789fdd28d0_"
749
+ f"dcn-{pp_hash[:7]}")
687
750
 
688
751
 
689
752
  @pytest.mark.parametrize("debug", [True, False])
@@ -750,7 +813,9 @@ def test_simple_pipeline_no_offset_correction(debug):
750
813
  # test for general metadata
751
814
  assert h5.attrs["experiment:sample"] == "data"
752
815
  assert h5.attrs["experiment:date"] == "2022-04-21"
753
- assert h5.attrs["experiment:run identifier"] == f"dcn-{pp_hash[:7]}"
816
+ assert h5.attrs["experiment:run identifier"] == \
817
+ (f"d5a40aed-0b6c-0412-e87c-59789fdd28d0_"
818
+ f"dcn-{pp_hash[:7]}")
754
819
 
755
820
 
756
821
  def test_simple_pipeline_in_thread():
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes