Skip to content

Commit 6849592

Browse files
fix: handle case of n_elements decreasing, as defensive coding (not in scope)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 4fb0bdf commit 6849592

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/gh/diffCheck/diffCheck/df_poses.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def __post_init__(self):
108108
self.n_step = max(lengths) if lengths else 0
109109

110110
def add_step(self, new_poses: list[DFPose]):
111-
for i, pose in enumerate(new_poses):
111+
element_count = max(len(new_poses), len(self.poses_per_element_dictionary))
112+
for i in range(element_count):
113+
pose = new_poses[i] if i < len(new_poses) else None
112114
if f"element_{i}" not in self.poses_per_element_dictionary:
113115
self.poses_per_element_dictionary[f"element_{i}"] = DFPosesBeam({}, 4)
114116
for j in range(self.n_step):

0 commit comments

Comments
 (0)