Skip to content

Commit

Permalink
Sweep for lint & links
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Apr 18, 2020
1 parent eca8507 commit 62f6c8d
Show file tree
Hide file tree
Showing 21 changed files with 90 additions and 94 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ There are also optional dependencies, which are not required for model fitting i
- [tqdm](https://github.com/tqdm/tqdm) is needed to print progress bars when fitting many models
- [pytest](https://github.com/pytest-dev/pytest) is needed to run the test suite locally

We recommend using the [Anaconda](https://www.continuum.io/downloads) distribution to manage these requirements.
We recommend using the [Anaconda](https://www.anaconda.com/distribution/) distribution to manage these requirements.

## Installation

Expand Down
9 changes: 7 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ clean:
rm -rf auto_tutorials
rm -rf auto_motivations
rm -rf generated
rm -rf backrefs

# Check that builds site with nitpicky checking, and also does post-hoc link check
check:
make SPHINXOPTS="-n" html
make linkcheck

## make install:
# Build the html site, and push it to gh-pages branch of repo to deploy
Expand All @@ -45,4 +49,5 @@ install:
git add * && \
git add .nojekyll && \
git commit -a -m 'Make install' && \
git push
git push

3 changes: 2 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
# Set to generate sphinx docs for class members (methods)
autodoc_default_options = {
'members': None,
'no-inherited-members': None,
'inherited-members': None,
#'no-inherited-members': None,
}

# generate autosummary even if no references
Expand Down
2 changes: 1 addition & 1 deletion examples/analyses/plot_mne_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def check_nans(data, nan_policy='zero'):
#
# Lets start start by plotting some periodic model parameters.
#
# To do so, we will use to :obj:`~fooof.bands.bands.Bands` object to manage some band
# To do so, we will use to :obj:`~.Bands` object to manage some band
# definitions, and some analysis utilities to extracts peaks from bands of interest.
#

Expand Down
16 changes: 8 additions & 8 deletions examples/manage/plot_fit_fooof_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
# Running Across 3D
# -----------------
#
# Most of the materials so far have explored using the :class:`~fooof.FOOOF` object to fit individual
# power spectra, and the :class:`~fooof.FOOOFGroup` object for fitting groups of power spectra,
# where a group of spectra is organized as a 2D array of power spectra.
# Most of the materials so far have explored using the :class:`~fooof.FOOOF` object to fit
# individual power spectra, and the :class:`~fooof.FOOOFGroup` object for fitting groups of
# power spectra, where a group of spectra is organized as a 2D array of power spectra.
#
# In this example, we'll go one step further, and step through how to analyze data
# organized into 3D arrays.
Expand Down Expand Up @@ -61,7 +61,7 @@
# Import simulation & IO utilities to help with the example
from fooof.sim.gen import gen_freqs, gen_group_power_spectra
from fooof.sim.params import param_sampler
from fooof.utils import load_fooofgroup
from fooof.utils.io import load_fooofgroup

###################################################################################################
# Example Set-Up
Expand Down Expand Up @@ -127,7 +127,7 @@
# The strategy we will take to do so is by systematically applying FOOOF objects across
# the data.
#
# For working with 3D arrays of power spectra, we have the :func:`~fooof.objs.utils.fit_fooof_3d`
# For working with 3D arrays of power spectra, we have the :func:`~.fit_fooof_3d`
# function which takes in data and a pre-initialized model object, and uses it to fit
# power spectrum models across all the data, while maintaining the organization of
# the input data.
Expand All @@ -137,10 +137,10 @@
# fit_fooof_3d
# ~~~~~~~~~~~~
#
# More specifically, :func:`~fooof.objs.utils.fit_fooof_3d` takes in:
# More specifically, :func:`~.fit_fooof_3d` takes in:
#
# - a FOOOFGroup object, pre-initialized with the desired settings
# - a frequency vector and a 3D array of power spectra
# - an array of frequency values and a 3D array of power spectra
#
# Internally, this function uses the :class:`~fooof.FOOOFGroup` object to
# fit models across the power spectra.
Expand Down Expand Up @@ -188,7 +188,7 @@
# and tutorials for more information on how to do this.
#
# A general strategy for analyzing model fit results as they get returned from
# :func:`~fooof.objs.utils.fit_fooof_3d` is to loop across all the objects in the
# :func:`~.fit_fooof_3d` is to loop across all the objects in the
# returned list, and then within the loop you can collect and/or analyze and/or plot
# any data of interest.
#
Expand Down
5 changes: 2 additions & 3 deletions examples/manage/plot_freq_by_freq_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
# using simulated data.
#
# The function for analyzing error from a FOOOF object is
# :func:`~fooof.analysis.error.compute_pointwise_error_fm`.
# :func:`~.compute_pointwise_error_fm`.
# To start with, we will indicate to this function to plot the frequency-by-frequency
# error of our model fit.
#
Expand Down Expand Up @@ -92,8 +92,7 @@
# Next, lets move on to calculating frequency-by-frequency error across groups of fits,
# again using some simulated data.
#
# The function for analyzing error from a FOOOFGroup object is
# :func:`~fooof.analysis.error.compute_pointwise_error_fg`.
# To analyze error from a FOOOFGroup object, use :func:`~.compute_pointwise_error_fg`.
#

###################################################################################################
Expand Down
7 changes: 3 additions & 4 deletions examples/manage/plot_manipulating_fooofs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
###################################################################################################

# Import FOOOF & FOOOFGroup objects
from fooof import FOOOF, FOOOFGroup
from fooof import FOOOF

# Import Bands object, to manage frequency band definitions
from fooof.bands import Bands
Expand All @@ -34,7 +34,6 @@

# Import simulation functions to create our example data
from fooof.sim.gen import gen_power_spectrum
from fooof.sim.params import param_sampler

###################################################################################################
#
Expand Down Expand Up @@ -72,7 +71,7 @@
# Sometimes, when working with models in :class:`~fooof.FOOOF` or :class:`~fooof.FOOOFGroup`
# objects, you may want to combine them together, to check some group properties.
#
# The :func:`~fooof.objs.utils.combine_fooofs` function takes a list of FOOOF and/or
# The :func:`~.combine_fooofs` function takes a list of FOOOF and/or
# FOOOFGroup objects, and combines all available fits together into a FOOOFGroup object.
#
# Let's now combine our individual model fits into a FOOOFGroup object.
Expand All @@ -96,7 +95,7 @@
#
# For example, combining FOOOF objects returns a new FOOOFGroup object with the same settings.
#
# We can see this by using the :func:`~fooof.objs.utils.compare_info` function to compare
# We can see this by using the :func:`~.compare_info` function to compare
# the settings between FOOOF objects.
#
# You can also use this function if you wish to compare FOOOF objects to ensure that
Expand Down
2 changes: 1 addition & 1 deletion examples/plots/plot_fooof_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@
#
# Sphinx settings:
# sphinx_gallery_thumbnail_number = 2
#
#
12 changes: 6 additions & 6 deletions examples/plots/plot_model_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
#
# First, let's have a look at the periodic components.
#
# To do so, we will use the :obj:`~fooof.bands.bands.Bands` object to store our frequency
# To do so, we will use the :obj:`~.Bands` object to store our frequency
# band definitions, which we can then use to sub-select peaks within bands of interest.
#
# We can then plot visualizations of the peak parameters, and the reconstructed fits.
Expand All @@ -131,7 +131,7 @@
# Plotting Peak Parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~
#
# The :func:`~fooof.plts.periodic.plot_peak_params` function takes in peak parameters,
# The :func:`~.plot_peak_params` function takes in peak parameters,
# and visualizes them, as:
#
# - Center Frequency on the x-axis
Expand All @@ -154,7 +154,7 @@
# Plotting Peak Fits
# ~~~~~~~~~~~~~~~~~~
#
# The :func:`~fooof.plts.periodic.plot_peak_fits` function takes in peak parameters,
# The :func:`~.plot_peak_fits` function takes in peak parameters,
# and reconstructs peak fits.
#

Expand Down Expand Up @@ -186,7 +186,7 @@
# Plotting Aperiodic Parameters
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# The :func:`~fooof.plts.aperiodic.plot_aperiodic_params` function takes in
# The :func:`~.plot_aperiodic_params` function takes in
# aperiodic parameters, and visualizes them, as:
#
# - Offset on the x-axis
Expand All @@ -207,7 +207,7 @@
# Plotting Aperiodic Fits
# ~~~~~~~~~~~~~~~~~~~~~~~
#
# The :func:`~fooof.plts.aperiodic.plot_aperiodic_fits` function takes in
# The :func:`~.plot_aperiodic_fits` function takes in
# aperiodic parameters, and reconstructs aperiodic fits.
#
# Here again we can plot visualizations of the peak parameters, and the reconstructed fits.
Expand All @@ -220,7 +220,7 @@

###################################################################################################
#
# The :func:`~fooof.plts.aperiodic.plot_aperiodic_fits` also has some additional options
# The :func:`~.plot_aperiodic_fits` also has some additional options
# that can help to tune the visualization, including:
#
# - `control_offset` : whether the control for offset differences, by setting to zero
Expand Down
20 changes: 10 additions & 10 deletions examples/plots/plot_power_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
#
# First we will start with the core plotting function that plots an individual power spectrum.
#
# The :func:`~fooof.plts.spectra.plot_spectrum` function takes in a frequency vector and a
# single vector of power values, and plots the corresponding power spectrum.
# The :func:`~.plot_spectrum` function takes in an array of frequency values and a 1d array of
# of power values, and plots the corresponding power spectrum.
#
# This function, as all the functions in the plotting module, takes in optional inputs
# `log_freqs` and `log_powers` that control whether the frequency and power axes
Expand All @@ -76,10 +76,11 @@
# Plotting Multiple Power Spectra
# -------------------------------
#
# The :func:`~fooof.plts.spectra.plot_spectra` function takes in one or more frequency
# vectors and one or more sets of power values and plots multiple power spectra. Note that
# the inputs for either can be either 2d arrays, or lists of 1d arrays. You can also pass
# in additional optional inputs including `labels`, to specify labels to use in a plot
# The :func:`~.plot_spectra` function takes in one or more frequency arrays and one or more
# array of associated power values and plots multiple power spectra.
#
# Note that the inputs for either can be either 2d arrays, or lists of 1d arrays. You can also
# pass in additional optional inputs including `labels`, to specify labels to use in a plot
# legend, and `colors` to specify which colors to plot each spectrum in.
#

Expand All @@ -96,11 +97,10 @@
# In some cases it may be useful to highlight or shade in particular frequency regions,
# for example, when examining power in particular frequency regions.
#
# The :func:`~fooof.plts.spectra.plot_spectrum_shading` function takes in a power spectrum
# and one or more shaded regions, and plot the power spectrum with the indicated region shaded.
# The :func:`~.plot_spectrum_shading` function takes in a power spectrum and one or more
# shaded regions, and plot the power spectrum with the indicated region shaded.
#
# The same can be done for multiple power spectra with
# :func:`~fooof.plts.spectra.plot_spectra_shading`.
# The same can be done for multiple power spectra with :func:`~.plot_spectra_shading`.
#
# These functions take in an input designating one or more shade regions, each specified
# as [freq_low, freq_high] of the region to shade. They also take in an optional argument
Expand Down
25 changes: 11 additions & 14 deletions examples/sims/plot_sim_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from fooof.sim.params import param_sampler, param_iter, param_jitter, Stepper

# Import plotting functions to visualize spectra
from fooof.plts.spectra import plot_spectrum, plot_spectra
from fooof.plts.spectra import plot_spectra

###################################################################################################
# Simulation Parameters
Expand All @@ -24,11 +24,11 @@
# to ground truth values - but in order to do that, one needs to keep track of the
# simulation parameters themselves.
#
# To do so, there is the :obj:`~fooof.data.data.SimParams` object to manage
# To do so, there is the :obj:`~.SimParams` object to manage
# and keep track of simulation parameters.
#
# For example, when you simulate power spectra, the parameters for each spectrum are stored
# in a :obj:`~fooof.data.data.SimParams` object, and then these objects are collected and returned.
# in a :obj:`~.SimParams` object, and then these objects are collected and returned.
#
# SimParams objects are named tuples with the following fields:
#
Expand Down Expand Up @@ -73,19 +73,16 @@
#
# These functions include:
#
# - :func:`~fooof.sim.params.param_sampler` which can be used to sample
# parameters from possible options
# - :func:`~fooof.sim.params.param_iter` which can be used to iterate across
# parameter ranges
# - :func:`~fooof.sim.params.param_jitter` which can be used to add some 'jitter'
# to simulation parameters
# - :func:`~.param_sampler` which can be used to sample parameters from possible options
# - :func:`~.param_iter` which can be used to iterate across parameter ranges
# - :func:`~.param_jitter` which can be used to add some 'jitter' to simulation parameters
#

###################################################################################################
# param_sampler
# ~~~~~~~~~~~~~
#
# The :func:`~fooof.sim.params.param_sampler` function takes a list of parameter options and
# The :func:`~.param_sampler` function takes a list of parameter options and
# randomly selects from the parameters to create each power spectrum. You can also optionally
# specify the probabilities with which to sample from the options.
#
Expand Down Expand Up @@ -113,11 +110,11 @@
# param_iter
# ~~~~~~~~~~
#
# The :func:`~fooof.sim.params.param_iter` function can be used to create iterators that
# The :func:`~.param_iter` function can be used to create iterators that
# can 'step' across a range of parameter values to be simulated.
#
# The :class:`~fooof.sim.params.Stepper` object needs to be used in conjunction with
# :func:`~fooof.sim.params.param_iter`, as it specifies the values to be iterated across.
# The :class:`~.Stepper` object needs to be used in conjunction with
# :func:`~.param_iter`, as it specifies the values to be iterated across.
#

###################################################################################################
Expand Down Expand Up @@ -148,7 +145,7 @@
# param_jitter
# ~~~~~~~~~~~~
#
# The :func:`~fooof.sim.params.param_jitter` function can be used to create iterators that
# The :func:`~.param_jitter` function can be used to create iterators that
# apply some 'jitter' to the defined parameter values.
#

Expand Down
9 changes: 4 additions & 5 deletions examples/sims/plot_simulated_power_spectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#
# - each peak is defined with three parameters, as [center frequency, height, width]
#
# The :func:`~fooof.sim.gen.gen_power_spectrum` function takes these parameters as input to
# The :func:`~.gen_power_spectrum` function takes these parameters as input to
# create and return a simulated power spectrum. Note that the parameters that define the peaks
# are labeled as gaussian parameters, as these parameters define the simulated gaussians
# directly, and are not the modified peak parameters that the model outputs.
Expand Down Expand Up @@ -106,15 +106,14 @@
# Simulating a Group of Power Spectra
# -----------------------------------
#
# For simulating multiple power spectra, the :func:`~fooof.sim.gen.gen_group_power_spectra`
# can be used.
# For simulating multiple power spectra, the :func:`~.gen_group_power_spectra` can be used.
#
# This function takes the same kind of parameter definitions as
# :func:`~fooof.sim.gen.gen_power_spectrum`, and in addition takes a number specifying
# :func:`~.gen_power_spectrum`, and in addition takes a number specifying
# how many power spectra to simulate, returning a 2D matrix containing the
# desired number of spectra.
#
# Parameters that are passed into :func:`~fooof.sim.gen.gen_group_power_spectra` can be:
# Parameters that are passed into :func:`~.gen_group_power_spectra` can be:
#
# - a single definition, whereby the same value is used for all generated spectra
# - a list of parameters, whereby each successive entry is used for each successive spectrum
Expand Down
Loading

0 comments on commit 62f6c8d

Please sign in to comment.