Contributing#

Contributing to jamica#

Thank you for your interest in contributing to jamica!

We welcome contributions of all kinds, including bug fixes, new features, documentation improvements, tests, benchmarks, and examples.


Getting Started#

1. Fork and Clone#

git clone https://github.com/<your-username>/jamica.git
cd jamica

2. Create a Virtual Environment#

Using venv:

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

or using uv:

uv venv
source .venv/bin/activate

3. Install jamica#

Using pip:

pip install -e ".[dev]"

Using uv:

uv pip install -e ".[dev]"

[dev] pulls [test], which brings JAX and the plotting stack, so pytest runs the suite against the shipped backend.

The MNE-Python integration tests skip themselves when MNE is absent, so a plain [dev] install reports a clean run while leaving roughly twenty of them unexecuted. Since that integration is a headline feature, install those extras before trusting a green suite on changes that could touch it:

pip install -e ".[dev,mne,icalabel]"
pytest --run-slow

4. Install Pre-commit Hooks#

pre-commit install

This enables automatic formatting, linting, and repository consistency checks before every commit.


Development Workflow#

Create a feature branch:

git checkout -b feature/my-new-feature

Make your changes and add or update tests where appropriate.

Run the full pre-commit suite:

pre-commit run --all-files

Run the test suite:

pytest

Backend Testing#

jamica supports multiple computational backends.

NumPy#

pytest

JAX (CPU)#

pytest tests/ --backend=cpu

JAX (GPU)#

Requires CUDA and the GPU dependencies.

pytest tests/ --backend=gpu

To include slow tests:

pytest tests/ --backend=gpu --run-slow

GPU tests are recommended whenever modifying the optimization algorithm or JAX backend.


Documentation#

If your changes affect the documentation, ensure it builds successfully.

cd docs
make html

Nox#

For maintainers and advanced contributors, Nox provides reproducible development sessions.

nox -s tests
nox -s lint
nox -s docs

Code Style#

jamica uses:

  • Ruff for linting and formatting

  • pre-commit for automated quality checks

  • NumPy-style docstrings for public APIs

Before opening a pull request, make sure:

  • all tests pass

  • pre-commit passes

  • documentation builds successfully (if affected)


Pull Requests#

Please:

  • write clear commit messages

  • include tests for new functionality

  • update documentation when appropriate

  • reference related issues (for example Fixes #42)

Pull requests should target the main branch.


Bug Reports#

When reporting a bug, please include:

  • a minimal reproducible example

  • expected behavior

  • actual behavior

  • Python version

  • operating system

  • backend (NumPy/JAX CPU/JAX GPU)


Feature Requests#

Feature requests are welcome.

Please describe:

  • the motivation

  • the proposed API or behavior

  • relevant papers or references, if applicable


Benchmarks and Validation#

Contributions that compare jamica against other ICA implementations are especially valuable, including:

  • Fortran AMICA 1.7

  • Picard

  • FastICA

  • Infomax

Benchmarking on new EEG or MEG datasets is also encouraged.


Code of Conduct#

By participating in this project, you agree to abide by our Code of Conduct.


Questions#

If you have questions, feel free to open a GitHub issue or discussion.