Skip to content

Commit

Permalink
Added option to not check copied data (#192)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoOkuma authored Oct 11, 2023
1 parent d7ee0b5 commit de79ed3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
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

0 comments on commit de79ed3

Please sign in to comment.