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

pin tifffile to a newer version to allow unpinning of ome-zarr. #208

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
with:
with:
fetch-depth: 0
- name: Setup Pages
id: pages
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/run_coordinate_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@

# %%
# Clean up
tmp_dir.cleanup()
tmp_dir.cleanup()
2 changes: 1 addition & 1 deletion docs/examples/run_single_fov_ome_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@

# %%
# Clean up
tmp_dir.cleanup()
tmp_dir.cleanup()
2 changes: 1 addition & 1 deletion docs/gh-pages-redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<meta http-equiv="refresh" content="0; url=./main/index.html">
<link rel="canonical" href="./main/index.html">
</head>
</html>
</html>
2 changes: 1 addition & 1 deletion docs/source/_static/switcher.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"version": "latest",
"url": "/main/index.html"
}
]
]
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Index
-----

* :ref:`genindex`
* :ref:`search`
* :ref:`search`
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ setup_requires = setuptools_scm
install_requires =
pandas>=1.5.2
pydantic>=1.10.2, <2
tifffile>=2023.2.3, <2023.3.15
tifffile>=2023.3.15, <2024.1.30
natsort>=7.1.1
ndtiff>=2.2.1
zarr>=2.13, <2.16
zarr>=2.15.0
tqdm
pillow>=9.4.0
blosc2
Expand Down
30 changes: 19 additions & 11 deletions tests/clearcontrol/test_clearcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ def mock_clear_control_dataset_path(tmp_path: Path) -> Path:


def test_blosc_buffer(tmp_path: Path) -> None:

buffer_path = tmp_path / "buffer.blc"
in_array = np.random.randint(0, 5_000, size=(32, 32))

_array_to_blosc_buffer(in_array, buffer_path)
out_array = blosc_buffer_to_array(buffer_path, in_array.shape, in_array.dtype)
out_array = blosc_buffer_to_array(
buffer_path, in_array.shape, in_array.dtype
)

assert np.allclose(in_array, out_array)


