Skip to content

Commit 0279fd4

Browse files
committed
update null results approach
1 parent 6bcad75 commit 0279fd4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

specparam/objs/results.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,12 +428,9 @@ def drop(self, inds):
428428
This method sets the model fits as null, and preserves the shape of the model fits.
429429
"""
430430

431-
# Local import - avoid circular
432-
from specparam import SpectralModel
433-
434-
null_model = SpectralModel(**self.modes.get_modes()._asdict()).results.get_results()
431+
null_results = Results(self.modes, self.metrics.labels, self.bands).get_results()
435432
for ind in check_inds(inds):
436-
self.group_results[ind] = null_model
433+
self.group_results[ind] = null_results
437434

438435

439436
def get_params(self, name, field=None):
@@ -603,10 +600,7 @@ def drop(self, drop_inds=None, window_inds=None):
603600
This method sets the model fits as null, and preserves the shape of the model fits.
604601
"""
605602

606-
# Local import - avoid circular
607-
from specparam import SpectralModel
608-
609-
null_model = SpectralModel(**self.modes.get_modes()._asdict()).results.get_results()
603+
null_results = Results(self.modes, self.metrics.labels, self.bands).get_results()
610604

611605
drop_inds = drop_inds if isinstance(drop_inds, dict) else \
612606
dict(zip(check_inds(drop_inds), repeat(window_inds)))
@@ -615,7 +609,7 @@ def drop(self, drop_inds=None, window_inds=None):
615609

616610
winds = check_inds(winds)
617611
for wind in winds:
618-
self.event_group_results[eind][wind] = null_model
612+
self.event_group_results[eind][wind] = null_results
619613
for key in self.event_time_results:
620614
self.event_time_results[key][eind, winds] = np.nan
621615

0 commit comments

Comments
 (0)