Skip to content

Conversation

@chaoming0625
Copy link
Member

@chaoming0625 chaoming0625 commented Dec 16, 2025

Summary by Sourcery

Improve documentation of neuron and synapse models, align tests and imports with the brainpy.state namespace, and tighten CI and docs configuration.

Enhancements:

  • Refine Sphinx config and README to use updated brainpy.state branding assets for logo and favicon.
  • Clean up internal utility script imports in the documentation tooling.
  • Standardize imports to use the brainpy.state namespace directly in core tests and modules.

CI:

  • Restrict CI push triggers to the main branch while keeping pull request checks enabled.

Documentation:

  • Expand model docstrings across neuron, synapse, and plasticity components with clearer notes and literature references for biophysical context.

Tests:

  • Update unit tests for synapses, readouts, neuron bases, and specific neuron models to import classes from brainpy.state, keeping them aligned with the public API.

@github-actions
Copy link

🎉 Congratulations on opening your first pull request in brainpy.state! Thank you for your contribution!

A maintainer will review your changes soon. Please make sure:

  • ✅ Your code follows our style guidelines
  • ✅ All tests pass
  • ✅ Documentation is updated (if applicable)
  • ✅ You've filled out the PR template completely

We appreciate your effort in making brainpy.state better. If you have any questions, feel free to ask in the comments.

Welcome to the brainpy.state community! 🌟

@github-actions github-actions bot added documentation Improvements or additions to documentation ci-cd tests labels Dec 16, 2025
@sourcery-ai
Copy link

sourcery-ai bot commented Dec 16, 2025

Reviewer's Guide

This PR enhances scientific documentation for key neuron, synapse, and plasticity models, updates tests to import models from the brainpy.state namespace, and tightens CI workflow triggers while refreshing documentation branding assets.

File-Level Changes

Change Details Files
Enrich neuron model docstrings with contextual notes and literature references for IF, LIF and related variants, Hodgkin–Huxley, and Morris–Lecar families.
  • Added historical and review references to IF, LIF, ExpIF, AdExIF, LIFRef, ALIF, QuaIF, AdQuaIF, Gif, and related adaptive/refractory variants.
  • Introduced Notes sections where missing to explain qualitative behavior (e.g., spike-frequency adaptation, refractory dynamics, excitability types).
  • Clarified integration method (exponential Euler) and modeling assumptions in HH and MorrisLecar neuron implementations.
  • Documented the purpose and application context of WangBuzsakiHH with notes on gamma oscillations and sodium activation simplification.
brainpy/state/_lif.py
brainpy/state/_hh.py
Improve synapse and short-term plasticity model documentation with explicit references and usage notes.
  • Annotated AMPA, GABAa, and BioNMDA synapse notes with numbered literature references and clarified kinetics, magnesium block, and plasticity roles.
  • Expanded STP and STD synapse notes with literature-backed descriptions of parameters U, tau_f, and tau_d and their impact on facilitation/depression dynamics.
brainpy/state/_synapse.py
brainpy/state/_stp.py
Align tests with the brainpy.state namespace instead of top-level brainpy imports.
  • Replaced top-level brainpy imports with brainpy.state imports in synapse output, readout, LIF-family, base neuron/synapse, HH-family, Izhikevich, and synapse tests.
  • Switched from wildcard or multi-name imports on brainpy to explicit imports from brainpy.state for specific model classes.
brainpy/state/_synouts_test.py
brainpy/state/_readout_test.py
brainpy/state/_lif_test.py
brainpy/state/_base_test.py
brainpy/state/_hh_test.py
brainpy/state/_izhikevich_test.py
brainpy/state/_synapse_test.py
Restrict CI workflow triggers to main branch pushes while preserving PR validation.
  • Updated GitHub Actions CI workflow to limit push triggers to the main branch instead of all branches.
  • Simplified pull_request configuration to run on all PRs without explicit branch filters.
.github/workflows/CI.yml
Update documentation branding assets and minor docs utility cleanup.
  • Switched Sphinx html_logo and html_favicon to new brainpy.state logo assets.
  • Updated README header image to reference the new logo path in the docs static directory.
  • Refactored docs highlight_test_lexer entry point to import os at module top-level for consistency and cleanliness.
  • Touched additional docs index and API files (if any) as part of branding or structure updates, without behavioral code changes.
docs/conf.py
README.md
docs/highlight_test_lexer.py
docs/api/index.rst
docs/index.rst

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chaoming0625
Copy link
Member Author

@sourcery-ai title

@sourcery-ai sourcery-ai bot changed the title Doc Improve model docs, brainpy.state imports, and CI triggers Dec 16, 2025
@chaoming0625 chaoming0625 changed the title Improve model docs, brainpy.state imports, and CI triggers docs: Add documentation and usage examples for brainpy.state, brainpy.state imports, and CI triggers Dec 16, 2025
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • In README.md the new logo URL ends with brianpystate_horizontal.png (missing the second 'a' in brainpystate), which likely breaks the image link; please double-check the filename/path in the repo.
  • Now that tests import models from brainpy.state instead of the top-level brainpy, consider whether you also want to update any remaining examples or usage snippets in the codebase to use the same namespace for consistency.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In README.md the new logo URL ends with `brianpystate_horizontal.png` (missing the second 'a' in `brainpystate`), which likely breaks the image link; please double-check the filename/path in the repo.
- Now that tests import models from `brainpy.state` instead of the top-level `brainpy`, consider whether you also want to update any remaining examples or usage snippets in the codebase to use the same namespace for consistency.

## Individual Comments

### Comment 1
<location> `README.md:2` </location>
<code_context>
 <p align="center">
-  	<img alt="Header image of brainpy.state - brain dynamics programming in Python." src="https://raw.githubusercontent.com/chaobrain/brainpy.state/main/images/logo-banner.png" width=80%>
+  	<img alt="Header image of brainpy.state - brain dynamics programming in Python." src="https://raw.githubusercontent.com/chaobrain/brainpy.state/main/docs/_static/brianpystate_horizontal.png" width=80%>
 </p>

</code_context>

<issue_to_address>
**issue (bug_risk):** The image filename "brianpystate_horizontal.png" likely contains a typo and may break the README image.

The `src` filename uses `brianpystate_horizontal.png`, but the project is `brainpy.state`, so this is likely a misspelling of `brainpystate_horizontal.png` and may cause the README image to fail to load.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@@ -1,5 +1,5 @@
<p align="center">
<img alt="Header image of brainpy.state - brain dynamics programming in Python." src="https://raw.githubusercontent.com/chaobrain/brainpy.state/main/images/logo-banner.png" width=80%>
<img alt="Header image of brainpy.state - brain dynamics programming in Python." src="https://raw.githubusercontent.com/chaobrain/brainpy.state/main/docs/_static/brianpystate_horizontal.png" width=80%>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The image filename "brianpystate_horizontal.png" likely contains a typo and may break the README image.

The src filename uses brianpystate_horizontal.png, but the project is brainpy.state, so this is likely a misspelling of brainpystate_horizontal.png and may cause the README image to fail to load.

@chaoming0625 chaoming0625 merged commit 064f232 into main Dec 16, 2025
5 checks passed
@chaoming0625 chaoming0625 deleted the doc branch December 16, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants