Skip to content

Commit 98d183b

Browse files
committed
Updates tutorials & examples for recent API updates
1 parent 9e8f487 commit 98d183b

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

examples/plot_fit_fooof_3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
# Compare the aperiodic exponent results across conditions
6969
for ind, fg in enumerate(fgs):
7070
print("Aperiodic exponent for condition {} is {:1.4f}".format(
71-
ind, np.mean(fg.get_all_data('aperiodic_params', 'exponent'))))
71+
ind, np.mean(fg.get_params('aperiodic_params', 'exponent'))))
7272

7373
###################################################################################################
7474
# combine_fooofs

tutorials/plot_02-FOOOF.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@
140140
###################################################################################################
141141
#
142142
# The underlying gaussian parameters are also availabe from the FOOOF object,
143-
# in the '_gaussian_params' attribute.
143+
# in the `gaussian_params_` attribute.
144144
#
145145

146146
###################################################################################################
147147
#
148148
# Compare the 'peak\_params_', as compared to the underlying gaussian parameters
149149
print(' Peak Parameters \t Gaussian Parameters')
150-
for peak, gau in zip(fm.peak_params_, fm._gaussian_params):
150+
for peak, gau in zip(fm.peak_params_, fm.gaussian_params_):
151151
print('{:5.2f} {:5.2f} {:5.2f} \t {:5.2f} {:5.2f} {:5.2f}'.format(*peak, *gau))
152152

153153
####################################################################################################

tutorials/plot_06-FOOOFGroup.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,33 +132,33 @@
132132
print(fg.group_results[0:2])
133133

134134
###################################################################################################
135-
# get_all_data
136-
# ------------
135+
# get_params
136+
# ----------
137137
#
138138
# To collect data across all model fits, and to select specific data results from this data
139-
# you can use the :func:`get_all_data` method. This method lets you extract specific results
139+
# you can use the :func:`get_params` method. This method lets you extract specific results
140140
# by specifying a field, as a string, and (optionally) a specific column of that data, also
141141
# as a string (or, optionally, as an integer index).
142142
#
143143

144144
###################################################################################################
145145

146146
# Extract aperiodic data
147-
aps = fg.get_all_data('aperiodic_params')
148-
exps = fg.get_all_data('aperiodic_params', 'exponent')
147+
aps = fg.get_params('aperiodic_params')
148+
exps = fg.get_params('aperiodic_params', 'exponent')
149149

150150
# Extract peak data
151-
peaks = fg.get_all_data('peak_params')
152-
cfs = fg.get_all_data('peak_params', 'CF')
151+
peaks = fg.get_params('peak_params')
152+
cfs = fg.get_params('peak_params', 'CF')
153153

154154
# Extract metadata about the model fit
155-
errors = fg.get_all_data('error')
156-
r2s = fg.get_all_data('r_squared')
155+
errors = fg.get_params('error')
156+
r2s = fg.get_params('r_squared')
157157

158158
###################################################################################################
159159

160-
# The full list of data you can specify is available in the documentation of :func:`get_all_data`
161-
print(fg.get_all_data.__doc__)
160+
# The full list of data you can specify is available in the documentation of :func:`get_params`
161+
print(fg.get_params.__doc__)
162162

163163
###################################################################################################
164164
#

tutorials/plot_07-TroubleShooting.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173

174174
# Compare ground truth simulated parameters to model fit results
175175
print('Ground Truth \t\t FOOOF Reconstructions')
176-
for sy, fi in zip(np.array(group_three(gauss_params)), fm._gaussian_params):
176+
for sy, fi in zip(np.array(group_three(gauss_params)), fm.gaussian_params_):
177177
print('{:5.2f} {:5.2f} {:5.2f} \t {:5.2f} {:5.2f} {:5.2f}'.format(*sy, *fi))
178178

179179
###################################################################################################
@@ -226,7 +226,7 @@
226226

227227
# Check reconstructed parameters from simulated definition
228228
print('Ground Truth \t\t FOOOF Reconstructions')
229-
for sy, fi in zip(np.array(group_three(gauss_params)), fm._gaussian_params):
229+
for sy, fi in zip(np.array(group_three(gauss_params)), fm.gaussian_params_):
230230
print('{:5.2f} {:5.2f} {:5.2f} \t {:5.2f} {:5.2f} {:5.2f}'.format(*sy, *fi))
231231

232232
###################################################################################################
@@ -253,7 +253,7 @@
253253
###################################################################################################
254254

255255
# Find the index of the worst FOOOF fit from the group
256-
worst_fit_ind = np.argmax(fg.get_all_data('error'))
256+
worst_fit_ind = np.argmax(fg.get_params('error'))
257257

258258
# Extract this FOOOF fit from the group, into a FOOOF object
259259
fm = fg.get_fooof(worst_fit_ind, regenerate=True)

tutorials/plot_08-FurtherAnalysis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
###################################################################################################
120120

121121
# Get all alpha oscillations from a FOOOFGroup object
122-
alphas = get_band_peak_group(fg.get_all_data('peak_params'), alpha_band, len(fg))
122+
alphas = get_band_peak_group(fg.get_params('peak_params'), alpha_band, len(fg))
123123

124124
###################################################################################################
125125

@@ -170,7 +170,7 @@
170170
###################################################################################################
171171

172172
# Extract aperiodic exponent data from group results
173-
exps = fg.get_all_data('aperiodic_params', 'exponent')
173+
exps = fg.get_params('aperiodic_params', 'exponent')
174174

175175
# Check out the aperiodic exponent results
176176
print(exps)

0 commit comments

Comments
 (0)