Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 0 additions & 8 deletions .isort.cfg

This file was deleted.

18 changes: 0 additions & 18 deletions napari_cellseg3d/_tests/conftest.py

This file was deleted.

2 changes: 0 additions & 2 deletions napari_cellseg3d/_tests/pytest.ini

This file was deleted.

8 changes: 7 additions & 1 deletion napari_cellseg3d/_tests/test_weight_download.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import os
Comment thread
C-Achard marked this conversation as resolved.
import pytest

from napari_cellseg3d.code_models.workers_utils import (
PRETRAINED_WEIGHTS_DIR,
WeightsDownloader,
)


# DISABLED, causes GitHub actions to freeze
@pytest.mark.skipif(
os.getenv("GITHUB_ACTIONS") == "true",
Comment thread
C-Achard marked this conversation as resolved.
Outdated
reason="This test causes GitHub Actions to freeze",
)
def test_weight_download():
downloader = WeightsDownloader()
downloader.download_weights("test", "test.pth")
Expand Down
4 changes: 2 additions & 2 deletions napari_cellseg3d/code_models/worker_inference.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains the :py:class:`~InferenceWorker` class, which is a custom worker to run inference jobs in."""

import platform
import sys
from pathlib import Path
Expand Down Expand Up @@ -268,7 +269,6 @@ def load_layer(self):
f" please check for extra channel/batch dimensions"
)
volume = utils.correct_rotation(volume)
# volume = np.reshape(volume, newshape=(1, 1, *volume.shape))

dims_check = volume.shape

Expand All @@ -280,7 +280,7 @@ def load_layer(self):
if self.config.model_info.name != "WNet3D"
else lambda x: x
)
volume = np.reshape(volume, newshape=(1, *volume.shape))
volume = volume.reshape((1, *volume.shape))
if self.config.sliding_window_config.is_enabled():
load_transforms = Compose(
[
Expand Down
3 changes: 2 additions & 1 deletion napari_cellseg3d/dev_scripts/correct_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ def relabel(
np.isin(artefact, i_labels_to_add), 0, artefact
)
if viewer is None:
viewer = napari.view_image(image)
viewer = napari.Viewer()
images = viewer.add_image(image, name="image")
Comment thread
C-Achard marked this conversation as resolved.
Outdated
else:
viewer = viewer
viewer.add_image(image, name="image")
Expand Down
36 changes: 14 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ classifiers = [
"Topic :: Software Development :: Testing",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
Comment thread
C-Achard marked this conversation as resolved.
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand All @@ -43,17 +43,19 @@ dependencies = [
# "nibabel",
# "pillow",
"pyclesperanto",
"tqdm",
"matplotlib",
"pydensecrf2",
Comment thread
C-Achard marked this conversation as resolved.
]
dynamic = ["version", "entry-points"]
dynamic = ["version"]
Comment thread
C-Achard marked this conversation as resolved.

[project.urls]
Homepage = "https://github.com/AdaptiveMotorControlLab/CellSeg3D"
Documentation = "https://adaptivemotorcontrollab.github.io/cellseg3d-docs/res/welcome.html"
Issues = "https://github.com/AdaptiveMotorControlLab/CellSeg3D/issues"

[project.entry-points."napari.manifest"]
"napari_cellseg3d" = "napari_cellseg3d:napari.yaml"

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
Expand All @@ -65,7 +67,7 @@ include-package-data = true
where = ["."]

[tool.setuptools.package-data]
"*" = ["res/*.png", "code_models/models/pretrained/*.json", "*.yaml"]
"*" = ["res/*.png", "code_models/models/pretrained/*.json", "*.yaml", "napari.yaml"]

[tool.ruff]
select = [
Expand All @@ -79,7 +81,7 @@ select = [
"PTH",
"RET",
"SIM",
"TCH",
"TC",
"NPY",
]
# Never enforce `E501` (line length violations) and 'E741' (ambiguous variable names)
Expand Down Expand Up @@ -116,23 +118,13 @@ exclude = [
[tool.ruff.pydocstyle]
convention = "google"

[tool.black]
line-length = 79

[tool.isort]
profile = "black"
line_length = 79

[project.optional-dependencies]
pyqt5 = [
"pyqt5",
]
pyside2 = [
"pyside2",
]
pyside6 = [
"pyside6",
]
pyqt6 = [
"PyQt6",
Comment thread
C-Achard marked this conversation as resolved.
Outdated
]
onnx-cpu = [
"onnx",
"onnxruntime"
Expand All @@ -145,11 +137,8 @@ wandb = [
"wandb"
]
dev = [
"isort",
"black",
"ruff",
"pre-commit",
"tuna",
"twine",
]
docs = [
Expand All @@ -165,3 +154,6 @@ test = [
"onnx",
"onnxruntime",
]
crf = [
"pydensecrf2",
]
24 changes: 0 additions & 24 deletions requirements.txt

This file was deleted.

45 changes: 0 additions & 45 deletions setup.cfg

This file was deleted.

31 changes: 8 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
# For more information about tox, see https://tox.readthedocs.io/en/latest/
[tox]
envlist = py{38,39,310}-{linux}
; envlist = py{38,39,310}-{linux,macos,windows}
envlist = py{310,311,312}-{linux}
isolated_build=true

[gh-actions]
python =
Comment thread
C-Achard marked this conversation as resolved.
Outdated
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
; windows-latest: windows
; macos-latest: macos
windows-latest: windows
macos-latest: macos

[testenv]
platform =
linux: linux
; windows: win32
; macos: darwin
windows: win32
macos: darwin
passenv =
CI
PYTHONPATH
Expand All @@ -29,20 +28,6 @@ passenv =
XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
deps =
pytest # https://docs.pytest.org/en/latest/contents.html
pytest-cov # https://pytest-cov.readthedocs.io/en/latest/
napari
PyQt5
magicgui
pytest-qt
qtpy
git+https://github.com/lucasb-eyer/pydensecrf.git@master#egg=pydensecrf
onnx
onnxruntime
monai[tifffile]
; pyopencl[pocl]
; opencv-python
extras = crf
extras = test,crf,pyqt6
usedevelop = true
commands = pytest -v --color=yes --cov=napari_cellseg3d --cov-report=xml
Loading