Skip to content

Commit 188aa5f

Browse files
committed
fix: preserve run modes when instantiating new fooof objects in get_group() and get_fooof()
1 parent 3f3b34a commit 188aa5f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fooof/objs/group.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,9 @@ def get_fooof(self, ind, regenerate=True):
456456
The FOOOFResults data loaded into a FOOOF object.
457457
"""
458458

459-
# Initialize a FOOOF object, with same settings & check data mode as current FOOOFGroup
459+
# Initialize a FOOOF object, with same settings & run modes as current FOOOFGroup
460460
fm = FOOOF(*self.get_settings(), verbose=self.verbose)
461-
fm.set_check_data_mode(self._check_data)
461+
fm.set_run_modes(*self.get_run_modes())
462462

463463
# Add data for specified single power spectrum, if available
464464
# The power spectrum is inverted back to linear, as it is re-logged when added to FOOOF
@@ -494,8 +494,9 @@ def get_group(self, inds):
494494
# Check and convert indices encoding to list of int
495495
inds = check_inds(inds)
496496

497-
# Initialize a new FOOOFGroup object, with same settings as current FOOOFGroup
497+
# Initialize a new FOOOFGroup object, with same settings and run modes as current FOOOFGroup
498498
fg = FOOOFGroup(*self.get_settings(), verbose=self.verbose)
499+
fg.set_run_modes(*self.get_run_modes())
499500

500501
# Add data for specified power spectra, if available
501502
# The power spectra are inverted back to linear, as they are re-logged when added to FOOOF

0 commit comments

Comments
 (0)