Thank you for your interest in contributing to the Spin-Based Neural Computation Framework! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Testing Guidelines
- Documentation Guidelines
By participating in this project, you agree to abide by our Code of Conduct, which promotes a respectful and inclusive environment.
- Fork the repository on GitHub
- Clone your fork to your local machine
- Set up the development environment as described in the Development Setup section
- Create a branch for your work
- Search existing issues to avoid duplicates
- Create a new issue with the following information:
- Clear and descriptive title
- Detailed steps to reproduce the bug
- Expected vs. actual behavior
- Screenshots or code snippets if applicable
- Environment details (OS, compiler version, etc.)
- Any relevant error messages or logs
- Search existing issues to avoid duplicates
- Create a new issue with the following information:
- Clear and descriptive title
- Detailed description of the proposed enhancement
- Justification: why this enhancement would be valuable
- Potential implementation approach (optional)
- Any references or examples (optional)
- Update your fork with the latest changes from the main repository
- Create a branch with a descriptive name related to your change
- Make your changes, following our Coding Standards
- Add tests for your changes to ensure functionality
- Run tests to make sure your changes don't break existing functionality
- Update documentation if needed
- Submit a pull request with the following information:
- Reference to the related issue(s)
- Description of the changes made
- Any notes on implementation choices
- Checklist of completed items (tests, documentation, etc.)
To set up your development environment:
-
Install dependencies:
- C compiler (GCC or Clang)
- Make build system
- SDL2 (for visualization)
-
Build from source:
make all_versions
-
Run tests:
make test
-
Code Style:
- Use 4 spaces for indentation
- Follow K&R style braces
- Use descriptive variable and function names
- Keep functions focused and reasonably sized
-
Comments:
- Add comments for complex logic and non-obvious behavior
- Document functions with purpose, parameters, and return values
- Use
//for single-line comments and/* */for multi-line comments - Include references to academic papers or mathematical formulas where appropriate
-
Error Handling:
- Always check return values from functions that might fail
- Use consistent error reporting mechanism
- Free allocated resources in error paths
-
Test Coverage:
- Add tests for new features
- Ensure tests cover both normal and edge cases
- Include validation against known analytical solutions where possible
-
Test Types:
- Unit tests for individual functions
- Integration tests for module interactions
- Performance tests for critical paths
- Numerical stability tests for computational functions
-
Code Documentation:
- Document all public functions in header files
- Explain parameters and return values
- Describe any side effects or dependencies
-
User Documentation:
- Update README.md for significant changes
- Provide examples for new features
- Keep documentation in the
docs/directory up-to-date - Include references to relevant research papers or educational materials
Thank you for contributing to the Spin-Based Neural Computation Framework!