From 83ae69313c0654409002b25a97c9a1a16f88ce4c Mon Sep 17 00:00:00 2001 From: Tom Donoghue Date: Mon, 8 Apr 2024 00:13:01 -0400 Subject: [PATCH] lints from updates --- specparam/objs/base.py | 6 +++--- specparam/objs/data.py | 6 ++---- specparam/objs/event.py | 2 +- specparam/objs/fit.py | 1 + specparam/objs/group.py | 6 ------ specparam/objs/model.py | 3 --- specparam/objs/time.py | 13 ++++--------- 7 files changed, 11 insertions(+), 26 deletions(-) diff --git a/specparam/objs/base.py b/specparam/objs/base.py index 145d6cfa..30642fc0 100644 --- a/specparam/objs/base.py +++ b/specparam/objs/base.py @@ -7,12 +7,12 @@ from specparam.data import ModelRunModes from specparam.core.utils import unlog from specparam.core.items import OBJ_DESC -from specparam.objs.fit import BaseFit, BaseFit2D, BaseFit2DT -from specparam.objs.data import BaseData, BaseData2D, BaseData2DT - +from specparam.core.errors import NoDataError from specparam.core.io import save_model, load_json from specparam.core.io import save_group, load_jsonlines from specparam.core.modutils import copy_doc_func_to_method +from specparam.objs.fit import BaseFit, BaseFit2D, BaseFit2DT +from specparam.objs.data import BaseData, BaseData2D, BaseData2DT ################################################################################################### ################################################################################################### diff --git a/specparam/objs/data.py b/specparam/objs/data.py index 6cd267b2..a7d92e95 100644 --- a/specparam/objs/data.py +++ b/specparam/objs/data.py @@ -1,5 +1,7 @@ """Define base data objects.""" +from functools import wraps + import numpy as np from specparam.sim.gen import gen_freqs @@ -315,10 +317,6 @@ def _reset_data(self, clear_freqs=False, clear_spectrum=False, clear_spectra=Fal self.power_spectra = None -# FIGURE OUT WHERE TO PUT - -from functools import wraps - def transpose_arg1(func): """Decorator function to transpose the 1th argument input to a function.""" diff --git a/specparam/objs/event.py b/specparam/objs/event.py index f599d69f..f8eb9fef 100644 --- a/specparam/objs/event.py +++ b/specparam/objs/event.py @@ -7,7 +7,7 @@ import numpy as np from specparam.objs import SpectralModel, SpectralTimeModel -from specparam.objs.group import _progress +from specparam.objs.fit import _progress from specparam.plts.event import plot_event_model from specparam.data.conversions import event_group_to_dict, event_group_to_dataframe, dict_to_df from specparam.data.utils import get_group_params, get_results_by_row, flatten_results_dict diff --git a/specparam/objs/fit.py b/specparam/objs/fit.py index 97aa397a..1e55ab2b 100644 --- a/specparam/objs/fit.py +++ b/specparam/objs/fit.py @@ -7,6 +7,7 @@ from specparam.core.utils import unlog from specparam.core.funcs import infer_ap_func +from specparam.core.errors import NoModelError from specparam.core.utils import check_inds, check_array_dim from specparam.data import FitResults, ModelSettings from specparam.data.conversions import group_to_dict diff --git a/specparam/objs/group.py b/specparam/objs/group.py index 112c7c6f..834024ad 100644 --- a/specparam/objs/group.py +++ b/specparam/objs/group.py @@ -5,18 +5,12 @@ Methods without defined docstrings import docs at runtime, from aliased external functions. """ -import numpy as np - from specparam.objs.base import BaseObject2D from specparam.objs.model import SpectralModel from specparam.objs.algorithm import SpectralFitAlgorithm from specparam.plts.group import plot_group_model -from specparam.core.items import OBJ_DESC -from specparam.core.utils import check_inds -from specparam.core.errors import NoModelError from specparam.core.reports import save_group_report from specparam.core.strings import gen_group_results_str -from specparam.core.io import save_group, load_jsonlines from specparam.core.modutils import (copy_doc_func_to_method, docs_get_section, replace_docstring_sections) from specparam.data.conversions import group_to_dataframe diff --git a/specparam/objs/model.py b/specparam/objs/model.py index efad8532..ab680cb8 100644 --- a/specparam/objs/model.py +++ b/specparam/objs/model.py @@ -9,9 +9,6 @@ from specparam.objs.base import BaseObject from specparam.objs.algorithm import SpectralFitAlgorithm - -from specparam.core.info import get_indices -from specparam.core.io import save_model, load_json from specparam.core.reports import save_model_report from specparam.core.modutils import copy_doc_func_to_method from specparam.core.errors import NoModelError diff --git a/specparam/objs/time.py b/specparam/objs/time.py index 257b3edb..125ac578 100644 --- a/specparam/objs/time.py +++ b/specparam/objs/time.py @@ -1,20 +1,15 @@ """Time model object and associated code for fitting the model to spectrograms.""" -import numpy as np - -from specparam.objs import SpectralModel, SpectralGroupModel +from specparam.objs import SpectralModel +from specparam.objs.base import BaseObject2DT +from specparam.objs.algorithm import SpectralFitAlgorithm +from specparam.data.conversions import group_to_dataframe, dict_to_df from specparam.plts.time import plot_time_model -from specparam.data.conversions import group_to_dict, group_to_dataframe, dict_to_df -from specparam.data.utils import get_results_by_ind -from specparam.core.utils import check_inds from specparam.core.reports import save_time_report from specparam.core.modutils import (copy_doc_func_to_method, docs_get_section, replace_docstring_sections) from specparam.core.strings import gen_time_results_str -from specparam.objs.base import BaseObject2DT -from specparam.objs.algorithm import SpectralFitAlgorithm - ################################################################################################### ###################################################################################################