Skip to content

Commit 848e242

Browse files
committed
Finish clean up for moving to get_ & compare_ info funcs
1 parent 5d089f9 commit 848e242

File tree

2 files changed

+3
-97
lines changed

2 files changed

+3
-97
lines changed

fooof/tests/test_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_get_info(tfm, tfg):
2222
for f_obj in [tfm, tfg]:
2323
assert get_info(f_obj, 'settings')
2424
assert get_info(f_obj, 'data_info')
25+
assert get_info(f_obj, 'results')
2526

2627
def test_compare_info(tfm, tfg):
2728

fooof/utils.py

Lines changed: 2 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def trim_spectrum(freqs, power_spectra, f_range):
4545

4646

4747
def get_info(f_obj, aspect):
48-
"""
48+
"""Get a specified selection of information from a FOOOF derived object.
4949
5050
Parameters
5151
----------
@@ -57,7 +57,7 @@ def get_info(f_obj, aspect):
5757
Returns
5858
-------
5959
dict
60-
xx
60+
The set of specified info from the FOOOF derived object.
6161
"""
6262

6363
return {key : getattr(f_obj, key) for key in get_obj_desc()[aspect]}
@@ -88,98 +88,3 @@ def compare_info(lst, aspect):
8888
consistent = True
8989

9090
return consistent
91-
92-
93-
94-
95-
96-
# def get_settings(f_obj):
97-
# """Get a dictionary of current settings from a FOOOF or FOOOFGroup object.
98-
99-
# Parameters
100-
# ----------
101-
# f_obj : FOOOF or FOOOFGroup
102-
# FOOOF derived object to get settings from.
103-
104-
# Returns
105-
# -------
106-
# dictionary
107-
# Settings for the input FOOOF derived object.
108-
# """
109-
110-
# return {setting : getattr(f_obj, setting) for setting in get_obj_desc()['settings']}
111-
112-
113-
# def get_data_info(f_obj):
114-
# """Get a dictionary of current data information from a FOOOF or FOOOFGroup object.
115-
116-
# Parameters
117-
# ----------
118-
# f_obj : FOOOF or FOOOFGroup
119-
# FOOOF derived object to get data information from.
120-
121-
# Returns
122-
# -------
123-
# dictionary
124-
# Data information for the input FOOOF derived object.
125-
126-
# Notes
127-
# -----
128-
# Data information for a FOOOF object is the frequency range and frequency resolution.
129-
# """
130-
131-
# return {dat_info : getattr(f_obj, dat_info) for dat_info in get_obj_desc()['data_info']}
132-
133-
134-
# def compare_settings(lst):
135-
# """Compare the settings between FOOOF and/or FOOOFGroup objects.
136-
137-
# Parameters
138-
# ----------
139-
# lst : list of FOOOF or FOOOFGroup objects
140-
# FOOOF related objects whose settings are to be compared.
141-
142-
# Returns
143-
# -------
144-
# consistent : bool
145-
# Whether the settings are consistent across the input list of objects.
146-
# """
147-
148-
# # Check settings are the same across list of given objects
149-
# for f_obj_1, f_obj_2 in zip(lst[:-1], lst[1:]):
150-
# if f_obj_1.get_settings() != f_obj_2.get_settings():
151-
# consistent = False
152-
# break
153-
# else:
154-
# consistent = True
155-
156-
# return consistent
157-
158-
159-
# def compare_data_info(lst):
160-
# """Compare the data information between FOOOF and/or FOOOFGroup objects.
161-
162-
# Parameters
163-
# ----------
164-
# lst : list of FOOOF or FOOOFGroup objects
165-
# FOOOF related objects whose settings are to be compared.
166-
167-
# Returns
168-
# -------
169-
# consistent : bool
170-
# Whether the data information is consistent across the input list of objects.
171-
172-
# Notes
173-
# -----
174-
# Data information for a FOOOF object is the frequency range and frequency resolution.
175-
# """
176-
177-
# # Check data information is the same across the list of given objects
178-
# for f_obj_1, f_obj_2 in zip(lst[:-1], lst[1:]):
179-
# if get_data_info(f_obj_1) != get_data_info(f_obj_2):
180-
# consistent = False
181-
# break
182-
# else:
183-
# consistent = True
184-
185-
# return consistent

0 commit comments

Comments
 (0)