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

Install iohub from PyPI #342

Merged
merged 2 commits into from
Apr 15, 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
92 changes: 0 additions & 92 deletions recOrder/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,92 +0,0 @@
import pytest
import shutil
import os
from wget import download


@pytest.fixture(scope="session")
def setup_test_data():
# create /pytest_temp/ and /pytest_temp/rawdata/ folders,
temp_folder = os.path.join(os.getcwd(), "pytest_temp")
test_data = os.path.join(temp_folder, "test_data")
if not os.path.isdir(temp_folder):
os.mkdir(temp_folder)
print("\nsetting up temp folder")
if not os.path.isdir(test_data):
os.mkdir(test_data)

# download data to /pytest_temp/ folder if it doesn't already exist
url = "https://zenodo.org/record/6983916/files/recOrder_test_data.zip?download=1"
output = os.path.join(test_data, "recOrder_test_Data.zip")
if not os.listdir(test_data):
print("Downloading test files...")
download(url, out=output)
shutil.unpack_archive(output, extract_dir=test_data)

yield test_data


@pytest.fixture()
def get_ometiff_data_dir(setup_test_data):
test_data = setup_test_data

ometiff_data = os.path.join(
test_data,
"2022_08_04_recOrder_pytest_20x_04NA",
"2T_3P_16Z_128Y_256X_Kazansky_1",
)

return test_data, ometiff_data


@pytest.fixture()
def get_zarr_data_dir(setup_test_data):
test_data = setup_test_data

zarr_data = os.path.join(
test_data,
"2022_08_04_recOrder_pytest_20x_04NA_zarr",
"2T_3P_16Z_128Y_256X_Kazansky.zarr",
)

return test_data, zarr_data


@pytest.fixture()
def get_bf_data_dir(setup_test_data):
test_data = setup_test_data

bf_data = os.path.join(
test_data,
"2022_08_04_recOrder_pytest_20x_04NA_BF",
"2T_3P_16Z_128Y_256X_Kazansky_BF_1",
)

return test_data, bf_data


@pytest.fixture()
def get_pycromanager_data_dir(setup_test_data):
test_data = setup_test_data

pm_data = os.path.join(test_data, "mm2.0-20210713_pm0.13.2_2p_3t_2c_7z_1")

return test_data, pm_data


# create /pytest_temp/data_save folder for each test then delete when test is done
@pytest.fixture(scope="function")
def setup_data_save_folder():
temp_folder = os.path.join(os.getcwd(), "pytest_temp")
data_save_folder = os.path.join(temp_folder, "data_save")
if not os.path.isdir(data_save_folder):
os.mkdir(data_save_folder)
print("\nsetting up data_save folder")

yield data_save_folder

try:
# remove temp folder
shutil.rmtree(data_save_folder)
except OSError as e:
print(f"Error while deleting temp folder: {e.strerror}")
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ install_requires =
napari;'arm64' in platform_machine # without Qt and skimage
PyQt6;'arm64' in platform_machine
importlib-metadata
iohub @ git+https://github.com/czbiohub/iohub.git@v0.1.0dev1
iohub==0.1.0.dev3

[options.extras_require]
dev =
Expand Down