Enable linting rules for S110: try-except-pass#495
Conversation
|
|
||
| if mode == "multi-otsu": | ||
| try: | ||
| with contextlib.suppress(ValueError): |
There was a problem hiding this comment.
Note, this uses a more specific exception, that seems likely to actually be raised by threshold_multiotsu.
|
|
||
| if mode == "multi-otsu": | ||
| try: | ||
| with contextlib.suppress(ValueError): |
There was a problem hiding this comment.
@BryonLewis Can you verify that the correct behavior on an exception is indeed to silently proceed to the end of the function and call np.percentile instead?
There was a problem hiding this comment.
I'll test it tomorrow. There may be an argument for removing this whole contour extraction from the application. We were using it before to generate contours from spectrogram images for clearer delineation between values, but without some decent filtering (reduction in contour accuracy) and not knowing the size of the wav files, the loading times and data size could be too large to be generally useful.
We have disabled this section of the conversion process from wav to spectrogram + metadata.
There was a problem hiding this comment.
Sure. That is indeed what the code did and still does. I just wondered if it was overly eager to suppress exceptions that should actually be allowed to cause a failure.
No description provided.