diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..c2c2146 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +version: 2 + +build: + os: ubuntu-24.04 + tools: + python: "3.12" + +sphinx: + configuration: docs/conf.py + fail_on_warning: false + +python: + install: + - method: pip + path: . + extra_requirements: + - docs diff --git a/paper/paper.bib b/paper/paper.bib index 0de0423..a391c59 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -1,12 +1,12 @@ @article{safavi2021univariate, - title={From univariate to multivariate coupling between continuous signals and point processes: a mathematical framework}, - author={Safavi, Shervin and Logothetis, Nikos K and Besserve, Michel}, - journal={Neural computation}, - volume={33}, - number={7}, - pages={1751--1817}, - year={2021}, - publisher={MIT Press One Rogers Street, Cambridge, MA 02142-1209, USA journals-info~…} + title = {From univariate to multivariate coupling between continuous signals and point processes: A mathematical framework}, + author = {Safavi, Shervin and Logothetis, Nikos K. and Besserve, Michel}, + journal = {Neural Computation}, + year = {2021}, + volume = {33}, + number = {7}, + pages = {1751--1817}, + doi = {10.1162/neco_a_01389} } @article{buzsaki2012origin, @@ -201,9 +201,14 @@ @article{Nouri2025 @book{anderson2010random, title = {An Introduction to Random Matrices}, - author = {Anderson, G. W. and Guionnet, A. and Zeitouni, O.}, + author = {Anderson, Greg W. and Guionnet, Alice and Zeitouni, Ofer}, publisher = {Cambridge University Press}, - year = {2010} + year = {2010}, + series = {Cambridge Studies in Advanced Mathematics}, + volume = {118}, + pages = {xiv+492}, + isbn = {978-0-521-19452-5}, + doi = {10.1017/CBO9780511801334} } @article{chavez2006proper, diff --git a/paper/paper.md b/paper/paper.md index 1cf058b..2041b41 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -16,7 +16,7 @@ authors: - name: Shervin Safavi orcid: 0000-0002-2868-530X corresponding: true - affiliation: "2, 3" + affiliation: "5, 6" affiliations: - name: Donders Institute for Brain, Cognition, and Behaviour, Radboud University, Nijmegen, Netherlands index: 1 @@ -34,7 +34,7 @@ affiliations: index: 6 ror: "026nmvv73" -date: "2026-03-22" +date: "22 March 2026" bibliography: paper.bib repository: "https://github.com/CMC-lab/PyGPLA" crossref: true @@ -86,11 +86,19 @@ We illustrate PyGPLA on synthetic transient-coupling simulations generated with Code snippets and detailed instructions for reproducing these results are available in the package documentation and example scripts in the repository. -## Implementation details +## Software design -The `pygpla` package is distributed under the BSD-2-Clause license. PyGPLA follows a layered architecture separating preprocessing (`pygpla.preprocessing`), core computation (`pygpla.core`), statistical testing (`pygpla.stats`), simulation utilities (`pygpla.simulations`), and configuration (`pygpla.config`). The high-level API (`pygpla.api.gpla`) orchestrates the full pipeline in a single call, keeping default usage compact while preserving access to lower-level components for advanced analyses. The package is built on NumPy [@harris2020array] and SciPy [@virtanen2020fundamental], and includes a `pytest` test suite with continuous integration via GitHub Actions. +PyGPLA uses a function-oriented, layered design that separates the main stages of the analysis while providing a unified high-level workflow. The high-level `gpla()` function coordinates data preparation, GPLA decomposition, and optional statistical testing, returning the results and relevant bookkeeping in a single `GPLAResult` object. The underlying operations—coupling-matrix construction, SVD factorization, whitening, jitter generation, and simulation—remain independently accessible. This design provides a concise default workflow while allowing researchers to inspect, test, or replace individual methodological stages. Automated tests validate these independently accessible numerical components. -## Use of generative AI +PyGPLA accepts standard NumPy arrays rather than requiring a package-specific data container, facilitating integration with existing electrophysiology workflows. Frequency selection and conversion of raw LFP voltage to an analytic signal are intentionally left upstream because these operations require experiment-specific filtering choices. PyGPLA therefore operates on a frequency-specific complex analytic signal or phase representation and warns when real-valued input is supplied. + +Several numerical and interface conventions preserve continuity with the original MATLAB implementation, facilitating validation against the reference implementation and migration of existing GPLA analyses. These include its normalization alternatives, phase convention, reduced-rank whitening methods, and selected legacy parameter names. Optional PCA-based whitening reduces correlations among LFP channels, while an unwhitening operator maps the resulting coupling modes back to the original channel coordinates. Statistical inference is separated from the deterministic decomposition, allowing users to choose between a computationally inexpensive analytical RMT-based decision and more expensive spike-jitter surrogate tests. The core package depends only on NumPy; SciPy is provided as an optional dependency for documented simulation and signal-processing workflows. + +## Research impact statement + +The GPLA methodology has been evaluated in published simulations, biophysical network models, and multielectrode recordings, where it revealed population-level spike–field coupling patterns related to properties of the underlying neural circuits [@safavi2023uncovering]. PyGPLA transfers this established methodology from MATLAB research code into an installable, open-source Python package. The reproducible simulation included with this paper applies PyGPLA to four coupling models and demonstrates recovery of their population-level coupling structure. To our knowledge, PyGPLA is the first Python implementation that jointly decomposes the complete spike–field coupling matrix. Its immediate research contribution is therefore to make population-level GPLA available within Python-based electrophysiology workflows. Because PyGPLA is newly released, broader external adoption and independent applications remain to be established. + +## AI usage disclosure Generative AI tools were used only to assist with drafting documentation and refactoring code for style. All AI-assisted output was reviewed, tested, and diff --git a/paper/paper.pdf b/paper/paper.pdf index dfcc47c..5ce6fee 100644 Binary files a/paper/paper.pdf and b/paper/paper.pdf differ