Skip to content

Commit

Permalink
Merge pull request #205 from fooof-tools/name
Browse files Browse the repository at this point in the history
[MNT] - Name update for new version
  • Loading branch information
TomDonoghue committed Sep 23, 2023
2 parents 69a73f4 + 313fb23 commit 3f897db
Show file tree
Hide file tree
Showing 160 changed files with 2,605 additions and 2,615 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# When ready to drop 3.6, can revert from 'ubuntu-20.04' -> 'ubuntu-latest'
runs-on: ubuntu-20.04
env:
MODULE_NAME: fooof
MODULE_NAME: specparam
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing Guidelines

Thank you for your interest in contributing to `fooof`!
Thank you for your interest in contributing to `specparam`!

We welcome all contributions to the project that extend or improve code and/or documentation!

Expand Down Expand Up @@ -55,7 +55,7 @@ and see if there is anything you would be interested in helping with. If so, joi

All contributions must be within the scope of the module.

`fooof` is a module for parameterizing neural power spectra. This includes model fitting, management and analysis of resulting parameters, and utilities to visualize power spectra and model results. This module also includes functionality to simulate power spectra based on the model.
`specparam` is a module for parameterizing neural power spectra. This includes model fitting, management and analysis of resulting parameters, and utilities to visualize power spectra and model results. This module also includes functionality to simulate power spectra based on the model.

