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
With very degenerate cases, I get n_points = 0 and memory dumps occur (on linux). The real issue is the n_points computation, not the memory dump, which is only a consequence of bad n_points).
Here is a matrix that triggers the bug (for some reason the true/except block also triggers the core dump immediately, otherwise it takes a few calls to car.Skeleton):
import numpy as np
from skan import csr
X = np.array([1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1]).astype(bool)
try:
S = csr.Skeleton(X)
except Exception as E:
print(E)
The text was updated successfully, but these errors were encountered:
ssavary
changed the title
n_points seems to incorrectly handle degree-0 nodes in _build_skeleton_path_graph()
_build_skeleton_path_graph() incorrectly handles degree-0 nodes in calculating n_points
Dec 1, 2022
ssavary
changed the title
_build_skeleton_path_graph() incorrectly handles degree-0 nodes in calculating n_points
_build_skeleton_path_graph() incorrectly handles degree-0 nodes in calculation of n_points
Dec 1, 2022
skan/src/skan/csr.py
Lines 395 to 400 in 1f71a5b
skan/src/skan/csr.py
Lines 406 to 409 in 1f71a5b
Degree 0 nodes are mistakenly removed from the set. The correction calculation should be:
With very degenerate cases, I get n_points = 0 and memory dumps occur (on linux). The real issue is the n_points computation, not the memory dump, which is only a consequence of bad n_points).
Here is a matrix that triggers the bug (for some reason the true/except block also triggers the core dump immediately, otherwise it takes a few calls to car.Skeleton):
The text was updated successfully, but these errors were encountered: