Skip to content

Commit e41dd17

Browse files
committed
make ASR init kw only, fix name and memory kwargs
1 parent 81efe6e commit e41dd17

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

meegkit/asr.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ class ASR:
5656
method : {'riemann', 'euclid'}
5757
Method to use. If riemann, use the riemannian-modified version of
5858
ASR [2]_.
59-
memory : float
59+
memory : float | None
6060
Memory size (s), regulates the number of covariance matrices to store.
61+
If None (default), will use twice the sampling frequency.
6162
estimator : {'scm', 'lwf', 'oas', 'mcd'}
6263
Covariance estimator (default: 'scm' which computes the sample
6364
covariance). Use 'lwf' if you need regularization (requires pyriemann).
@@ -96,9 +97,9 @@ class ASR:
9697
9798
"""
9899

99-
def __init__(self, sfreq=250, cutoff=5, blocksize=100, win_len=0.5,
100+
def __init__(self, *, sfreq=250, cutoff=5, blocksize=100, win_len=0.5,
100101
win_overlap=0.66, max_dropout_fraction=0.1,
101-
min_clean_fraction=0.25, name="asrfilter", method="euclid",
102+
min_clean_fraction=0.25, method="euclid", memory=None,
102103
estimator="scm", **kwargs):
103104

104105
if pyriemann is None and method == "riemann":
@@ -113,7 +114,10 @@ def __init__(self, sfreq=250, cutoff=5, blocksize=100, win_len=0.5,
113114
self.min_clean_fraction = min_clean_fraction
114115
self.max_bad_chans = 0.3
115116
self.method = method
116-
self.memory = int(2 * sfreq) # smoothing window for covariances
117+
if memory is None:
118+
self.memory = int(2 * sfreq) # smoothing window for covariances
119+
else:
120+
self.memory = memory
117121
self.sample_weight = np.geomspace(0.05, 1, num=self.memory + 1)
118122
self.sfreq = sfreq
119123
self.estimator = estimator

0 commit comments

Comments
 (0)