diff --git a/specparam/objs/event.py b/specparam/objs/event.py index 80044ed7..a10d8208 100644 --- a/specparam/objs/event.py +++ b/specparam/objs/event.py @@ -226,9 +226,6 @@ def fit(self, freqs=None, spectrograms=None, freq_range=None, peak_org=None, Data is optional, if data has already been added to the object. """ - # ToDo: here because of circular import - updates / refactors should fix & move - #from specparam.objs.group import _progress - if spectrograms is not None: self.add_data(freqs, spectrograms, freq_range) @@ -274,7 +271,7 @@ def drop(self, drop_inds=None, window_inds=None): null_model = SpectralModel(*self.get_settings()).get_results() drop_inds = drop_inds if isinstance(drop_inds, dict) else \ - {eind : winds for eind, winds in zip(check_inds(drop_inds), repeat(window_inds))} + dict(zip(check_inds(drop_inds), repeat(window_inds))) for eind, winds in drop_inds.items(): diff --git a/specparam/sim/sim.py b/specparam/sim/sim.py index ab7886bc..ff01cb8b 100644 --- a/specparam/sim/sim.py +++ b/specparam/sim/sim.py @@ -3,7 +3,8 @@ import numpy as np from specparam.core.utils import check_iter, check_flat -from specparam.core.modutils import docs_get_section, replace_docstring_sections +from specparam.core.modutils import (docs_get_section, replace_docstring_sections, + docs_replace_param) from specparam.sim.params import collect_sim_params from specparam.sim.gen import gen_freqs, gen_power_vals, gen_rotated_power_vals from specparam.sim.transform import compute_rotation_offset @@ -259,8 +260,11 @@ def sim_group_power_spectra(n_spectra, freq_range, aperiodic_params, periodic_pa else: return freqs, powers -# ToDo: need an update to docstring to replace `n_spectra` with `n_windows` -@replace_docstring_sections(docs_get_section(sim_group_power_spectra.__doc__, 'Parameters')) + +@replace_docstring_sections(\ + docs_replace_param(docs_get_section(\ + sim_group_power_spectra.__doc__, 'Parameters'), + 'n_spectra', 'n_windows : int\n The number of time windows to generate.')) def sim_spectrogram(n_windows, freq_range, aperiodic_params, periodic_params, nlvs=0.005, freq_res=0.5, f_rotation=None, return_params=False): """Simulate spectrogram. diff --git a/specparam/tests/core/test_modutils.py b/specparam/tests/core/test_modutils.py index 90d287d4..8cd683a4 100644 --- a/specparam/tests/core/test_modutils.py +++ b/specparam/tests/core/test_modutils.py @@ -43,15 +43,15 @@ def test_docs_replace_param(tdocstring): new_param = 'updated : other\n This description has been dropped in.' - ndocstring = docs_replace_param(tdocstring, 'first', new_param) - assert 'updated' in ndocstring - assert 'first' not in ndocstring - assert 'second' in ndocstring - - ndocstring = docs_replace_param(tdocstring, 'second', new_param) - assert 'updated' in ndocstring - assert 'first' in ndocstring - assert 'second' not in ndocstring + ndocstring1 = docs_replace_param(tdocstring, 'first', new_param) + assert 'updated' in ndocstring1 + assert 'first' not in ndocstring1 + assert 'second' in ndocstring1 + + ndocstring2 = docs_replace_param(tdocstring, 'second', new_param) + assert 'updated' in ndocstring2 + assert 'first' in ndocstring2 + assert 'second' not in ndocstring2 def test_docs_append_to_section(tdocstring):