Skip to content

Commit

Permalink
Merge pull request #72 from fmi-faim/update-test-cellpose
Browse files Browse the repository at this point in the history
Relax test for cellpose segmentation
  • Loading branch information
imagejan authored Oct 9, 2024
2 parents d20b810 + ab5d1b7 commit ffac4a7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "hatchling.build"
name = "faim-wako-searchfirst"
description = ''
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
license = "MIT"
keywords = []
authors = [
Expand All @@ -19,16 +19,18 @@ authors = [
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"cellpose",
"confuse",
"numpy",
"pandas",
"rich",
"scikit-image",
"tqdm",
Expand All @@ -50,6 +52,7 @@ dependencies = [
"pytest",
"pytest-cov",
]

[tool.hatch.envs.default.scripts]
cov = "pytest --cov-report=term-missing --cov-config=pyproject.toml --cov=faim_wako_searchfirst --cov=tests {args}"
no-cov = "cov --no-cov {args}"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cellpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ def test_cellpose(_data_path):
reader = csv.reader(csv_file, quoting=csv.QUOTE_NONNUMERIC)
entries = list(reader)
assert len(entries) == 3, "Incorrect number of objects detected."
assert entries[0] == pytest.approx([1, 40.5, 30.5])
assert entries[1] == pytest.approx([2, 158.5, 58.5])
assert entries[2] == pytest.approx([3, 79.5287, 146.4483])
assert entries[0] == pytest.approx([1, 40.5, 30.5], rel=1e-2)
assert entries[1] == pytest.approx([2, 158.5, 58.5], rel=1e-2)
assert entries[2] == pytest.approx([3, 79.5, 146.5], rel=1e-2)

segmentation_folder = _data_path.parent / (_data_path.name + "_segmentation")
assert sum(1 for _ in segmentation_folder.glob("*")) == 1

0 comments on commit ffac4a7

Please sign in to comment.