Contributing#
Contributions of all kinds are welcome — bug reports, fixes, new channels,
documentation, and examples. braincell is developed on GitHub at
chaobrain/braincell.
Development setup#
Clone the repository and install in editable mode with the testing extras, then install the pre-commit hooks:
git clone https://github.com/chaobrain/braincell.git
cd braincell
pip install -e ".[testing]"
pre-commit install
The workflow#
Open an issue (or find one) describing the bug or feature.
Create a branch for your work.
Write a test first. The project convention is: reproduce a bug with a failing test, then fix until it passes. See Testing.
Implement the change, keeping code simple and intuitive.
Run the checks locally:
pytest braincell/ pre-commit run --all
Open a pull request referencing the issue.
Coding conventions#
These conventions come from the project’s developer guide and keep the codebase coherent:
Units are mandatory. Every physical quantity must carry an explicit
brainunitunit; bare numbers are rejected. See Units.One canonical namespace per API. Public symbols are re-exported through the top-level
braincellnamespace; internal packages are underscore-prefixed (_cv,_compute, …). See Project Layout.Ask when requirements are ambiguous rather than guessing.
NumPy-style docstrings for every public class, method, and function, with a runnable, doctestable Examples section where it helps.
Absolute imports for internal modules (
from braincell.morph import Morphology).
Documentation#
Documentation lives in docs/ and is built with Sphinx (sphinx_book_theme,
MyST, and myst-nb for notebooks). To build locally:
cd docs
make html # output in docs/_build/html
Narrative pages are Markdown (MyST) or reStructuredText; tutorials and examples
are Jupyter notebooks. The API reference is generated from docstrings via
autosummary, so improving a docstring improves the reference automatically.
See also#
Testing — the testing conventions in detail.
Extending braincell — adding channels, ions, and integrators.
Project Layout — where everything lives.