Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: \[e.g. Ubuntu\]
- Hardware \[e.g. 8GB RAM\]
- Version \[e.g. 1.0.0\]
- OS: [e.g. Ubuntu]
- Hardware [e.g. 8GB RAM]
- Version [e.g. 1.0.0]

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ assignees: John-P
______________________________________________________________________

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when \[...\]
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
Expand Down
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
autoupdate_commit_msg: ':robot: pre-commit autoupdate'
repos:
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.16
rev: 1.0.0
hooks:
- id: mdformat
# Optionally add plugins
Expand All @@ -12,7 +12,7 @@ repos:
- mdformat-black
- mdformat-shfmt
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-added-large-files
args: ['--maxkb=50000']
Expand All @@ -34,17 +34,17 @@ repos:
- id: trailing-whitespace
exclude: 'setup.cfg'
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0 # Replace with any tag/version: https://github.com/psf/black/tags
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.11.0 # Replace with any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.3.0
hooks:
- id: flake8
additional_dependencies: [
Expand Down
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
30 changes: 17 additions & 13 deletions wsic/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
from wsic.enums import Codec, ColorSpace
from wsic.metadata import ngff
from wsic.readers import DICOMWSIReader, Reader, TIFFReader
from wsic.tile_iterators import DaskTileIterator
from wsic.tile_iterators import (
DaskTileIterator,
)
from wsic.tile_iterators import (
PersistentMultiProcessTileIterator as MultiProcessTileIterator,
)
Expand Down Expand Up @@ -1395,18 +1397,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
Loading