Skip to content

Commit

Permalink
[pre-commit.ci] Fixing issues with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 10, 2025
1 parent ac08760 commit a9db222
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/test_grains.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import numpy.typing as npt
import pytest

from topostats.grains import Grains, ImageGrainCrops, GrainCropsDirection, GrainCrop
from topostats.grains import GrainCrop, GrainCropsDirection, Grains, ImageGrainCrops
from topostats.io import dict_almost_equal

# Pylint returns this error for from skimage.filters import gaussian
Expand Down
8 changes: 2 additions & 6 deletions topostats/grains.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,9 +1055,7 @@ def vet_class_sizes_single_grain(
continue

lower_threshold, upper_threshold = [
vetting_criteria[1:]
for vetting_criteria in class_size_thresholds
if vetting_criteria[0] == class_index
vetting_criteria[1:] for vetting_criteria in class_size_thresholds if vetting_criteria[0] == class_index
][0]

if lower_threshold is not None:
Expand Down Expand Up @@ -1798,9 +1796,7 @@ def extract_grains_from_full_image_tensor(

# Crop the tensor
# Get the bounding box for the region
flat_bounding_box: tuple[int, int, int, int] = tuple(
flat_region.bbox
) # min_row, min_col, max_row, max_col
flat_bounding_box: tuple[int, int, int, int] = tuple(flat_region.bbox) # min_row, min_col, max_row, max_col

# Pad the mask
padded_flat_bounding_box = pad_bounding_box(
Expand Down

0 comments on commit a9db222

Please sign in to comment.