Skip to content

Commit

Permalink
style(pre-commit.ci): auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 2, 2024
1 parent ba4d884 commit 42cf7fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/nd2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

if TYPE_CHECKING:
# uses optional tifffile dependency
from .tiff import nd2_to_tiff # noqa: TCH004
from .tiff import nd2_to_tiff # noqa: TC004

try:
__version__ = version(__name__)
Expand All @@ -15,15 +15,15 @@
__author__ = "Talley Lambert"
__email__ = "[email protected]"
__all__ = [
"__version__",
"AXIS",
"BinaryLayer",
"BinaryLayers",
"ND2File",
"__version__",
"imread",
"is_legacy",
"is_supported_file",
"nd2_to_tiff",
"ND2File",
"rescue_nd2",
"structures",
]
Expand Down
4 changes: 2 additions & 2 deletions src/nd2/_parse/_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ def _calc_zstack_home_index(
home_range_i = abs(high_um - home_um)

if type_ in {2, 3}:
hrange = inverted and home_range_i or home_range_f
hrange = (inverted and home_range_i) or home_range_f
elif type_ in {6, 7}:
hrange = inverted and home_range_f or home_range_i
hrange = (inverted and home_range_f) or home_range_i

Check warning on line 131 in src/nd2/_parse/_parse.py

View check run for this annotation

Codecov / codecov/patch

src/nd2/_parse/_parse.py#L131

Added line #L131 was not covered by tests
else:
return (count - 1) // 2

Expand Down
6 changes: 2 additions & 4 deletions tests/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,8 @@ def _assert_lim_close_enough(a: Any, lim_data: Any, key=()):
# lim may set {} or [] to None
return
# FIXME: bytearrays
if (
isinstance(lim_data, str)
and isinstance(a, list)
or isinstance(a, bytearray)
if (isinstance(lim_data, str) and isinstance(a, list)) or isinstance(
a, bytearray
):
return
if key and key[-1] == "bUseZ":
Expand Down

0 comments on commit 42cf7fb

Please sign in to comment.