Skip to content
Snippets Groups Projects
Commit 3a1ca159 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Fix issue with 0 rates

parent d19548dd
No related branches found
No related tags found
No related merge requests found
......@@ -147,7 +147,11 @@ class TriggerRate(kp.Module):
def write_trigger_rates(self, timestamp, trigger_rates):
entry = f"{timestamp}"
for trigger_type in self._trigger_types:
entry += f",{trigger_rates[trigger_type]}"
try:
trigger_rate = trigger_rates[trigger_type]
except KeyError:
trigger_rate = 0
entry += f",{trigger_rate}"
entry += '\n'
self.trigger_rates_fobj.write(entry)
self.trigger_rates_fobj.flush()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment