Skip to content

Commit 99bd2a8

Browse files
committed
RFC, WIP: proposal to add optional steps to config
1 parent c985968 commit 99bd2a8

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

pylossless/assets/ll_default_config_adults.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ project:
2626

2727
######################## Task break detection ########################
2828
# See arguments definition from mne.preprocessing.annotate_breaks
29-
find_breaks:
29+
# Uncomment dict to enable task break detection with default values
30+
find_breaks: # {}
3031

3132
############################## epoching ##############################
3233
epoching:
@@ -53,6 +54,12 @@ nearest_neighbors:
5354
n_nbr_epoch: 3
5455

5556
####################### Pipeline steps config ########################
57+
58+
# The following two steps are optional and are not enabled by default.
59+
# Uncomment the {} to enable them with default values.
60+
flag_channels_fixed_threshold: # {}
61+
flag_epochs_fixed_threshold: # {}
62+
5663
bridged_channels:
5764
bridge_trim: 40
5865
bridge_z: 6

pylossless/assets/ll_default_config_infants.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ project:
2626

2727
######################## Task break detection ########################
2828
# See arguments definition from mne.preprocessing.annotate_breaks
29-
find_breaks:
29+
# Uncomment dict to enable task break detection with default values
30+
find_breaks: # {}
3031

3132
############################## epoching ##############################
3233
epoching:
@@ -53,6 +54,12 @@ nearest_neighbors:
5354
n_nbr_epoch: 3
5455

5556
####################### Pipeline steps config ########################
57+
58+
# The following two steps are optional and are not enabled by default.
59+
# Uncomment the {} to enable them with default values.
60+
flag_channels_fixed_threshold: # {}
61+
flag_epochs_fixed_threshold: # {}
62+
5663
bridged_channels:
5764
bridge_trim: 40
5865
bridge_z: 6

pylossless/pipeline.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ def find_breaks(self):
721721
for example would unpack two keyword arguments from
722722
mne.preprocessing.annotate_break
723723
"""
724-
if "find_breaks" not in self.config or not self.config["find_breaks"]:
724+
if "find_breaks" not in self.config or self.config["find_breaks"] is None:
725725
return
726726
if not self.raw.annotations:
727727
logger.debug("No annotations found in raw object. Skipping find_breaks.")
@@ -861,7 +861,10 @@ def flag_channels_fixed_threshold(self, threshold=5e-5, picks="eeg"):
861861
with. You may need to assess a more appropriate value for your own
862862
data.
863863
"""
864-
if "flag_channels_fixed_threshold" not in self.config:
864+
try:
865+
if self.config["flag_channels_fixed_threshold"] is None:
866+
return
867+
except KeyError:
865868
return
866869
if "threshold" in self.config["flag_channels_fixed_threshold"]:
867870
threshold = self.config["flag_channels_fixed_threshold"]["threshold"]

0 commit comments

Comments
 (0)