From a7ea5794986570ef7627c7a661dc490d9ecad6ef Mon Sep 17 00:00:00 2001 From: Najib Ishaq Date: Fri, 19 Jul 2024 10:39:18 -0400 Subject: [PATCH 1/5] chore: some initial cleanup --- formats/image-dimension-stacking-tool/.bumpversion.cfg | 2 +- formats/image-dimension-stacking-tool/README.md | 2 +- formats/image-dimension-stacking-tool/VERSION | 2 +- formats/image-dimension-stacking-tool/plugin.json | 4 ++-- formats/image-dimension-stacking-tool/pyproject.toml | 10 ++-------- .../formats/image_dimension_stacking/__init__.py | 3 ++- .../image-dimension-stacking-tool/tests/conftest.py | 1 + .../image-dimension-stacking-tool/tests/test_cli.py | 6 ++++-- .../tests/test_dimension_stacking.py | 1 + 9 files changed, 15 insertions(+), 16 deletions(-) diff --git a/formats/image-dimension-stacking-tool/.bumpversion.cfg b/formats/image-dimension-stacking-tool/.bumpversion.cfg index 926e4c0f0..1aa7585a0 100644 --- a/formats/image-dimension-stacking-tool/.bumpversion.cfg +++ b/formats/image-dimension-stacking-tool/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.1-dev +current_version = 0.1.1-dev0 commit = False tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/formats/image-dimension-stacking-tool/README.md b/formats/image-dimension-stacking-tool/README.md index 97e356680..9918de2a8 100644 --- a/formats/image-dimension-stacking-tool/README.md +++ b/formats/image-dimension-stacking-tool/README.md @@ -1,4 +1,4 @@ -# Image dimension stacking(0.1.1-dev) +# Image dimension stacking(0.1.1-dev0) This plugin leverages the [filepattern](https://filepattern2.readthedocs.io/en/latest/Home.html) library and employs the filepattern `groupBy` functionality to enable the matching of image filenames, facilitating their stacking into multi-dimensional images. diff --git a/formats/image-dimension-stacking-tool/VERSION b/formats/image-dimension-stacking-tool/VERSION index c9927239f..44bf4db83 100644 --- a/formats/image-dimension-stacking-tool/VERSION +++ b/formats/image-dimension-stacking-tool/VERSION @@ -1 +1 @@ -0.1.1-dev +0.1.1-dev0 diff --git a/formats/image-dimension-stacking-tool/plugin.json b/formats/image-dimension-stacking-tool/plugin.json index 8879ba85a..af4fcf66b 100644 --- a/formats/image-dimension-stacking-tool/plugin.json +++ b/formats/image-dimension-stacking-tool/plugin.json @@ -1,13 +1,13 @@ { "name": "Image Dimension Stacking", - "version": "0.1.1-dev", + "version": "0.1.1-dev0", "title": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "description": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "author": "Nick Schaub (nick.schaub@nih.gov), Hamdah Shafqat Abbasi (hamdahshafqat.abbasi@nih.gov)", "institution": "National Center for Advancing Translational Sciences, National Institutes of Health", "repository": "https://github.com/PolusAI/image-tools", "website": "https://ncats.nih.gov/preclinical/core/informatics", - "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev", + "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev0", "baseCommand": [ "python3", "-m", diff --git a/formats/image-dimension-stacking-tool/pyproject.toml b/formats/image-dimension-stacking-tool/pyproject.toml index ab2e810f1..ed43fee02 100644 --- a/formats/image-dimension-stacking-tool/pyproject.toml +++ b/formats/image-dimension-stacking-tool/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polus-images-formats-image-dimension-stacking" -version = "0.1.1-dev" +version = "0.1.1-dev0" description = "Stacking multi-dimensional images" authors = [ "Nick Schaub ", @@ -18,13 +18,7 @@ tqdm = "^4.66.1" filepattern = "^2.0.4" pydantic = "^1.10.4" preadator="0.4.0.dev2" - - -[[tool.poetry.source]] -name = "test" -url = "https://test.pypi.org/simple/" -default = false -secondary = true +numpy = "<2.0.0" [tool.poetry.group.dev.dependencies] bump2version = "^1.0.1" diff --git a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py index 8d98ba52d..f0be8f4c4 100644 --- a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py +++ b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py @@ -1,2 +1,3 @@ """Image dimension stacking package.""" -__version__ = "0.1.1-dev" + +__version__ = "0.1.1-dev0" diff --git a/formats/image-dimension-stacking-tool/tests/conftest.py b/formats/image-dimension-stacking-tool/tests/conftest.py index fdaef3712..e65f78b2b 100644 --- a/formats/image-dimension-stacking-tool/tests/conftest.py +++ b/formats/image-dimension-stacking-tool/tests/conftest.py @@ -2,6 +2,7 @@ Set up all data used in tests. """ + import shutil import tempfile from pathlib import Path diff --git a/formats/image-dimension-stacking-tool/tests/test_cli.py b/formats/image-dimension-stacking-tool/tests/test_cli.py index 81a32d325..92cccade1 100644 --- a/formats/image-dimension-stacking-tool/tests/test_cli.py +++ b/formats/image-dimension-stacking-tool/tests/test_cli.py @@ -1,9 +1,11 @@ """Test Command line Tool.""" -from typer.testing import CliRunner -from polus.images.formats.image_dimension_stacking.__main__ import app + from pathlib import Path from typing import Union + +from typer.testing import CliRunner import pytest +from polus.images.formats.image_dimension_stacking.__main__ import app def test_cli(synthetic_images: tuple[Union[str, Path]], output_directory: Path) -> None: diff --git a/formats/image-dimension-stacking-tool/tests/test_dimension_stacking.py b/formats/image-dimension-stacking-tool/tests/test_dimension_stacking.py index 2cd39dca4..90ce8cbab 100644 --- a/formats/image-dimension-stacking-tool/tests/test_dimension_stacking.py +++ b/formats/image-dimension-stacking-tool/tests/test_dimension_stacking.py @@ -1,4 +1,5 @@ """Testing of image dimension stacking.""" + from pathlib import Path from typing import Union From 701a93745842f541291c70fe8fef45f8855d332f Mon Sep 17 00:00:00 2001 From: Najib Ishaq Date: Fri, 19 Jul 2024 10:41:37 -0400 Subject: [PATCH 2/5] ci: updated Dockerfile and build script --- .../image-dimension-stacking-tool/Dockerfile | 18 ++++++++++------- .../build-docker.sh | 20 ++++++++++++++++++- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/formats/image-dimension-stacking-tool/Dockerfile b/formats/image-dimension-stacking-tool/Dockerfile index 45071e4c3..9428d4fdd 100644 --- a/formats/image-dimension-stacking-tool/Dockerfile +++ b/formats/image-dimension-stacking-tool/Dockerfile @@ -1,4 +1,4 @@ -FROM polusai/bfio:2.3.6 +FROM polusai/bfio:2.3.3 # environment variables defined in polusai/bfio ENV EXEC_DIR="/opt/executables" @@ -9,13 +9,17 @@ ENV POLUS_LOG="INFO" # Work directory defined in the base container WORKDIR ${EXEC_DIR} -COPY pyproject.toml ${EXEC_DIR} -COPY VERSION ${EXEC_DIR} -COPY README.md ${EXEC_DIR} -COPY src ${EXEC_DIR}/src +# TODO: Change the tool_dir to the tool directory +ENV TOOL_DIR="formats/image-dimension-stacking-tool" -RUN pip3 install ${EXEC_DIR} --no-cache-dir +# Copy the repository into the container +RUN mkdir image-tools +COPY . ${EXEC_DIR}/image-tools -# Default command. Additional arguments are provided through the command line +# Install the tool +RUN pip3 install "${EXEC_DIR}/image-tools/${TOOL_DIR}" --no-cache-dir + +# Set the entrypoint +# TODO: Change the entrypoint to the tool entrypoint ENTRYPOINT ["python3", "-m", "polus.images.formats.image_dimension_stacking"] CMD ["--help"] diff --git a/formats/image-dimension-stacking-tool/build-docker.sh b/formats/image-dimension-stacking-tool/build-docker.sh index 0b0506259..3724d3060 100644 --- a/formats/image-dimension-stacking-tool/build-docker.sh +++ b/formats/image-dimension-stacking-tool/build-docker.sh @@ -1,4 +1,22 @@ #!/bin/bash +# TODO: Change the name of the tool here +tool_dir="formats" +tool_name="image-dimension-stacking-tool" + +# The version is read from the VERSION file version=$( Date: Fri, 19 Jul 2024 10:44:14 -0400 Subject: [PATCH 3/5] =?UTF-8?q?Bump=20version:=200.1.1-dev0=20=E2=86=92=20?= =?UTF-8?q?0.1.1-dev1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- formats/image-dimension-stacking-tool/.bumpversion.cfg | 4 ++-- formats/image-dimension-stacking-tool/README.md | 2 +- formats/image-dimension-stacking-tool/VERSION | 2 +- formats/image-dimension-stacking-tool/plugin.json | 4 ++-- formats/image-dimension-stacking-tool/pyproject.toml | 2 +- .../polus/images/formats/image_dimension_stacking/__init__.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/formats/image-dimension-stacking-tool/.bumpversion.cfg b/formats/image-dimension-stacking-tool/.bumpversion.cfg index 1aa7585a0..0dc18ac77 100644 --- a/formats/image-dimension-stacking-tool/.bumpversion.cfg +++ b/formats/image-dimension-stacking-tool/.bumpversion.cfg @@ -1,6 +1,6 @@ [bumpversion] -current_version = 0.1.1-dev0 -commit = False +current_version = 0.1.1-dev1 +commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? serialize = diff --git a/formats/image-dimension-stacking-tool/README.md b/formats/image-dimension-stacking-tool/README.md index 9918de2a8..f785dd099 100644 --- a/formats/image-dimension-stacking-tool/README.md +++ b/formats/image-dimension-stacking-tool/README.md @@ -1,4 +1,4 @@ -# Image dimension stacking(0.1.1-dev0) +# Image dimension stacking(0.1.1-dev1) This plugin leverages the [filepattern](https://filepattern2.readthedocs.io/en/latest/Home.html) library and employs the filepattern `groupBy` functionality to enable the matching of image filenames, facilitating their stacking into multi-dimensional images. diff --git a/formats/image-dimension-stacking-tool/VERSION b/formats/image-dimension-stacking-tool/VERSION index 44bf4db83..916e7d190 100644 --- a/formats/image-dimension-stacking-tool/VERSION +++ b/formats/image-dimension-stacking-tool/VERSION @@ -1 +1 @@ -0.1.1-dev0 +0.1.1-dev1 diff --git a/formats/image-dimension-stacking-tool/plugin.json b/formats/image-dimension-stacking-tool/plugin.json index af4fcf66b..00294885b 100644 --- a/formats/image-dimension-stacking-tool/plugin.json +++ b/formats/image-dimension-stacking-tool/plugin.json @@ -1,13 +1,13 @@ { "name": "Image Dimension Stacking", - "version": "0.1.1-dev0", + "version": "0.1.1-dev1", "title": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "description": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "author": "Nick Schaub (nick.schaub@nih.gov), Hamdah Shafqat Abbasi (hamdahshafqat.abbasi@nih.gov)", "institution": "National Center for Advancing Translational Sciences, National Institutes of Health", "repository": "https://github.com/PolusAI/image-tools", "website": "https://ncats.nih.gov/preclinical/core/informatics", - "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev0", + "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev1", "baseCommand": [ "python3", "-m", diff --git a/formats/image-dimension-stacking-tool/pyproject.toml b/formats/image-dimension-stacking-tool/pyproject.toml index ed43fee02..aceecc619 100644 --- a/formats/image-dimension-stacking-tool/pyproject.toml +++ b/formats/image-dimension-stacking-tool/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polus-images-formats-image-dimension-stacking" -version = "0.1.1-dev0" +version = "0.1.1-dev1" description = "Stacking multi-dimensional images" authors = [ "Nick Schaub ", diff --git a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py index f0be8f4c4..f09bbfb6c 100644 --- a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py +++ b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py @@ -1,3 +1,3 @@ """Image dimension stacking package.""" -__version__ = "0.1.1-dev0" +__version__ = "0.1.1-dev1" From 53eb9ee9839979c54fc445e0d293f62a24f526a5 Mon Sep 17 00:00:00 2001 From: Najib Ishaq Date: Fri, 19 Jul 2024 11:29:02 -0400 Subject: [PATCH 4/5] build: updated bfio to 2.3.6 --- formats/image-dimension-stacking-tool/Dockerfile | 2 +- formats/image-dimension-stacking-tool/pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/formats/image-dimension-stacking-tool/Dockerfile b/formats/image-dimension-stacking-tool/Dockerfile index 9428d4fdd..3ea4ea281 100644 --- a/formats/image-dimension-stacking-tool/Dockerfile +++ b/formats/image-dimension-stacking-tool/Dockerfile @@ -1,4 +1,4 @@ -FROM polusai/bfio:2.3.3 +FROM polusai/bfio:2.3.6 # environment variables defined in polusai/bfio ENV EXEC_DIR="/opt/executables" diff --git a/formats/image-dimension-stacking-tool/pyproject.toml b/formats/image-dimension-stacking-tool/pyproject.toml index aceecc619..928291f08 100644 --- a/formats/image-dimension-stacking-tool/pyproject.toml +++ b/formats/image-dimension-stacking-tool/pyproject.toml @@ -12,7 +12,7 @@ packages = [{include = "polus", from = "src"}] [tool.poetry.dependencies] python = ">=3.9,<3.12" -bfio = {version = "2.3.3", extras = ["all"]} +bfio = {version = "^2.3.6", extras = ["all"]} typer = "^0.7.0" tqdm = "^4.66.1" filepattern = "^2.0.4" From bec64ad846ed86e2a28c0cdb9c3a20c351963249 Mon Sep 17 00:00:00 2001 From: Najib Ishaq Date: Fri, 19 Jul 2024 11:29:11 -0400 Subject: [PATCH 5/5] =?UTF-8?q?Bump=20version:=200.1.1-dev1=20=E2=86=92=20?= =?UTF-8?q?0.1.1-dev2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- formats/image-dimension-stacking-tool/.bumpversion.cfg | 2 +- formats/image-dimension-stacking-tool/README.md | 2 +- formats/image-dimension-stacking-tool/VERSION | 2 +- formats/image-dimension-stacking-tool/plugin.json | 4 ++-- formats/image-dimension-stacking-tool/pyproject.toml | 2 +- .../polus/images/formats/image_dimension_stacking/__init__.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/formats/image-dimension-stacking-tool/.bumpversion.cfg b/formats/image-dimension-stacking-tool/.bumpversion.cfg index 0dc18ac77..70ad28b93 100644 --- a/formats/image-dimension-stacking-tool/.bumpversion.cfg +++ b/formats/image-dimension-stacking-tool/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.1-dev1 +current_version = 0.1.1-dev2 commit = True tag = False parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+)(?P\d+))? diff --git a/formats/image-dimension-stacking-tool/README.md b/formats/image-dimension-stacking-tool/README.md index f785dd099..bc9d21d30 100644 --- a/formats/image-dimension-stacking-tool/README.md +++ b/formats/image-dimension-stacking-tool/README.md @@ -1,4 +1,4 @@ -# Image dimension stacking(0.1.1-dev1) +# Image dimension stacking(0.1.1-dev2) This plugin leverages the [filepattern](https://filepattern2.readthedocs.io/en/latest/Home.html) library and employs the filepattern `groupBy` functionality to enable the matching of image filenames, facilitating their stacking into multi-dimensional images. diff --git a/formats/image-dimension-stacking-tool/VERSION b/formats/image-dimension-stacking-tool/VERSION index 916e7d190..602bf8b29 100644 --- a/formats/image-dimension-stacking-tool/VERSION +++ b/formats/image-dimension-stacking-tool/VERSION @@ -1 +1 @@ -0.1.1-dev1 +0.1.1-dev2 diff --git a/formats/image-dimension-stacking-tool/plugin.json b/formats/image-dimension-stacking-tool/plugin.json index 00294885b..1fe883b37 100644 --- a/formats/image-dimension-stacking-tool/plugin.json +++ b/formats/image-dimension-stacking-tool/plugin.json @@ -1,13 +1,13 @@ { "name": "Image Dimension Stacking", - "version": "0.1.1-dev1", + "version": "0.1.1-dev2", "title": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "description": "Stacking of image dimensions (c, z, t) to create a multidimensional image.", "author": "Nick Schaub (nick.schaub@nih.gov), Hamdah Shafqat Abbasi (hamdahshafqat.abbasi@nih.gov)", "institution": "National Center for Advancing Translational Sciences, National Institutes of Health", "repository": "https://github.com/PolusAI/image-tools", "website": "https://ncats.nih.gov/preclinical/core/informatics", - "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev1", + "containerId": "polusai/image-dimension-stacking-tool:0.1.1-dev2", "baseCommand": [ "python3", "-m", diff --git a/formats/image-dimension-stacking-tool/pyproject.toml b/formats/image-dimension-stacking-tool/pyproject.toml index 928291f08..c22849be5 100644 --- a/formats/image-dimension-stacking-tool/pyproject.toml +++ b/formats/image-dimension-stacking-tool/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "polus-images-formats-image-dimension-stacking" -version = "0.1.1-dev1" +version = "0.1.1-dev2" description = "Stacking multi-dimensional images" authors = [ "Nick Schaub ", diff --git a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py index f09bbfb6c..2be3bea0e 100644 --- a/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py +++ b/formats/image-dimension-stacking-tool/src/polus/images/formats/image_dimension_stacking/__init__.py @@ -1,3 +1,3 @@ """Image dimension stacking package.""" -__version__ = "0.1.1-dev1" +__version__ = "0.1.1-dev2"