Skip to content

Commit

Permalink
tweak printing in event object
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Mar 27, 2024
1 parent e5161d0 commit b6de612
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions specparam/objs/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ def fit(self, freqs=None, spectrograms=None, freq_range=None, peak_org=None,
if spectrograms is not None:
self.add_data(freqs, spectrograms, freq_range)

# If 'verbose', print out a marker of what is being run
if self.verbose and not progress:
print('Fitting model across {} events of {} windows.'.format(\
len(self.spectrograms), self.n_time_windows))

if n_jobs == 1:
self._reset_event_results(len(self.spectrograms))
for ind, spectrogram in _progress(enumerate(self.spectrograms), progress, len(self)):
Expand Down Expand Up @@ -546,6 +551,17 @@ def convert_results(self, peak_org):
self.event_time_results = event_group_to_dict(self.event_group_results, peak_org)


def _check_width_limits(self):
"""Check and warn about bandwidth limits / frequency resolution interaction."""

# Only check & warn on first spectrogram
# This is to avoid spamming standard output for every spectrogram in the set
if np.all(self.spectrograms[0] == self.spectrogram):
#if self.power_spectra[0, 0] == self.power_spectrum[0]:
super()._check_width_limits()



def _par_fit(spectrogram, model):
"""Helper function for running in parallel."""

Expand Down

0 comments on commit b6de612

Please sign in to comment.