Skip to content

Commit e0b8d59

Browse files
authored
Update Polus-autocropping-plugin (PolusAI#596)
* add project.toml, update pachages for cp313,update bfio, helpers.py (Generator) * fix autocrop.py and crrate a local utils * add .bumpversion.cfg and bump2 new version * update gitignore * update Dockerfile, pyproject.toml
1 parent f539f71 commit e0b8d59

19 files changed

Lines changed: 582 additions & 374 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[bumpversion]
2+
current_version = 1.0.3
3+
commit = False
4+
tag = False
5+
6+
[bumpversion:file:VERSION]
7+
8+
[bumpversion:file:plugin.json]
9+
10+
[bumpversion:file:pyproject.toml]
11+
search = version = "{current_version}"
12+
replace = version = "{new_version}"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uv.lock
Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
FROM polusai/bfio:2.1.9
2-
3-
COPY requirements.txt .
4-
5-
RUN pip3 install -r requirements.txt --no-cache-dir
6-
7-
COPY VERSION /
8-
COPY src ${EXEC_DIR}/
9-
1+
# Build from repo root (monorepo) or from this tool directory — both work.
2+
FROM polusai/bfio:2.5.0
3+
ENV EXEC_DIR="/opt/executables" POLUS_IMG_EXT=".ome.tif" POLUS_TAB_EXT=".csv" POLUS_LOG="INFO"
104
WORKDIR ${EXEC_DIR}
11-
12-
ENTRYPOINT ["python3", "/opt/executables/main.py"]
5+
ENV TOOL_DIR="transforms/images/polus-autocropping-plugin"
6+
RUN mkdir -p image-tools
7+
COPY . ${EXEC_DIR}/image-tools
8+
RUN pip3 install -U pip setuptools wheel \
9+
&& python3 -c 'import sys; assert sys.version_info>=(3,11)' \
10+
&& R="${EXEC_DIR}/image-tools" && M="$R/$TOOL_DIR" \
11+
&& if [ -f "$M/pyproject.toml" ]; then pip3 install --no-cache-dir "$M"; \
12+
else pip3 install --no-cache-dir "$R"; fi
13+
ENTRYPOINT ["python3", "-m", "main"]
14+
CMD ["--help"]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.2
1+
1.0.3

transforms/images/polus-autocropping-plugin/plugin.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "Autocropping",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"title": "Autocropping",
55
"description": "Automatically remove noise and other useless sections from images.",
66
"author": "Najib Ishaq (najib.ishaq@axleinfo.com)",
77
"institution": "National Center for Advancing Translational Sciences, National Institutes of Health",
88
"repository": "https://github.com/PolusAI/polus-plugins/transforms/images/polus-autocropping-plugin",
99
"website": "https://ncats.nih.gov/preclinical/core/informatics",
1010
"citation": "",
11-
"containerId": "polusai/autocropping-plugin:1.0.2",
11+
"containerId": "polusai/autocropping-plugin:1.0.3",
1212
"inputs": [
1313
{
1414
"name": "inputDir",
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[project]
2+
name = "polus-autocropping-plugin"
3+
version = "1.0.3"
4+
requires-python = ">=3.11"
5+
dependencies = [
6+
"bfio>=2.5.0",
7+
"filepattern>=2.2.1",
8+
"scipy>=1.11.0",
9+
]
10+
11+
[build-system]
12+
requires = ["setuptools>=61.0", "wheel"]
13+
build-backend = "setuptools.build_meta"
14+
15+
[tool.setuptools.packages.find]
16+
where = ["src"]
17+
18+
[tool.mypy]
19+
python_version = "3.11"
20+
# Package lives under src/ (autocrop_utils avoids clash with repo-root utils/)
21+
mypy_path = "src"
22+
explicit_package_bases = true
23+
namespace_packages = true
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
filepattern==1.4.7
2-
scipy>=1.7.1
2+
scipy>=1.7.1
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
from . import utils
1+
"""Polus autocropping plugin."""
22
from . import autocrop
3+
from . import autocrop_utils

0 commit comments

Comments
 (0)