Procedures and utilities that do not deal with operating upon power spectra or on model outputs will most likely be considered out of scope. Notably, this model does not include doing spectral estimation or time-domain analysis. For approaches such as these, the [neurodsp](https://github.com/neurodsp-tools/neurodsp/) module may be a more appropriate target.

Expand Down Expand Up @@ -120,8 +120,8 @@ All code contributed to the module should follow these conventions:
* If a new approach is added, a new tutorial or example may be appropriate
* To build and check the documentation locally:
* Install the requirements for the docsite (`pip install -r requirements-doc.txt`)
* Move to the `fooof/doc` directory (`cd doc`)
* Move to the `specparam/doc` directory (`cd doc`)
* Run `make html` to create a local copy of the documentation website
* The documentation can then be opened in a web browser by opening the file `fooof/doc/_build/html/index.html`
* The documentation can then be opened in a web browser by opening the file `specparam/doc/_build/html/index.html`

For more guidelines on how to write well formated and organized code, check out the [Python API Checklist](http://python.apichecklist.com).
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
##########################################################################
## VARIABLES

MODULE = fooof
MODULE = specparam
LINT_FILE = _lint.txt

##########################################################################
Expand Down
57 changes: 28 additions & 29 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========================================
FOOOF - fitting oscillations & one over f
=========================================
=========================
Spectral Parameterization
=========================

|ProjectStatus|_ |Version|_ |BuildStatus|_ |Coverage|_ |License|_ |PythonVersions|_ |Paper|_

Expand All @@ -26,7 +26,7 @@ FOOOF - fitting oscillations & one over f
.. _Paper: https://doi.org/10.1038/s41593-020-00744-x


FOOOF is a fast, efficient, and physiologically-informed tool to parameterize neural power spectra.
Spectral parameterization is a fast, efficient, and physiologically-informed tool to parameterize neural power spectra.

Overview
--------
Expand Down Expand Up @@ -71,7 +71,7 @@ This documentation includes:
Dependencies
------------

FOOOF is written in Python, and requires Python >= 3.6 to run.
SpecParam is written in Python, and requires Python >= 3.6 to run.

It has the following required dependencies:

Expand All @@ -82,7 +82,7 @@ There are also optional dependencies, which are not required for model fitting i

- `matplotlib <https://github.com/matplotlib/matplotlib>`_ is needed to visualize data and model fits
- `tqdm <https://github.com/tqdm/tqdm>`_ is needed to print progress bars when fitting many models
- `pandas <https://github.com/pandas-dev/pandas>`_ is needed to for exporting model fit results to dataframes
- `pandas <https://github.com/pandas-dev/pandas>`_ is needed for exporting model fit results to dataframes
- `pytest <https://github.com/pytest-dev/pytest>`_ is needed to run the test suite locally

We recommend using the `Anaconda <https://www.anaconda.com/distribution/>`_ distribution to manage these requirements.
Expand Down Expand Up @@ -133,22 +133,21 @@ To install an editable version, download the development version as above, and r
Other Language Support
----------------------

The original implementation of FOOOF, available in this repository, is implemented in Python.
The original implementation of `specparam`, available in this repository, is implemented in Python.

If you wish to run FOOOF from another language, there are a couple potential options:
If you wish to run specparam from another language, there are a couple potential options:

- a `wrapper`, which allows for running the Python code from another language
- a `reimplementation`, which reflects a new implementation of the fooof algorithm in another language
- a `reimplementation`, which reflects a new implementation of the specparam algorithm in another language

Below are listed some examples of wrappers and/or reimplementations in other languages (non-exhaustive).

Matlab
~~~~~~

In Matlab, there is a reimplementation available in common toolboxes:

- The `Brainstorm <https://neuroimage.usc.edu/brainstorm/Introduction>`_ toolbox has a reimplementation of fooof (see the `Brainstorm fooof tutorial <https://neuroimage.usc.edu/brainstorm/Tutorials/Fooof>`_)
- The `Fieldtrip <https://www.fieldtriptoolbox.org/>`_ also uses the same reimplementation (see the `Fieldtrip fooof tutorial <https://www.fieldtriptoolbox.org/example/fooof/>`_)
- The `Brainstorm <https://neuroimage.usc.edu/brainstorm/Introduction>`_ toolbox has a reimplementation of specparam (see the `Brainstorm fooof tutorial <https://neuroimage.usc.edu/brainstorm/Tutorials/Fooof>`_)
- The `Fieldtrip <https://www.fieldtriptoolbox.org/>`_ toolbox also uses the same reimplementation (see the `Fieldtrip fooof tutorial <https://www.fieldtriptoolbox.org/example/fooof/>`_)

There is also a Matlab wrapper in the `fooof_mat <http://github.com/fooof-tools/fooof_mat>`_ repository.

Expand Down Expand Up @@ -209,27 +208,27 @@ The algorithm works on frequency representations, that is power spectra in linea
**Fitting a Single Power Spectrum**

With a power spectrum loaded (with 'freqs' storing frequency values, and 'spectrum' storing
the power spectrum, both as 1D arrays in linear space) FOOOF can be used as follows:
the power spectrum, both as 1D arrays in linear space) parameterization can be done as follows:

.. code-block:: python
# Import the FOOOF object
from fooof import FOOOF
# Import the model object
from specparam import SpectralModel
# Initialize FOOOF object
fm = FOOOF()
# Initialize model object
fm = SpectralModel()
# Define frequency range across which to model the spectrum
freq_range = [3, 40]
# Model the power spectrum with FOOOF, and print out a report
# Parameterize the power spectrum, and print out a report
fm.report(freqs, spectrum, freq_range)
FOOOF.report() fits the model, plots the original power spectrum with the associated FOOOF model fit,
SpectralModel.report() fits the model, plots the original power spectrum with the associated model fit,
and prints out the parameters of the model fit for both the aperiodic component, and parameters for
any identified peaks, reflecting periodic components.

Example output for the report of a FOOOF fit on an individual power spectrum:
Example output for the report of a parameterized fit on an individual power spectrum:

.. image:: https://github.com/fooof-tools/fooof/main/doc/img/FOOOF_report.png

Expand All @@ -247,9 +246,9 @@ These settings can be defined when initializing the model, for example:

.. code-block:: python
# Initialize a FOOOF model object with defined settings
fm = FOOOF(peak_width_limits=[1.0, 8.0], max_n_peaks=6, min_peak_height=0.1,
peak_threshold=2.0, aperiodic_mode='fixed')
# Initialize a model object with defined settings
fm = SpectralModel(peak_width_limits=[1.0, 8.0], max_n_peaks=6, min_peak_height=0.1,
peak_threshold=2.0, aperiodic_mode='fixed')
**Fitting a Group of Power Spectra**

Expand All @@ -259,19 +258,19 @@ We can fit the group of power spectra by doing:

.. code-block:: python
# Initialize a FOOOFGroup object, specifying some parameters
fg = FOOOFGroup(peak_width_limits=[1.0, 8.0], max_n_peaks=8)
# Initialize a SpectralGroupModel object, specifying some parameters
fg = SpectralGroupModel(peak_width_limits=[1.0, 8.0], max_n_peaks=8)
# Fit FOOOF model across the matrix of power spectra
# Fit models across the matrix of power spectra
fg.fit(freqs, spectra)
# Create and save out a report summarizing the results across the group of power spectra
fg.save_report()
# Save out FOOOF results for further analysis later
fg.save(file_name='fooof_group_results', save_results=True)
# Save out results for further analysis later
fg.save(file_name='group_results', save_results=True)
Example output from using FOOOFGroup across a group of power spectra:
Example output from using SpectralGroupModel across a group of power spectra:

.. image:: https://github.com/fooof-tools/fooof/main/doc/img/FOOOFGroup_report.png

Expand Down
2 changes: 1 addition & 1 deletion data/README.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Data
====

Example data files for the FOOOF module.
Example data files for the module.
4 changes: 2 additions & 2 deletions doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = fooof
SPHINXPROJ = specparam
SOURCEDIR = .
BUILDDIR = _build

Expand Down Expand Up @@ -44,7 +44,7 @@ check:
make SPHINXOPTS="-n" html
make linkcheck

# Create the plots used in the FOOOF documentation
# Create the plots used in the documentation
plots:
python make_doc_plots.py

Expand Down
Loading

0 comments on commit 3f897db

Please sign in to comment.