Skip to content

Commit ab61a9d

Browse files
committed
Add Read the Docs configuration and update README for documentation setup
1 parent 94b0827 commit ab61a9d

File tree

2 files changed

+46
-17
lines changed

2 files changed

+46
-17
lines changed

.readthedocs.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# .readthedocs.yml
2+
version: 2
3+
4+
build:
5+
os: ubuntu-22.04
6+
tools:
7+
python: "3.13"
8+
9+
python:
10+
install:
11+
- method: pip
12+
path: .
13+
extra_requirements:
14+
- docs
15+
16+
sphinx:
17+
configuration: docs/conf.py

README.md

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
# BlockInvGPFA
22

33
[![Automated Tests](https://github.com/CausalityInMotion/BlockInverseGPFA/actions/workflows/tests.yml/badge.svg)](https://github.com/CausalityInMotion/BlockInverseGPFA/actions/workflows/tests.yml)
4+
[![Documentation Status](https://readthedocs.org/projects/blockinversegpfa/badge/?version=latest)](https://blockinversegpfa.readthedocs.io/en/latest/)
5+
6+
This package provides a Python implementation of **Gaussian Process Factor Analysis (GPFA)** that incorporates a novel approach to efficiently handle variable-length time series data. Building on the original method by [Byron Yu et al. (2009)](https://papers.nips.cc/paper/2009/hash/6c1b887a379c4f0c2c621f305d15f6b0-Abstract.html), this implementation introduces a **block-matrix–based inversion strategy** that reuses kernel computations across trials of different lengths.
7+
8+
The package also includes **scikit-learn–compatible API** for integration into existing ML workflows such as:
9+
- A **Modular Preprocessing** — Separates data preprocessing from model logic via a dedicated `EventTimesToCounts` transformer.
10+
- Accepts standard array-like inputs (not `Neo` objects), simplifying integration with other tools.
11+
- Follows scikit-learn's transformer–estimator interface for clean, reusable workflows.
12+
- A new **variance-explained metric** to evaluate GPFA model fits.
13+
14+
This implementation is adapted from [Elephant](https://elephant.readthedocs.io/en/latest/reference/gpfa.html)’s GPFA codebase with substantial modifications to improve performance, modularity, and usability in Python-based pipelines.
415

5-
This package is an implementation of Gaussian Process Factor Analysis (GPFA) by Byron Yu et al.,
6-
(2009) in python. The code is based on [Elephant](https://elephant.readthedocs.io/en/latest/reference/gpfa.html)'s
7-
python implementation plus additional modules and functional implementations.
816

917
## Usage
1018

1119
### Installation
1220
-----------------
1321

14-
- Clone the project locally using
22+
Install directly from GitHub using `pip`:
1523

1624
```bash
17-
$ git clone https://github.com/CausalityInMotion/GPFA_for_sklearn
25+
$ pip install git+https://github.com/CausalityInMotion/BlockInverseGPFA.git
1826
```
19-
20-
Ensure you are in the working directory of the project.
21-
22-
Then install the project's required packages uisng
27+
Or clone the repo and install locally:
2328

2429
```bash
25-
$ pip install -r requirements.txt
30+
$ git clone https://github.com/CausalityInMotion/BlockInverseGPFA.git
31+
$ cd BlockInverseGPFA
32+
$ pip install . # or pip install .[test,docs] to include optional dependencies
2633
```
2734

2835
You are now set to use the package.
@@ -38,41 +45,46 @@ Building the documentation requires the following packages:
3845
- [numpydoc](https://numpydoc.readthedocs.io/)
3946
- [Jupyter Notebook Tools for Sphinx](https://nbsphinx.readthedocs.io/)
4047

41-
You can install the required packages either using the `docs/requirements.txt` file,
48+
You can install the required documentation dependencies by:
4249
```bash
43-
$ pip install -r docs/requirements.txt
50+
$ pip install .[docs]
4451
```
4552
or manually by calling
4653
```bash
4754
$ pip install sphinx sphinx-rtd-theme numpydoc nbsphinx
4855
```
4956

50-
Finally, to view the documentation, run
57+
Finally, to view the documentation locally, run
5158

5259
```bash
5360
$ cd docs
5461
$ make html
5562
$ open _build/html/index.html
5663
```
64+
or view them online:
65+
[BlockInvGPFA docs](https://blockinversegpfa.readthedocs.io/en/latest/)
66+
67+
A detailed walkthrough of the package — including how to fit the model to real neural data — is available in the Jupyter notebook example: (link)
5768

5869
-----------
5970
### Tests
6071
-----------
6172

62-
To run the unittests in the [test](test) folder, use the following command in your command line/terminal:
73+
To run the full test suite in the [test](test) folder, use:
6374

6475
```bash
65-
$ python -m unittest test.gpfa
66-
$ python -m unittest test.preprocessing
76+
$ pip install .[test]
77+
$ pytest test/
6778
```
79+
Tests are automatically run via [GitHub Actions](https://github.com/CausalityInMotion/BlockInverseGPFA/actions/new) on every push and pull request.
6880

6981
## License
7082
Modified BSD License based on Elephant, see [LICENSE.txt](LICENSE.txt) for details.
7183

7284

7385
## Copyright
7486

75-
:copyright: 2021 Brooks M. Musangu and Jan Drugowitsch
87+
:copyright: 2021-2025 Brooks M. Musangu and Jan Drugowitsch
7688

7789
## Acknowledgments
7890

0 commit comments

Comments
 (0)