Skip to content

Commit 8c491d2

Browse files
chaoming0625oujago
andauthored
Move old functionalities into brainpy.version2 and add new modules in brainpy module (#778)
* Fix spike return values and update file paths in simulation scripts * Refactor code for improved readability by consolidating parameters in simulation scripts * Refactor decision making network and delay handling for improved clarity and functionality * Refactor module structure by renaming files and updating imports for improved organization * Add __init__.py files and implement module imports for improved package structure * Add __init__.py file and update imports for version2 migration * Update dependencies and improve package structure for version 3.0.0 * Update changelog for version 3.0.0 release * Update CI configuration to limit Python versions to 3.13 * Enhance issue templates and CI configurations for better usability and automation * Add tests for readout and synapse models, and update acknowledgments * Add tests for readout and synapse models, and update acknowledgments * Refactor error handling and rename neuron module to LIF * Add comprehensive tests for Neuron and Synapse base classes * Add projection modules and update imports for synaptic dynamics * Update imports to use brainpy.version2 across multiple modules * Update imports to use brainpy._errors and adjust version2 references * Update imports to use brainpy.version2 across multiple modules * Refactor imports and update usage of brainpy.version2 across multiple modules * Refactor imports and enhance usage of brainpy.version2 across multiple modules * Refactor imports to enhance usage of brainpy.version2 and streamline module references * Update CI configuration to run tests on the brainpy module instead of brainpy/_src * Refactor documentation structure to use docs_version2 and update related paths * Update documentation links to use docs_version2 and adjust version references * Refactor imports to utilize brainpy.version2 and streamline module references * Update module references to brainpy.version2 across documentation and code * Add Read the Docs configuration and update module references to brainpy.version2 * Update Read the Docs configuration and adjust requirements path --------- Co-authored-by: oujago <oujago@gmail.com>
1 parent e49e290 commit 8c491d2

775 files changed

Lines changed: 48458 additions & 49385 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Code Owners for BrainPy
2+
# These owners will be requested for review when someone opens a pull request
3+
# that modifies code in specific paths or files.
4+
#
5+
# Learn more about CODEOWNERS:
6+
# https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
7+
8+
# Default owners for everything in the repo
9+
* @brainpy/core-team
10+
11+
# Documentation
12+
/docs/ @brainpy/docs-team
13+
*.md @brainpy/docs-team
14+
*.rst @brainpy/docs-team
15+
16+
# CI/CD and GitHub workflows
17+
/.github/ @brainpy/maintainers
18+
/.github/workflows/ @brainpy/maintainers
19+
20+
# Core library
21+
/brainpy/_src/ @brainpy/core-team
22+
23+
# Build and packaging
24+
/pyproject.toml @brainpy/maintainers
25+
/requirements*.txt @brainpy/maintainers
26+
27+
# Tests
28+
/tests/ @brainpy/core-team
29+
30+
# Examples
31+
/examples/ @brainpy/docs-team
Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,68 @@
11
---
2-
name: 'Bug Report'
3-
about: 'Report a bug or unexpected behavior to help us improve the package'
4-
labels: 'bug'
2+
name: Bug Report
3+
about: Report a bug or unexpected behavior to help us improve BrainPy
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
57
---
68

7-
Please:
9+
## Bug Description
810

9-
- [ ] Check for duplicate issues.
10-
- [ ] Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:
11+
**Describe the bug**
12+
A clear and concise description of what the bug is.
1113

14+
## To Reproduce
15+
16+
**Minimal code example to reproduce the issue:**
17+
18+
```python
19+
import brainpy as bp
20+
21+
# Your code here that demonstrates the bug
22+
```
23+
24+
**Steps to reproduce:**
25+
1.
26+
2.
27+
3.
28+
29+
## Expected Behavior
30+
31+
What you expected to happen.
32+
33+
## Actual Behavior
34+
35+
What actually happened. Include the full error message and traceback if applicable.
36+
37+
```
38+
Paste error message/traceback here
39+
```
40+
41+
## Environment
42+
43+
Please provide the following information:
44+
45+
- **BrainPy Version:** [e.g., 2.4.0]
46+
- **Python Version:** [e.g., 3.10.5]
47+
- **JAX Version:** [e.g., 0.4.30]
48+
- **Operating System:** [e.g., Ubuntu 22.04, macOS 13.0, Windows 11]
49+
- **Hardware:** [e.g., CPU only, CUDA GPU, TPU]
50+
- **Installation method:** [e.g., pip, conda, from source]
51+
52+
**Additional context:**
1253
```python
13-
import brainpy.math as bm
14-
print(bm.asarray([1, 2, 3]))
15-
# Array([1, 2, 3], dtype=int32)
54+
import brainpy as bp
55+
print(bp.__version__)
56+
# Add any other relevant version info
1657
```
1758

18-
- [ ] If applicable, include full error messages/tracebacks.
59+
## Additional Context
60+
61+
Add any other context about the problem here (e.g., related issues, potential causes, attempted solutions).
62+
63+
## Checklist
64+
65+
- [ ] I have checked for duplicate issues
66+
- [ ] I have provided a minimal code example to reproduce the bug
67+
- [ ] I have included the full error message/traceback
68+
- [ ] I have provided environment information

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: 📚 Documentation
4+
url: https://brainpy.readthedocs.io/
5+
about: Check the documentation for guides, tutorials, and API reference
6+
- name: 💬 GitHub Discussions
7+
url: https://github.com/brainpy/BrainPy/discussions
8+
about: Ask questions and discuss ideas with the community
9+
- name: 🔒 Security Vulnerability
10+
url: https://github.com/brainpy/BrainPy/security/advisories/new
11+
about: Report security vulnerabilities privately (do not create public issues)
Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,57 @@
11
---
2-
name: 'Feature Request'
3-
about: 'Suggest a new idea or improvement for BrainPy'
4-
labels: 'enhancement'
2+
name: Feature Request
3+
about: Suggest a new idea or improvement for BrainPy
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
57
---
68

7-
Please:
9+
## Feature Description
810

9-
- [ ] Check for duplicate requests.
10-
- [ ] Describe your goal, and if possible provide a code snippet with a motivating example.
11+
**Is your feature request related to a problem? Please describe.**
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
14+
**Describe the solution you'd like**
15+
A clear and concise description of what you want to happen.
16+
17+
## Motivation and Use Case
18+
19+
**Why is this feature important?**
20+
Explain the motivation for this feature and who would benefit from it.
21+
22+
**Example use case:**
23+
```python
24+
import brainpy as bp
25+
26+
# Example code showing how you would like to use this feature
27+
# This helps us understand your vision
28+
```
29+
30+
## Proposed Implementation (Optional)
31+
32+
**How do you envision this working?**
33+
If you have ideas about how this could be implemented, share them here.
34+
35+
**API design (if applicable):**
36+
```python
37+
# Proposed API or interface
38+
```
39+
40+
## Alternatives Considered
41+
42+
**What alternatives have you considered?**
43+
Describe alternative solutions or features you've considered and why they don't fully address your needs.
44+
45+
## Additional Context
46+
47+
Add any other context, screenshots, references to related work, or examples from other libraries.
48+
49+
**Related issues/PRs:**
50+
- #issue_number
51+
52+
## Checklist
53+
54+
- [ ] I have checked for duplicate feature requests
55+
- [ ] I have provided a clear use case and motivation
56+
- [ ] I have described the desired behavior
57+
- [ ] I have considered and described alternatives

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 119 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,123 @@
1-
<!--- Provide a general summary of your changes in the Title above -->
2-
<!--- Please do remember to follow the contributing guidelines -->
1+
<!--
2+
Thank you for contributing to BrainPy!
3+
Please fill out this template to help us review your pull request.
4+
See CONTRIBUTING.md for guidelines.
5+
-->
6+
7+
## Summary
8+
9+
<!-- Provide a clear, concise summary of your changes -->
10+
11+
**Fixes #(issue number)** <!-- If this PR closes an issue, link it here -->
12+
13+
## Type of Change
14+
15+
<!-- Mark the appropriate option with an "x" -->
16+
17+
- [ ] Bug fix (non-breaking change which fixes an issue)
18+
- [ ] New feature (non-breaking change which adds functionality)
19+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
20+
- [ ] Documentation update
21+
- [ ] Code refactoring (no functional changes)
22+
- [ ] Performance improvement
23+
- [ ] Test coverage improvement
24+
- [ ] Other (please describe):
325

426
## Description
5-
<!--- Why is this change required? What problem does it solve? -->
6-
<!--- Describe your changes in detail here to communicate to the maintainers why this pull request should be accepted -->
7-
<!--- Describe your technology stack here if not a documentation update -->
8-
<!--- Tasklist format is recommended for all pull requests and is required for all draft pull requests. You can couple your description with the tasklist -->
9-
<!--- If it fixes an open issue, please link to the issue here in the last line. -->
10-
11-
## How Has This Been Tested
12-
<!--- Please describe in detail how you tested your changes locally -->
13-
<!--- Include details of your testing environment, and the tests you ran to -->
14-
<!--- For example, markdown files should pass markdownlint locally according to the rules -->
15-
<!--- See how your change affects other areas of the code, etc. -->
16-
17-
## Types of changes
18-
<!--- What types of changes does your code introduce? -->
19-
<!--- Only left the line that best describes this pull request -->
20-
- Bug fix (non-breaking change which fixes an issue)
21-
- New feature (non-breaking change which adds functionality)
22-
- Documentation (non-breaking change which updates documentation)
23-
- Breaking change (fix or feature that would cause existing functionality to change)
24-
- Code style (formatting, renaming)
25-
- Refactoring (no functional changes, no api changes)
26-
- Other (please describe here):
27+
28+
**What does this PR do?**
29+
<!-- Describe your changes in detail -->
30+
31+
**Why is this change needed?**
32+
<!-- Explain the motivation for this change -->
33+
34+
**How does it work?**
35+
<!-- Provide technical details about your implementation -->
36+
37+
## Changes Made
38+
39+
<!-- List the main changes in this PR -->
40+
41+
-
42+
-
43+
-
44+
45+
## Testing
46+
47+
**How has this been tested?**
48+
<!-- Describe the tests you ran to verify your changes -->
49+
50+
```python
51+
# Example test code or commands used
52+
```
53+
54+
**Test environment:**
55+
- Python version:
56+
- BrainPy version:
57+
- JAX version:
58+
- OS:
59+
60+
**Test coverage:**
61+
- [ ] Added new tests for this change
62+
- [ ] All existing tests pass
63+
- [ ] Manual testing performed
64+
65+
## Performance Impact
66+
67+
<!-- If applicable, describe any performance implications -->
68+
69+
- [ ] No performance impact
70+
- [ ] Performance improved (provide benchmarks)
71+
- [ ] Performance may be affected (explain why and how much)
72+
73+
## Documentation
74+
75+
- [ ] Docstrings added/updated
76+
- [ ] Documentation updated (if needed)
77+
- [ ] Examples added/updated (if applicable)
78+
- [ ] CHANGELOG entry added (for notable changes)
79+
80+
## Screenshots (if applicable)
81+
82+
<!-- Add screenshots to help explain your changes -->
83+
84+
## Breaking Changes
85+
86+
<!-- If this is a breaking change, describe the impact and migration path -->
87+
88+
**Breaking change details:**
89+
<!-- What breaks? How should users update their code? -->
90+
91+
**Migration guide:**
92+
```python
93+
# Before (old way)
94+
95+
# After (new way)
96+
```
2797

2898
## Checklist
29-
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
30-
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
31-
- [ ] Code follows the code style of this project.
32-
- [ ] Changes follow the **CONTRIBUTING** guidelines.
33-
- [ ] Update necessary documentation accordingly.
34-
- [ ] Lint and tests pass locally with the changes.
35-
- [ ] Check issues and pull requests first. You don't want to duplicate effort.
36-
37-
## Other information
99+
100+
<!-- Ensure all items are complete before submitting -->
101+
102+
- [ ] My code follows the project's style guidelines
103+
- [ ] I have performed a self-review of my code
104+
- [ ] I have commented my code, particularly in hard-to-understand areas
105+
- [ ] I have made corresponding changes to the documentation
106+
- [ ] My changes generate no new warnings
107+
- [ ] I have added tests that prove my fix is effective or that my feature works
108+
- [ ] New and existing unit tests pass locally with my changes
109+
- [ ] Any dependent changes have been merged and published
110+
- [ ] I have checked for duplicate PRs/issues
111+
- [ ] I have read and followed the [CONTRIBUTING](../CONTRIBUTING.md) guidelines
112+
113+
## Additional Notes
114+
115+
<!-- Any additional information that reviewers should know -->
116+
117+
## Related Issues/PRs
118+
119+
<!-- Link to related issues or pull requests -->
120+
121+
- Related to #
122+
- Depends on #
123+
- Blocks #

0 commit comments

Comments
 (0)