diff --git a/.github/workflows/ci_pip.yml b/.github/workflows/ci_pip.yml index 3f58e8b..f0bcc4e 100644 --- a/.github/workflows/ci_pip.yml +++ b/.github/workflows/ci_pip.yml @@ -30,7 +30,7 @@ jobs: cache: "pip" - name: Install package - run: python -m pip install .[dev,test] + run: python -m pip install -e .[dev,test] - name: Install some testing dependencies (hard-coded) run: python -m pip install pytest devtools jsonschema requests wget pooch @@ -46,7 +46,7 @@ jobs: run: pytest --color=yes --cov --cov-report=xml --cov-report=term-missing -s --log-cli-level debug - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4.0.1 + uses: codecov/codecov-action@v4.3.1 with: token: ${{ secrets.CODECOV_TOKEN }} slug: jluethi/fractal-helper-tasks \ No newline at end of file diff --git a/README.md b/README.md index c8f2e97..34e4de7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # fractal-helper-tasks +[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](LICENSE) +![Python version](https://img.shields.io/badge/python-%3E%3D3.9-blue) +![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jluethi/fractal-helper-tasks/your-workflow-file.yml?branch=main) +[![codecov](https://codecov.io/gh/jluethi/fractal-helper-tasks/graph/badge.svg?token=ednmg2GzOw)](https://codecov.io/gh/jluethi/fractal-helper-tasks) + Collection of Fractal helper tasks ## Development instructions diff --git a/pyproject.toml b/pyproject.toml index 795d07a..9511790 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,7 +69,13 @@ extend-ignore = [ "tests/*.py" = ["D", "S"] "setup.py" = ["D"] -[tool.deptry] -exclude = [ - 'tests', 'examples' +[tool.coverage.run] +# Include only the specific package directories for coverage, exclude tests +include = [ + "src/fractal_helper_tasks/*" +] +omit = [ + "*/tests/*", + "*_test.py", + "setup.py" ] \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index 54391ef..3ff3d9c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -53,7 +53,6 @@ def zenodo_zarr(testdata_path: Path) -> list[str]: f"{file_name}.zip", processor=pooch.Unzip(extract_dir=file_name) ) zarr_full_path = file_paths[0].split(file_name)[0] + file_name - print(zarr_full_path) folder = folders[ind] # 2) Copy the downloaded Zarr into tests/data diff --git a/tests/test_convert_2d_to_3d_segmentation.py b/tests/test_convert_2d_to_3d_segmentation.py index 5f7c2aa..fc03097 100644 --- a/tests/test_convert_2d_to_3d_segmentation.py +++ b/tests/test_convert_2d_to_3d_segmentation.py @@ -1,6 +1,7 @@ """Test copy 2D to 3D segmentation.""" import dask.array as da +import pytest import zarr from fractal_helper_tasks.convert_2D_segmentation_to_3D import ( @@ -8,15 +9,21 @@ ) -def test_2d_to_3d(tmp_zenodo_zarr: list[str]): +@pytest.mark.parametrize("new_label_name", [None, "nuclei_new"]) +def test_2d_to_3d(tmp_zenodo_zarr: list[str], new_label_name): zarr_url = f"{tmp_zenodo_zarr[1]}/B/03/0" label_name = "nuclei" convert_2D_segmentation_to_3D( zarr_url=zarr_url, label_name=label_name, + new_label_name=new_label_name, ) - zarr_3D_label_url = f"{tmp_zenodo_zarr[0]}/B/03/0/labels/{label_name}" + + if not new_label_name: + new_label_name = label_name + + zarr_3D_label_url = f"{tmp_zenodo_zarr[0]}/B/03/0/labels/{new_label_name}" # Check that the label has been copied correctly with zarr.open(zarr_3D_label_url, mode="rw+") as zarr_img: zarr_3D = da.from_zarr(zarr_img[0]) @@ -25,7 +32,9 @@ def test_2d_to_3d(tmp_zenodo_zarr: list[str]): # TODO: Add custom ROI tables to be copied to 3D -# TODO: Add test with new label name, new table names +# TODO: Add a feature table & have it copied over + +# TODO: Add test with new table names # TODO: Create a version of the test data where image suffixes need to be # changed, run tests on those