@pytest.mark.parametrize(
"key",
[1,
(slice(None), 1),
(0, [1, 2]),
(-1, np.asarray([0, 3])),
(slice(1), -2),
(np.asarray(0),),
(0, 0, slice(32)),
[
1,
(slice(None), 1),
(0, [1, 2]),
(-1, np.asarray([0, 3])),
(slice(1), -2),
(np.asarray(0),),
(0, 0, slice(32)),
],
)
def test_CCFOV_indexing(
Expand All @@ -58,7 +60,13 @@ def test_CCFOV_metadata(
mock_clear_control_dataset_path: Path,
) -> None:
cc = ClearControlFOV(mock_clear_control_dataset_path)
expected_metadata = {"voxel_size_z": 1.0, "voxel_size_y": 0.25, "voxel_size_x": 0.25, "acquisition_type": "NA", "time_delta": 45.0}
expected_metadata = {
"voxel_size_z": 1.0,
"voxel_size_y": 0.25,
"voxel_size_x": 0.25,
"acquisition_type": "NA",
"time_delta": 45.0,
}
metadata = cc.metadata()
assert metadata == expected_metadata

Expand All @@ -79,7 +87,7 @@ def test_CCFOV_cache(
assert np.array_equal(cc._cache_array, array)

new_array = cc[1]
assert id(new_array) == id(array) # same reference, so cache worked
assert id(new_array) == id(array) # same reference, so cache worked

cc.cache = False
assert cc._cache_key is None
Expand Down
7 changes: 6 additions & 1 deletion tests/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ def test_cli_info_ome_zarr(setup_test_data, setup_hcs_ref, verbose):
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, chk,
setup_test_data,
setup_mm2gamma_ome_tiffs,
f,
g,
s,
chk,
):
_, _, input_dir = setup_mm2gamma_ome_tiffs
runner = CliRunner()
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def setup_mm2gamma_ome_tiff_hcs():
f for f in os.listdir(test_data) if os.path.isdir(pjoin(test_data, f))
]
# select datasets with multiple positioons; here they all have 4 positions
hcs_subfolders = [f for f in subfolders if '4p' in f]
hcs_subfolders = [f for f in subfolders if "4p" in f]

# specific folder
one_folder = pjoin(test_data, hcs_subfolders[0])
Expand Down
1 change: 0 additions & 1 deletion tests/fov/test_fov.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_missing_axes(axes: list[str], missing: list[int]) -> None:


def test_fov_dict() -> None:

good_collection = FOVDict(
{
"488": FOV(["y", "x"]),
Expand Down
2 changes: 0 additions & 2 deletions tests/pyramid/test_pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def _mock_fov(
shape: tuple[int, ...],
scale: tuple[float, float, float],
) -> Position:

ds_path = tmp_path / "ds.zarr"
channels = [str(i) for i in range(shape[1])]

Expand Down Expand Up @@ -47,7 +46,6 @@ def _mock_fov(

@pytest.mark.parametrize("ndim", [2, 5])
def test_pyramid(tmp_path: Path, ndim: int) -> None:

# not all shapes not divisible by 2
shape = (2, 2, 67, 115, 128)[-ndim:]
scale = (2, 0.5, 0.5)[-min(3, ndim) :]
Expand Down
6 changes: 0 additions & 6 deletions tests/reader/test_multipagetiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def test_output_dims_mm2gamma_incomplete(


def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand All @@ -73,7 +72,6 @@ def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_ome_tiffs):


def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand All @@ -84,7 +82,6 @@ def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_ome_tiffs):


def test_get_num_positions_mm2gamma(setup_test_data, setup_mm2gamma_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand Down Expand Up @@ -132,7 +129,6 @@ def test_output_dims_mm1422(setup_test_data, setup_mm1422_ome_tiffs):


def test_get_zarr_mm1422(setup_test_data, setup_mm1422_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand All @@ -143,7 +139,6 @@ def test_get_zarr_mm1422(setup_test_data, setup_mm1422_ome_tiffs):


def test_get_array_mm1422(setup_test_data, setup_mm1422_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand All @@ -154,7 +149,6 @@ def test_get_array_mm1422(setup_test_data, setup_mm1422_ome_tiffs):


def test_get_num_positions_mm1422(setup_test_data, setup_mm1422_ome_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_ome_tiffs
mmr = MicromanagerOmeTiffReader(rand_folder, extract_data=True)
Expand Down
6 changes: 0 additions & 6 deletions tests/reader/test_singlepagetiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def test_output_dims_mm2gamma_incomplete(


def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_singlepage_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand All @@ -76,7 +75,6 @@ def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_singlepage_tiffs):


def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_singlepage_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand All @@ -89,7 +87,6 @@ def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_singlepage_tiffs):
def test_get_num_positions_mm2gamma(
setup_test_data, setup_mm2gamma_singlepage_tiffs
):

_ = setup_test_data
_, _, rand_folder = setup_mm2gamma_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand Down Expand Up @@ -136,7 +133,6 @@ def test_output_dims_mm1422(setup_test_data, setup_mm1422_singlepage_tiffs):


def test_get_zarr_mm1422(setup_test_data, setup_mm1422_singlepage_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand All @@ -147,7 +143,6 @@ def test_get_zarr_mm1422(setup_test_data, setup_mm1422_singlepage_tiffs):


def test_get_array_mm1422(setup_test_data, setup_mm1422_singlepage_tiffs):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand All @@ -160,7 +155,6 @@ def test_get_array_mm1422(setup_test_data, setup_mm1422_singlepage_tiffs):
def test_get_num_positions_mm1422(
setup_test_data, setup_mm1422_singlepage_tiffs
):

_ = setup_test_data
_, _, rand_folder = setup_mm1422_singlepage_tiffs
mmr = MicromanagerSequenceReader(rand_folder, extract_data=True)
Expand Down
4 changes: 0 additions & 4 deletions tests/reader/test_zarrfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def test_output_dims_mm2gamma(setup_test_data, setup_mm2gamma_zarr):


def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_zarr):

_ = setup_test_data
src = setup_mm2gamma_zarr
mmr = ZarrReader(src)
Expand All @@ -70,7 +69,6 @@ def test_get_zarr_mm2gamma(setup_test_data, setup_mm2gamma_zarr):


def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_zarr):

_ = setup_test_data
src = setup_mm2gamma_zarr
mmr = ZarrReader(src)
Expand All @@ -82,7 +80,6 @@ def test_get_array_mm2gamma(setup_test_data, setup_mm2gamma_zarr):


def test_get_image_mm2gamma(setup_test_data, setup_mm2gamma_zarr):

_ = setup_test_data
src = setup_mm2gamma_zarr
mmr = ZarrReader(src)
Expand All @@ -94,7 +91,6 @@ def test_get_image_mm2gamma(setup_test_data, setup_mm2gamma_zarr):


def test_get_num_positions_mm2gamma(setup_test_data, setup_mm2gamma_zarr):

_ = setup_test_data
src = setup_mm2gamma_zarr
mmr = ZarrReader(src)
Expand Down
Loading