Skip to content

Commit

Permalink
enh: improve sanity checks for BackgroundRollMed
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed May 17, 2024
1 parent f14fa21 commit 7a28906
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
0.18.1
- enh: improve sanity checks for `BackgroundRollMed`
0.18.0
- BREAKING CHANGE: mask postprocessing did a morphological opening instead
of a morphological closing, failing to remove spurious noise
Expand Down
5 changes: 3 additions & 2 deletions src/dcnum/feat/feat_background/bg_roll_median.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def check_user_kwargs(*,
"""Check user-defined properties of this class
This method primarily exists so that the CLI knows which
keyword arguements can be passed to this class.
keyword arguments can be passed to this class.
Parameters
----------
Expand All @@ -132,7 +132,8 @@ def check_user_kwargs(*,
`kernel_size` will not increase computation speed. Larger
values lead to a higher memory consumption.
"""
assert kernel_size > 0
assert kernel_size > 0, "kernel size must be positive number"
assert kernel_size % 2 == 0, "kernel size must be even number"
assert batch_size > kernel_size

def get_slices_for_batch(self, batch_index=0):
Expand Down

0 comments on commit 7a28906

Please sign in to comment.