Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNT] - Name update for new version #205

Merged
merged 67 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
cd24360
name updates: sweep comments
TomDonoghue Apr 15, 2021
912e4a7
name update: fooof_obj -> model_obj
TomDonoghue Apr 15, 2021
c147a97
name update: fooofed_spectrum_ -> modeled_spectrum
TomDonoghue Apr 15, 2021
9fedefc
name update: data objs
TomDonoghue Apr 15, 2021
e1d365c
name update: object util funcs
TomDonoghue Apr 15, 2021
6c21a54
name update: custom error names
TomDonoghue Apr 15, 2021
fbc904e
bumb version for breaking change
TomDonoghue Apr 16, 2021
4d04f3f
name update: get_fooof -> get_model
TomDonoghue Apr 16, 2021
55dd13d
name updates: sweep on notes, IO, and utils
TomDonoghue Apr 16, 2021
4f0d7bf
name updates: move away from fm & fg in module
TomDonoghue Apr 16, 2021
bcd4ea9
name update: FOOOFGroup -> PSDGroup
TomDonoghue Apr 16, 2021
a3e4e13
name update: FOOOF object -> PSD
TomDonoghue Apr 16, 2021
df907da
name update: rename module
TomDonoghue Apr 16, 2021
bf4883d
Naming: update README descriptions
TomDonoghue Apr 16, 2021
051d306
lints & minor docstring updates
TomDonoghue Apr 16, 2021
3dcd52d
name update: update tutorials
TomDonoghue Apr 16, 2021
9317163
name update: update examples
TomDonoghue Apr 17, 2021
173085d
name update: motivations
TomDonoghue Apr 17, 2021
5099f03
name update: update doc site files
TomDonoghue Apr 17, 2021
04c8af1
naming: update API list
TomDonoghue Apr 17, 2021
7212313
name update: update FAQ for name, and quick edits
TomDonoghue Apr 17, 2021
76d3f5b
merge from main
TomDonoghue May 5, 2021
169ae8e
fix group naming
TomDonoghue May 5, 2021
ab1288f
clean up tests - drop explicit save_fig
TomDonoghue May 10, 2021
aca28b6
update preprint links to pubs
TomDonoghue May 10, 2021
8178d15
merge annot update
TomDonoghue May 10, 2021
be68d60
fix annot update
TomDonoghue May 10, 2021
1aad0ac
actually fix annot upate
TomDonoghue May 10, 2021
d9d34de
update sim name to sim_*
TomDonoghue May 10, 2021
32c0d2f
update docs for sim name update
TomDonoghue May 10, 2021
cf56d7c
various docsite updates & fixes
TomDonoghue May 10, 2021
50ad870
update file names
TomDonoghue May 20, 2021
08b7eec
update name in root files
TomDonoghue May 27, 2021
5bcfdfe
fix merge
TomDonoghue Jun 29, 2023
043c0a4
fix pytest import
TomDonoghue Jun 29, 2023
14ef825
fix sim doctests
TomDonoghue Jun 29, 2023
4eac4c5
update module name in workflow file
TomDonoghue Jun 29, 2023
42d457f
fix doctest for subsample spectra
TomDonoghue Jun 29, 2023
eb23f2f
fix merge
TomDonoghue Jun 30, 2023
b1d89fc
fix merge
TomDonoghue Jun 30, 2023
f09be73
merge lints
TomDonoghue Jun 30, 2023
c4655ef
update object names to SpectralModel
TomDonoghue Jun 30, 2023
8a7980e
fix merge new PRs
TomDonoghue Jun 30, 2023
a125aff
fix merge main for version number
TomDonoghue Jun 30, 2023
3434702
fix merge for other language readme info
TomDonoghue Jun 30, 2023
798de66
fix merge of rst fixes, etc
TomDonoghue Jun 30, 2023
b4953ed
update version number to rc0
TomDonoghue Jun 30, 2023
9fa8dc8
fix merge
TomDonoghue Jul 8, 2023
3930fd2
fix reference to fooof in group object
TomDonoghue Jul 8, 2023
92794ab
merge 1.1
TomDonoghue Jul 22, 2023
00d112f
update merges for 2.0
TomDonoghue Jul 22, 2023
901c9b1
fix doctest from merge
TomDonoghue Jul 22, 2023
bd01b61
merge udpates from 1.1 doc updates
TomDonoghue Jul 22, 2023
9fd116c
merge 1.1 init updates
TomDonoghue Jul 22, 2023
d33a0ff
fix dev demo import
TomDonoghue Jul 22, 2023
23f3d57
fix merge
TomDonoghue Jul 25, 2023
7f2bca4
fix / update to ModelRunModes
TomDonoghue Jul 25, 2023
a08e1bd
fix merge
TomDonoghue Aug 3, 2023
9824829
fix merge (for real)
TomDonoghue Aug 3, 2023
9702942
fix get data
TomDonoghue Aug 3, 2023
a1a946a
Merge branch 'main' into name
TomDonoghue Aug 3, 2023
3db3559
merge new version number
TomDonoghue Aug 3, 2023
da5d53a
merge optimize branch
TomDonoghue Sep 13, 2023
c0019a2
fix jacobians test import
TomDonoghue Sep 13, 2023
4a1ca34
fix merge
TomDonoghue Sep 13, 2023
9d854fd
fix merge
TomDonoghue Sep 13, 2023
313fb23
replace version
TomDonoghue Sep 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://raw.githubusercontent.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://raw.githubusercontent.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