Skip to content

Commit

Permalink
fix as_relative, add test
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjinliu committed May 30, 2023
1 parent 7d1a82f commit 5416b30
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 84 deletions.
4 changes: 2 additions & 2 deletions cylindra/project/_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ def from_gui(

file_dir = json_path.parent

def as_relative(p: Path):
assert isinstance(p, Path)
def as_relative(p: "Path | None"):
assert isinstance(p, Path) or p is None
try:
out = p.relative_to(file_dir)
except Exception:
Expand Down
4 changes: 2 additions & 2 deletions cylindra/widgets/_progress_desc.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from cylindra.const import ImageFilter

if TYPE_CHECKING:
from napari.layers import Layer
from cylindra.const import ImageFilter


# functions
Expand All @@ -29,7 +29,7 @@ def _formatter(layers: list[Layer]):


def filter_image_fmt(method: ImageFilter):
return f"Running {method.name} filter"
return f"Running {ImageFilter(method).name} filter"


def align_averaged_fmt(layers: list[Layer]):
Expand Down
Loading

0 comments on commit 5416b30

Please sign in to comment.