Skip to content

Commit

Permalink
Apply black to _hog.py (#7215)
Browse files Browse the repository at this point in the history
#7153 was merged previously and didn't yet include the most recent
changes from main yet which introduced the black pre-commit hook. So
for a while we'll need to make sure that we merge `main` before
merging.
  • Loading branch information
lagru committed Oct 18, 2023
1 parent 382f8e2 commit 870afe5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions skimage/feature/_hog.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,12 @@ def hog(
if n_blocks_col <= 0 or n_blocks_row <= 0:
min_row = b_row * c_row
min_col = b_col * c_col
raise ValueError('The input image is too small given the values of '
'pixels_per_cell and cells_per_block. '
'It should have at least: '
f'{min_row} rows and {min_col} cols.')
raise ValueError(
'The input image is too small given the values of '
'pixels_per_cell and cells_per_block. '
'It should have at least: '
f'{min_row} rows and {min_col} cols.'
)
normalized_blocks = np.zeros(
(n_blocks_row, n_blocks_col, b_row, b_col, orientations), dtype=float_dtype
)
Expand Down
6 changes: 5 additions & 1 deletion skimage/feature/tests/test_hog.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,4 +353,8 @@ def test_hog_small_image():

img = np.zeros((23, 23))
with pytest.raises(ValueError, match=".*image is too small given"):
feature.hog(img, pixels_per_cell=(8, 8), cells_per_block=(3, 3),)
feature.hog(
img,
pixels_per_cell=(8, 8),
cells_per_block=(3, 3),
)

0 comments on commit 870afe5

Please sign in to comment.