Skip to content

Commit

Permalink
bypass warning by default
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudon committed Feb 6, 2024
1 parent 952103b commit 2f5fbc4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions efel/pyfeatures/pyfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def strict_burst_number() -> np.ndarray:
return np.array([burst_mean_freq.size])


def all_burst_number():
def all_burst_number(raise_warnings: bool = False) -> np.ndarray:
"""The number of all the bursts, even if they have a single AP.
Instead of relying on burst_mean_freq, we split the ISIs into two groups,
Expand Down Expand Up @@ -170,11 +170,12 @@ def all_burst_number():
# here we check is the gap between the two group of ISIs is big enough
# to be considered a burst behaviour, the 1.2 and 0.8 are fairly arbitrary
if len(isis[(isis < 1.2 * thresh) & (isis > 0.8 * thresh)]) > 0:
warnings.warn(
"""While calculating all_burst_number,
there are spike around the threshold, we return 0 bursts""",
RuntimeWarning
)
if raise_warnings:
warnings.warn(
"""While calculating all_burst_number,
there are spike around the threshold, we return 0 bursts""",
RuntimeWarning
)

return np.array([0])
return np.array([len(isis[isis > thresh])])
Expand Down

0 comments on commit 2f5fbc4

Please sign in to comment.