Fixed memes
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Pünkösd Marcell 2020-10-03 14:33:00 +02:00
parent 5d4b3cfe60
commit eef15fc0b8
3 changed files with 8 additions and 8 deletions

View File

@ -97,7 +97,6 @@ def main() -> None:
client.loop_forever() # This blocks
except KeyboardInterrupt:
logging.info("SIGINT recieved! Stopping...")
pass
client.disconnect()
loopingtimer.stop()

View File

@ -80,8 +80,9 @@ class SoundPreProcessor(AbcPreProcessor):
logging.info("The loaded model contains the following classes: " + ", ".join(self._classes))
if target_class_name not in self._classes:
raise Exception(
f"The specified target class {target_class_name} is not in the possible classes (Wrong model info?)")
raise ValueError(
f"The specified target class {target_class_name} is not in the possible classes (Wrong model info?)"
)
self._target_id = self._classes.index(target_class_name)
@ -97,10 +98,10 @@ class SoundPreProcessor(AbcPreProcessor):
signal = audioBasicIO.stereo_to_mono(signal)
if sampling_rate == 0:
raise Exception("Could not read the file properly: Sampling rate zero")
raise AssertionError("Could not read the file properly: Sampling rate zero")
if signal.shape[0] / float(sampling_rate) <= self._mid_window:
raise Exception("Could not read the file properly: Signal shape is not good")
raise AssertionError("Could not read the file properly: Signal shape is not good")
# feature extraction:
mid_features, s, _ = \

View File

@ -15,7 +15,7 @@ class LoopingTimer:
"""
Looping timer. Executes a function and repeates it in the given interval.
"""
def __init__(self, interval, function, tick_args=[], tick_kwargs={}):
def __init__(self, interval, function, tick_args=None, tick_kwargs=None):
"""
Initialize class
:param interval:
@ -26,8 +26,8 @@ class LoopingTimer:
self._timer = None
self.interval = interval
self.function = function
self._tick_args = tick_args
self._tick_kwargs = tick_kwargs
self._tick_args = tick_args or []
self._tick_kwargs = tick_kwargs or {}
self.is_running = False
self.start()