summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-01-14 14:55:28 +0100
committerDaniel Friesel <daniel.friesel@uos.de>2021-01-14 14:55:28 +0100
commit3b3d166b266a6467591e1617a8856b211d9006ca (patch)
tree8d9c66117da39c769ad18f16dc355543e230bbef /lib
parent2fbaeecc98b0cc7ed2ec436a15b4d60bebc694a3 (diff)
energytrace drift compensation: partially handle lack of candidates
Diffstat (limited to 'lib')
-rw-r--r--lib/lennart/DataProcessor.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/lennart/DataProcessor.py b/lib/lennart/DataProcessor.py
index 23e6766..7c161ab 100644
--- a/lib/lennart/DataProcessor.py
+++ b/lib/lennart/DataProcessor.py
@@ -291,8 +291,10 @@ class DataProcessor:
delta_drift = np.abs(prev_drift - new_drift)
csr_weights.append(delta_drift)
- prev_nodes = new_nodes
- prev_drifts = new_drifts
+ # a transition's candidate list may be empty
+ if len(new_nodes):
+ prev_nodes = new_nodes
+ prev_drifts = new_drifts
# add an end node for shortest path search
# (end node == final sync, so drift == 0)