Skip to content

Commit 815ae18

Browse files
committed
propagate check_data mode to derived objects
1 parent cd47438 commit 815ae18

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fooof/objs/group.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,9 @@ def get_fooof(self, ind, regenerate=True):
476476
The FOOOFResults data loaded into a FOOOF object.
477477
"""
478478

479-
# Initialize a FOOOF object, with same settings as current FOOOFGroup
479+
# Initialize a FOOOF object, with same settings & check data mode as current FOOOFGroup
480480
fm = FOOOF(*self.get_settings(), verbose=self.verbose)
481+
fm.set_check_data_mode(self._check_data)
481482

482483
# Add data for specified single power spectrum, if available
483484
# The power spectrum is inverted back to linear, as it is re-logged when added to FOOOF

fooof/objs/utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ def combine_fooofs(fooofs):
178178
if len(fg) == temp_power_spectra.shape[0]:
179179
fg.power_spectra = temp_power_spectra
180180

181+
# Set the check data mode, as True if any of the inputs have it on, False otherwise
182+
fg.set_check_data_mode(any([getattr(f_obj, '_check_data') for f_obj in fooofs]))
183+
181184
# Add data information information
182185
fg.add_meta_data(fooofs[0].get_meta_data())
183186

0 commit comments

Comments
 (0)