Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option to not check copied data #192

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions iohub/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,23 @@ def info(files, verbose):
help="Zarr chunk size given as 'XY', 'XYZ', or a tuple of chunk "
"dimensions. If 'XYZ', chunk size will be limited to 500 MB.",
)
def convert(input, output, format, scale_voxels, grid_layout, chunks):
@click.option(
"--check-image/--no-check-image",
"-chk/-no-chk",
required=False,
is_flag=True,
default=True,
help="Checks copied image data with original data.",
)
def convert(
input,
output,
format,
scale_voxels,
grid_layout,
chunks,
check_image,
):
"""Converts Micro-Manager TIFF datasets to OME-Zarr"""
converter = TIFFConverter(
input_dir=input,
Expand All @@ -100,4 +116,4 @@ def convert(input, output, format, scale_voxels, grid_layout, chunks):
grid_layout=grid_layout,
chunks=chunks,
)
converter.run()
converter.run(check_image=check_image)
7 changes: 4 additions & 3 deletions tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,21 @@ def test_cli_info_ome_zarr(setup_test_data, setup_hcs_ref, verbose):
assert "scale (um)" in result_pos.output


@given(f=st.booleans(), g=st.booleans(), s=st.booleans())
@given(f=st.booleans(), g=st.booleans(), s=st.booleans(), chk=st.booleans())
@settings(
suppress_health_check=[HealthCheck.function_scoped_fixture], deadline=20000
)
def test_cli_convert_ome_tiff(
setup_test_data, setup_mm2gamma_ome_tiffs, f, g, s
setup_test_data, setup_mm2gamma_ome_tiffs, f, g, s, chk,
):
_, _, input_dir = setup_mm2gamma_ome_tiffs
runner = CliRunner()
f = "-f ometiff" if f else ""
g = "-g" if g else ""
chk = "--check-image" if chk else "--no-check-image"
with TemporaryDirectory() as tmp_dir:
output_dir = os.path.join(tmp_dir, "converted.zarr")
cmd = ["convert", "-i", input_dir, "-o", output_dir, "-s", s]
cmd = ["convert", "-i", input_dir, "-o", output_dir, "-s", s, chk]
if f:
cmd += ["-f", "ometiff"]
if g:
Expand Down