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.
- {dcnum-0.22.0 → dcnum-0.22.1}/CHANGELOG +2 -0
- {dcnum-0.22.0/src/dcnum.egg-info → dcnum-0.22.1}/PKG-INFO +1 -1
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/_version.py +2 -2
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/ctrl.py +12 -3
- {dcnum-0.22.0 → dcnum-0.22.1/src/dcnum.egg-info}/PKG-INFO +1 -1
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_pipeline.py +67 -2
- {dcnum-0.22.0 → dcnum-0.22.1}/.github/workflows/check.yml +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/.github/workflows/deploy_pypi.yml +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/.gitignore +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/.readthedocs.yml +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/LICENSE +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/README.rst +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/docs/conf.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/docs/extensions/github_changelog.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/docs/index.rst +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/docs/requirements.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/pyproject.toml +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/setup.cfg +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/event_extractor_manager_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/base.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_copy.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_roll_median.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_background/bg_sparse_median.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/bright_all.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_brightness/common.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/contour.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/moments.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_contour/volume.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/common.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/feat_texture/tex_all.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/gate.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/feat/queue_event_extractor.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/job.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/logic/json_encoder.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/paths.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/meta/ppid.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/cache.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/const.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/hdf5_data.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/read/mapped.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segm_thresh.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_manager_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_mpo.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/segm/segmenter_sto.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/__init__.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/deque_writer_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/queue_collector_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum/write/writer.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/SOURCES.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/dependency_links.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/requires.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/src/dcnum.egg-info/top_level.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/conftest.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_extended-moments-features.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_2023.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_2024.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_legacy_allev_2023.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_shapein_empty.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_shapein_raw-with-variable-length-logs.zip +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/helper_methods.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/requirements.txt +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_base.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_copy.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_roll_median.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_background_bg_sparsemed.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_brightness.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_event_extractor_manager.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_gate.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_haralick.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_moments_based.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_moments_based_extended.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_feat_volume.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_init.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_job.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_join.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_logic_json.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_paths.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_base.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_bg.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_data.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_feat.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_gate.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_meta_ppid_segm.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_basin.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_concat_hdf5.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5_basins.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_read_hdf5_index_mapping.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_base.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_mpo.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_no_mask_proc.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_sto.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_segm_thresh.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_deque_writer_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_queue_collector_thread.py +0 -0
- {dcnum-0.22.0 → dcnum-0.22.1}/tests/test_write_writer.py +0 -0
|
@@ -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-
|
|
465
|
-
# This is the current measurement identifier
|
|
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
|
|
@@ -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"] ==
|
|
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"] ==
|
|
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
|
|
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
|
{dcnum-0.22.0 → dcnum-0.22.1}/tests/data/fmt-hdf5_cytoshot_full-features_legacy_allev_2023.zip
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|