diff --git a/README.rst b/README.rst deleted file mode 100644 index bec81de..0000000 --- a/README.rst +++ /dev/null @@ -1,126 +0,0 @@ -PyRASA - Spectral parameterization in python based on IRASA -=========================================================== - -.. image:: https://www.repostatus.org/badges/latest/wip.svg - :target: https://www.repostatus.org/#wip - :alt: Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. - -.. image:: https://img.shields.io/badge/License-BSD_2--Clause-orange.svg - :target: https://opensource.org/licenses/BSD-2-Clause - :alt: License - -.. image:: http://www.mypy-lang.org/static/mypy_badge.svg - :target: http://mypy-lang.org/ - :alt: Checked with mypy - -.. image:: https://coveralls.io/repos/github/schmidtfa/pyrasa/badge.svg?branch=main - :target: https://coveralls.io/github/schmidtfa/pyrasa?branch=main - :alt: Coverage Status - - -PyRASA is a Python library designed to separate and parametrize aperiodic (fractal) and periodic (oscillatory) components in time series data based on the IRASA algorithm (Wen & Liu, 2016). - -Features --------- - -- **Aperiodic and Periodic Decomposition:** Utilize the IRASA algorithm to decompose power spectra into aperiodic and periodic components, enabling better interpretation of neurophysiological signals. -- **Time Resolved Spectral Parametrization:** Perform time resolved spectral parametrization, allowing you to track changes in spectral components over time. -- **Support for Raw and Epoched MNE Objects:** PyRASA provides functions designed for both continuous (Raw) and event-related (Epochs) data, making it versatile for various types of EEG/MEG analyses. -- **Consistent Ontology:** PyRASA uses the same jargon to label parameters as specparam, the most commonly used tool to parametrize power spectra, to allow users to easily switch between tools depending on their needs, while keeping the labeling of features consistent. -- **Custom Aperiodic Fit Models:** In addition to the built-in "fixed" and "knee" models for aperiodic fitting, users can specify their custom aperiodic fit functions, offering flexibility in how aperiodic components are modeled. - -Documentation -------------- - -Documentation for PyRASA, including detailed descriptions of functions, parameters, and examples, will soon be available `here`_. - -.. _here: https://github.com/schmidtfa/pyrasa - -Installation ------------- - -To install the latest stable version of PyRASA, you can soon use pip:: - - $ pip install pyrasa - -or conda:: - - $ conda install pyrasa - -Dependencies ------------- - -PyRASA has the following dependencies: - -- **Core Dependencies:** - - `numpy `_ - - `scipy `_ - - `pandas `_ - -- **Optional Dependencies for Full Functionality:** - - `mne `_: Required for directly working with EEG/MEG data in `Raw` or `Epochs` formats. - -Example Usage -------------- - -Decompose spectra into periodic and aperiodic components:: - - from pyrasa.irasa import irasa - - irasa_out = irasa(sig, - fs=fs, - band=(.1, 200), - psd_kwargs={'nperseg': duration*fs, - 'noverlap': duration*fs*overlap - }, - hset_info=(1, 2, 0.05)) - -.. image:: https://raw.githubusercontent.com/schmidtfa/pyrasa/main/simulations/example_knee.png - :alt: Example knee image - - -Extract periodic parameters:: - - irasa_out.get_peaks() - -+-----------+-----+--------+--------+ -| ch_name | cf | bw | pw | -+===========+=====+========+========+ -| 0 | 9.5 | 1.4426 | 0.4178 | -+-----------+-----+--------+--------+ - -Extract aperiodic parameters:: - - irasa_out.fit_aperiodic_model(fit_func='knee').aperiodic_params - -+-----------+--------+--------------+--------------+-----------+--------------------+--------+-----------+ -| Offset | Knee | Exponent_1 | Exponent_2 | fit_type | Knee Frequency (Hz) | tau | ch_name | -+===========+========+==============+==============+===========+====================+========+===========+ -| 1.737e-16 | 60.94 | 0.0396 | 1.4727 | knee | 14.131 | 0.0113 | 0 | -+-----------+--------+--------------+--------------+-----------+--------------------+--------+-----------+ - -And the goodness of fit:: - - irasa_out.fit_aperiodic_model(fit_func='knee').gof - -+------------+------------+------------+------------+-----------+-----------+ -| mse | r_squared | BIC | AIC | fit_type | ch_name | -+============+============+============+============+===========+===========+ -| 0.000051 | 0.999751 | -3931.840 | -3947.806 | knee | 0 | -+------------+------------+------------+------------+-----------+-----------+ - -How to Contribute ------------------ - -Contributions to PyRASA are welcome! Whether it's raising issues, improving documentation, fixing bugs, or adding new features, your help is appreciated. Please refer to the `CONTRIBUTING.md `_ file for more information on how to get involved. - -Reference ---------- - -If you are using IRASA, please cite the smart people who came up with the algorithm: - -Wen, H., & Liu, Z. (2016). Separating fractal and oscillatory components in the power spectrum of neurophysiological signal. *Brain Topography*, 29, 13-26. https://doi.org/10.1007/s10548-015-0448-0 - -If you are using PyRASA, it would be nice if you could additionally cite us (whenever the paper is finally ready): - -Schmidt F., Hartmann T., & Weisz, N. (2049). PyRASA - Spectral parameterization in python based on IRASA. *SOME JOURNAL THAT LIKES US* diff --git a/pixi.lock b/pixi.lock index 73cc1fc..cf55c6e 100644 --- a/pixi.lock +++ b/pixi.lock @@ -1998,6 +1998,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-core-7.16.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-pandoc-7.16.4-hd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbsphinx-0.9.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/linux-64/ncurses-6.5-he02047a_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/networkx-3.3-pyhd8ed1ab_1.conda @@ -2462,6 +2463,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-core-7.16.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-pandoc-7.16.4-hd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbsphinx-0.9.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-64/ncurses-6.5-hf036a51_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/networkx-3.3-pyhd8ed1ab_1.conda @@ -2897,6 +2899,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-core-7.16.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-pandoc-7.16.4-hd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbsphinx-0.9.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/osx-arm64/ncurses-6.5-h7bae524_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/networkx-3.3-pyhd8ed1ab_1.conda @@ -3302,6 +3305,7 @@ environments: - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-core-7.16.4-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbconvert-pandoc-7.16.4-hd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nbformat-5.10.4-pyhd8ed1ab_0.conda + - conda: https://conda.anaconda.org/conda-forge/noarch/nbsphinx-0.9.5-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/nest-asyncio-1.6.0-pyhd8ed1ab_0.conda - conda: https://conda.anaconda.org/conda-forge/noarch/networkx-3.3-pyhd8ed1ab_1.conda - conda: https://conda.anaconda.org/conda-forge/noarch/neurodsp-2.2.0-pyhd8ed1ab_0.tar.bz2 @@ -25196,6 +25200,29 @@ packages: - pkg:pypi/nbformat?source=hash-mapping size: 101232 timestamp: 1712239122969 +- kind: conda + name: nbsphinx + version: 0.9.5 + build: pyhd8ed1ab_0 + subdir: noarch + noarch: python + url: https://conda.anaconda.org/conda-forge/noarch/nbsphinx-0.9.5-pyhd8ed1ab_0.conda + sha256: 0fc92fc4e1eab73ce7808b5055c33f319a8949b4ad272fc69ebb96b2f157d5eb + md5: b808b8a0494c5cca76200c73e260a060 + depends: + - docutils + - jinja2 + - nbconvert + - nbformat + - python >=3.6 + - sphinx + - traitlets + license: MIT + license_family: MIT + purls: + - pkg:pypi/nbsphinx?source=conda-forge-mapping + size: 33725 + timestamp: 1723612159088 - kind: conda name: ncurses version: '6.5' @@ -28827,7 +28854,7 @@ packages: name: pyrasa version: 0.1.0.dev0 path: . - sha256: 0996ce61802629c03009b00d0b3b373b5625ba895640cfe8d4f12f2006e738c6 + sha256: 9c910a0825df39bd81911a2f9504165130ce026f960e2795498ccc7007842744 requires_dist: - attrs - numpy diff --git a/pyproject.toml b/pyproject.toml index 12bf707..d43580d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,6 +51,7 @@ sphinx = "*" pydata-sphinx-theme = "*" sphinx-autobuild = "*" numpydoc = "*" +nbsphinx = "*" [tool.pixi.feature.doc.pypi-dependencies] sphinx_gallery = "*"