Skip to content

Conversation

@oujago
Copy link
Member

@oujago oujago commented Oct 7, 2025

Summary by Sourcery

Harmonize BrainPy version2 test suite by renaming the tests directory to tests_version2 and update all related references in code, CI, documentation, and examples, while adding dedicated README files for version2 and version3 documentation and examples

New Features:

  • Add README for version2 examples
  • Introduce documentation README for BrainPy version2 and version3
  • Add README for version3 examples

Enhancements:

  • Rename test suite directory and references from tests to tests_version2 across codebase, comments, notebooks, and example scripts

CI:

  • Update CI workflows to run pytest against tests_version2

Documentation:

  • Update contributing guidelines, PR template, labeler config, and tutorials to reference tests_version2

@sourcery-ai
Copy link

sourcery-ai bot commented Oct 7, 2025

Reviewer's Guide

This PR standardizes the Version 2 test suite by renaming all test references from "tests" to "tests_version2" across CI workflows, documentation, and code comments, and augments the repository with dedicated example and documentation READMEs for both Version 2 and Version 3.

File-Level Changes

Change Details Files
Rename and reroute test suite invocations to tests_version2
  • Swap out pytest commands from tests/ to tests_version2/
  • Update CI-models and CI workflows to invoke pytest tests_version2/
  • Adjust CONTRIBUTING and tutorial docs to run tests_version2/
  • Revise pull request template and labeler globs to reference tests_version2/
.github/workflows/CI-models.yml
.github/workflows/CI.yml
CONTRIBUTING.md
docs_version2/tutorial_advanced/contributing.md
.github/PULL_REQUEST_TEMPLATE.md
.github/labeler.yml
Add version2 suffix to inline comments in test and parsing code
  • Append _version2 to comments describing test harnesses and flaky tests
  • Update comment references for issues and test inspirations to include _version2 suffix
brainpy/version2/math/tests/test_numpy_ops.py
brainpy/version2/math/tests/test_einops.py
brainpy/version2/math/tests/test_environment.py
brainpy/version2/math/tests/test_numpy_einsum.py
brainpy/version2/running/tests/test_pathos_multiprocessing.py
brainpy/version2/math/einops_parsing.py
Introduce examples_version2 README
  • Create a top-level README documenting Version 2 examples and usage notes
examples_version2/README.md
Introduce Version 3 documentation and examples
  • Add docs_version3 README outlining tutorials and API content
  • Add examples_version3 README cataloguing Version 3 examples
docs_version3/README.md
examples_version3/README.md

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

@github-actions github-actions bot added documentation Improvements or additions to documentation ci-cd tests labels Oct 7, 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 and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `examples_version2/README.md:65-68` </location>
<code_context>
+Spiking neural network training examples:
+
+- **spikebased_bp_for_cifar10.py** - Spike-based backpropagation for CIFAR-10
+- **readme.md** - Additional SNN training documentation
+
+## Requirements
</code_context>

<issue_to_address>
**suggestion:** 'readme.md' is listed as an example script, but it's a documentation file.

Please remove 'readme.md' from the example scripts list to avoid confusion.

```suggestion
Spiking neural network training examples:

- **spikebased_bp_for_cifar10.py** - Spike-based backpropagation for CIFAR-10
```
</issue_to_address>

### Comment 2
<location> `examples_version3/README.md:20` </location>
<code_context>
+- **104_CUBA_2005.py** - Current-based E/I network (CUBA model)
+- **106_COBA_HH_2007.py** - COBA network with Hodgkin-Huxley neurons
+- **107_gamma_oscillation_1996.py** - Gamma oscillation generation
+- **108_synfire_chains_199.py** - Synfire chain propagation
+- **109_fast_global_oscillation.py** - Fast global oscillation dynamics
+
</code_context>

<issue_to_address>
**issue (typo):** Filename '108_synfire_chains_199.py' may contain a typo in the year.

Please verify and correct the year in the filename to ensure consistency with the other files.

```suggestion
- **108_synfire_chains_1991.py** - Synfire chain propagation
```
</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.

Comment on lines +65 to +68
Spiking neural network training examples:

- **spikebased_bp_for_cifar10.py** - Spike-based backpropagation for CIFAR-10
- **readme.md** - Additional SNN training documentation
Copy link

Choose a reason for hiding this comment

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

suggestion: 'readme.md' is listed as an example script, but it's a documentation file.

Please remove 'readme.md' from the example scripts list to avoid confusion.

Suggested change
Spiking neural network training examples:
- **spikebased_bp_for_cifar10.py** - Spike-based backpropagation for CIFAR-10
- **readme.md** - Additional SNN training documentation
Spiking neural network training examples:
- **spikebased_bp_for_cifar10.py** - Spike-based backpropagation for CIFAR-10

- **104_CUBA_2005.py** - Current-based E/I network (CUBA model)
- **106_COBA_HH_2007.py** - COBA network with Hodgkin-Huxley neurons
- **107_gamma_oscillation_1996.py** - Gamma oscillation generation
- **108_synfire_chains_199.py** - Synfire chain propagation
Copy link

Choose a reason for hiding this comment

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

issue (typo): Filename '108_synfire_chains_199.py' may contain a typo in the year.

Please verify and correct the year in the filename to ensure consistency with the other files.

Suggested change
- **108_synfire_chains_199.py** - Synfire chain propagation
- **108_synfire_chains_1991.py** - Synfire chain propagation

docs: update documentation links for BrainPy 3.0 and 2.0
@github-actions github-actions bot added dependencies Pull requests that update a dependency file build labels Oct 8, 2025
@oujago
Copy link
Member Author

oujago commented Oct 8, 2025

@sourcery-ai title

@sourcery-ai sourcery-ai bot changed the title Update Refactor V2 tests to tests_version2 and add V2/V3 documentation READMEs Oct 8, 2025
@oujago oujago requested a review from chaoming0625 October 8, 2025 09:35
@oujago oujago merged commit 09c55da into master Oct 8, 2025
18 checks passed
@oujago oujago deleted the update branch October 8, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build ci-cd dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants