Skip to content

Commit

Permalink
🤖 pre-commit auto fixes [...]
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Apr 8, 2024
1 parent fab6c25 commit 58a4cd1
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 18 deletions.
1 change: 1 addition & 0 deletions tests/enums/test_color_space.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for the color space enum."""

import pytest

import wsic
Expand Down
15 changes: 9 additions & 6 deletions tests/test_wsic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for `wsic` package."""

import sys
import warnings
from pathlib import Path
Expand Down Expand Up @@ -1230,12 +1231,14 @@ def test_convert(
out_path,
shape=reader.shape,
codec=codec,
compression_level=4
if codec
in {
"blosc",
}
else 100,
compression_level=(
4
if codec
in {
"blosc",
}
else 100
),
)
writer.copy_from_reader(
reader,
Expand Down
1 change: 1 addition & 0 deletions wsic/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Console script for wsic."""

import sys
from contextlib import suppress
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions wsic/enums.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Enumerated types used by wsic."""

from enum import Enum
from numbers import Number
from typing import Any, Dict, Optional, Tuple
Expand Down
1 change: 1 addition & 0 deletions wsic/magic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Detect file type by searching for signatures (magic numbers)."""

import mmap
import re
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions wsic/metadata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Metadata parsing and generation."""

from . import ngff

__all__ = ["ngff"]
1 change: 1 addition & 0 deletions wsic/metadata/ngff.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Based on version 0.4 of the specification:
https://ngff.openmicroscopy.org/0.4/
"""

import sys
from dataclasses import dataclass, field
from numbers import Number
Expand Down
1 change: 1 addition & 0 deletions wsic/typedefs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Type definitions for wsic."""

import re
from pathlib import Path
from typing import Union
Expand Down
1 change: 1 addition & 0 deletions wsic/validation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Functions used for data validation."""

import warnings

from wsic.utils import mpp2ppu
Expand Down
26 changes: 14 additions & 12 deletions wsic/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1395,18 +1395,20 @@ def _write_ome_metadata(self, mpp: Tuple[float, ...]) -> None:
datasets=[
ngff.Dataset(
path=str(level),
coordinateTransformations=[
ngff.CoordinateTransformation(
"scale",
[
mpp[0] * downsample,
mpp[1] * downsample,
1,
],
)
]
if mpp is not None
else [ngff.CoordinateTransformation("identity")],
coordinateTransformations=(
[
ngff.CoordinateTransformation(
"scale",
[
mpp[0] * downsample,
mpp[1] * downsample,
1,
],
)
]
if mpp is not None
else [ngff.CoordinateTransformation("identity")]
),
)
for level, downsample in enumerate(
[1] + self.pyramid_downsamples
Expand Down

0 comments on commit 58a4cd1

Please sign in to comment.