Skip to content

Commit aec4384

Browse files
committed
Make it backward compatible??
1 parent cfbad45 commit aec4384

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

suite2p/detection/stats.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from dataclasses import dataclass, field
88
from warnings import warn
99

10+
import sys
1011
import numpy as np
1112
from numpy.linalg import norm
1213
from scipy.spatial import ConvexHull
@@ -58,7 +59,10 @@ class ROI:
5859
lam: np.ndarray
5960
med: np.ndarray
6061
do_crop: bool
61-
rsort: np.ndarray = field(default_factory=default_rsort, repr=False)
62+
if sys.version_info >= (3, 12):
63+
rsort: np.ndarray = field(default_factory=default_rsort, repr=False)
64+
else:
65+
rsort: np.ndarray = field(default=np.sort(distance_kernel(radius=30).flatten()), repr=False)
6266

6367
def __post_init__(self):
6468
"""Validate inputs."""

0 commit comments

Comments
 (0)