Skip to content

Commit

Permalink
Added a clearer error message for hSFA _checkValidSteps
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzLange committed Oct 18, 2023
1 parent 3ef5341 commit 82f9d94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sksfa/utils/_recfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,8 @@ def _checkValidSteps(self, dimension, field_size, field_stride):
Number of slices, given the provided parameters.
"""
n_valid_steps = (dimension - field_size)/field_stride + 1
assert(int(n_valid_steps) == n_valid_steps)
if int(n_valid_steps) != n_valid_steps:
raise AssertionError(f"(dimension-field_size)/field_stride+1, here ({dimension}-{field_size})/{field_stride}+1, is not an integer!")
return int(n_valid_steps)

def _sliceSingleSample(self, sample, field_rows, field_cols, row_stride, col_stride):
Expand Down

0 comments on commit 82f9d94

Please sign in to comment.