You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The read_skeletons function fails when multiple skeletons without the same nodes is read.
Summary:
The function that reads in skeletons from .slp files will read in all the names of nodes, then sort + subsets each skeleton. Due to a re-used variable name (node_names in L210 linked below), the full list of nodes becomes the first skeletons subset. Causes either IndexError if indices of second skeleton happen to point outside first skeletons sub-list or simply carries forward incorrect node names.
The offending lines are here:
Node names defined outside loop:
The
read_skeletons
function fails when multiple skeletons without the same nodes is read.Summary:
The function that reads in skeletons from .slp files will read in all the names of nodes, then sort + subsets each skeleton. Due to a re-used variable name (
node_names
in L210 linked below), the full list of nodes becomes the first skeletons subset. Causes either IndexError if indices of second skeleton happen to point outside first skeletons sub-list or simply carries forward incorrect node names.The offending lines are here:
Node names defined outside loop:
sleap-io/sleap_io/io/slp.py
Line 190 in 9a04f7f
Full list modified to sub-list here:
sleap-io/sleap_io/io/slp.py
Line 210 in 9a04f7f
Sub-list used later (once here):
sleap-io/sleap_io/io/slp.py
Line 214 in 9a04f7f
Using a second variable (eg
sorted_node_names
) in 210 and 214 appears to fix this.The text was updated successfully, but these errors were encountered: