Skip to content

Commit

Permalink
Fix up docs to work for data-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
TomDonoghue committed Apr 18, 2020
1 parent ed4ab83 commit 39e7924
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
8 changes: 6 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@
("Tutorials", "auto_tutorials/index"),
("Examples", "auto_examples/index"),
("Reference", "reference"),
("GitHub", "https://github.com/fooof-tools/fooof", True)
("GitHub", "https://github.com/fooof-tools/fooof", True),
],

# Set the page width to not be restricted to hardset value
'body_max_width': None,

# Bootswatch (http://bootswatch.com/) theme to apply.
'bootswatch_theme': "flatly",

Expand Down Expand Up @@ -133,7 +136,8 @@
'within_subsection_order': FileNameSortKey,
'default_thumb_file': 'img/spectrum.png',
# Settings for linking between examples & API examples
'backreferences_dir': 'backrefs',
#'backreferences_dir': 'backrefs',
'backreferences_dir': 'generated',
'doc_module': ('fooof',),
'reference_url': {'fooof': None}
}
2 changes: 2 additions & 0 deletions examples/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Examples
========

This section has examples of different functionality available in the module. Examples are organized into topics, and there is no ordering for these examples.

.. contents:: Contents
:local:
:depth: 3
Expand Down
26 changes: 21 additions & 5 deletions fooof/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class FOOOFSettings(namedtuple('FOOOFSettings', ['peak_width_limits', 'max_n_peaks',
'min_peak_height', 'peak_threshold',
'aperiodic_mode'])):
"""User defined settings for a FOOOF object.
"""User defined settings for the fitting algorithm.
Parameters
----------
Expand All @@ -30,19 +30,27 @@ class FOOOFSettings(namedtuple('FOOOFSettings', ['peak_width_limits', 'max_n_pea
Relative threshold for detecting peaks, in units of standard deviation of the input data.
aperiodic_mode : {'fixed', 'knee'}
Which approach to take for fitting the aperiodic component.
Notes
-----
This object is a data object, based on a NamedTuple, with immutable data attributes.
"""
__slots__ = ()


class FOOOFMetaData(namedtuple('FOOOFMetaData', ['freq_range', 'freq_res'])):
"""Meta-data for a FOOOF object.
"""Metadata information about a power spectrum.
Parameters
----------
freq_range : list of [float, float]
Frequency range of the power spectrum, as [lowest_freq, highest_freq].
freq_res : float
Frequency resolution of the power spectrum.
Notes
-----
This object is a data object, based on a NamedTuple, with immutable data attributes.
"""
__slots__ = ()

Expand All @@ -51,7 +59,7 @@ class FOOOFResults(namedtuple('FOOOFResults', ['aperiodic_params', 'peak_params'
'r_squared', 'error', 'gaussian_params'])):
"""Model results from parameterizing a power spectrum.
Attributes
Parameters
----------
aperiodic_params : 1d array
Parameters that define the aperiodic fit. As [Offset, (Knee), Exponent].
Expand All @@ -65,20 +73,28 @@ class FOOOFResults(namedtuple('FOOOFResults', ['aperiodic_params', 'peak_params'
gaussian_params : 2d array
Parameters that define the gaussian fit(s).
Each row is a gaussian, as [mean, height, standard deviation].
Notes
-----
This object is a data object, based on a NamedTuple, with immutable data attributes.
"""
__slots__ = ()


class SimParams(namedtuple('SimParams', ['aperiodic_params', 'periodic_params', 'nlv'])):
"""Stores parameters that define a simulated power spectrum.
"""Parameters that define a simulated power spectrum.
Attributes
Parameters
----------
aperiodic_params : list
Parameters that define the aperiodic component.
periodic_params : list or list of lists
Parameters that define the periodic component.
nlv : float
Noise level added to simulated spectrum.
Notes
-----
This object is a data object, based on a NamedTuple, with immutable data attributes.
"""
__slots__ = ()
2 changes: 2 additions & 0 deletions tutorials/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Tutorial
========

This section has the official FOOOF tutorial, which is recommended in order to learn how to apply the power spectrum model and use the module. This tutorial is organized as a set of tutorials that should be done in order.

.. contents:: Contents
:local:
:depth: 3

0 comments on commit 39e7924

Please sign in to comment.