use warnings module
from pathlib import Path
import numpy as np
+import warnings
from spikeinterface.core import load_extractor
from spikeinterface.extractors import KiloSortSortingExtractor
@@ -181,7 +182,7 @@ class PyKilosortSorter(BaseSorter):
if len(np.unique(gains)) == 1:
ks_probe.sample2volt = gains[0] * 1e-6
else:
- UserWarning('Multiple gains detected for different channels. Median gain will be used')
+ warnings.warn('Multiple gains detected for different channels. Median gain will be used')
ks_probe.sample2volt = np.median(gains) * 1e-6
else:
ks_probe.sample2volt = 1e-6
