Skip to content

Commit

Permalink
setup: migrate to dcnum 0.20.0 and fix minor glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 27, 2024
1 parent edf9926 commit 0413333
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.4.0
- fix: show correct data PPID in CLI
- setup: bump dcnum from 0.19.1 to 0.20.0
0.3.1
- ref: migrate from QTableView to QTableWidget (issues with Windows 11)
0.3.0
Expand Down
9 changes: 5 additions & 4 deletions chipstream/cli/cli_proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def process_dataset(
path_out.parent.mkdir(parents=True, exist_ok=True)

# data keyword arguments
with dcnum.read.HDF5Data(path_in, pixel_size=pixel_size) as data:
data_kwargs = {"pixel_size": pixel_size,
"index_mapping": index_mapping}
with dcnum.read.HDF5Data(path_in, **data_kwargs) as data:
dat_id = data.get_ppid()
click.echo(f"Data ID:\t{dat_id}")

Expand Down Expand Up @@ -88,8 +90,7 @@ def process_dataset(
path_in=path_in,
path_out=path_out,
data_code="hdf",
data_kwargs={"pixel_size": pixel_size,
"index_mapping": index_mapping},
data_kwargs=data_kwargs,
background_code=bg_cls.get_ppid_code(),
background_kwargs=bg_kwargs,
segmenter_code=seg_cls.get_ppid_code(),
Expand All @@ -98,7 +99,7 @@ def process_dataset(
feature_kwargs=feat_kwargs,
gate_code=gate_cls.get_ppid_code(),
gate_kwargs=gate_kwargs,
no_basins_in_output=True,
basin_strategy="drain",
num_procs=num_cpus,
debug=debug,
)
Expand Down
9 changes: 7 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import dcnum.read
import h5py
import numpy as np

import pytest

Expand Down Expand Up @@ -32,8 +33,12 @@ def test_cli_limit_events(cli_runner, limit_events, dcnum_yield,

# sanity check
with h5py.File(path) as h5:
assert h5["events/frame"][0] == 1
assert h5["events/frame"][1] == 2
assert np.all(h5["events/frame"][:]
== np.array([1, 2, 2, 4, 4, 5, 5, 5, 6, 6,
6, 7, 8, 8, 10, 10, 11, 11, 11, 12,
12, 12, 13, 14, 14, 16, 16, 17, 17, 17,
18, 18, 18]))
assert "basinmap0" not in h5

path_out = path.with_name("limited_events.rtdc")
result = cli_runner.invoke(cli_main.chipstream_cli,
Expand Down

0 comments on commit 0413333

Please sign in to comment.