Contributing to TensorPlay
We want to make contributing to TensorPlay as easy and transparent as possible.
Development Process
- Fork the repository: Click the 'Fork' button on the repository page.
- Clone your fork:bash
git clone https://github.com/your-username/tensorplay.git cd tensorplay - Create a branch:bash
git checkout -b my-new-feature - Make your changes: Implement your feature or fix.
- Run tests: Ensure all tests pass.bash
pytest test/ - Commit your changes:bash
git commit -am 'Add some feature' - Push to the branch:bash
git push origin my-new-feature - Submit a Pull Request: Go to the original repository and create a Pull Request.
Coding Style
- We follow PEP 8 for Python code.
- We use Google C++ Style Guide for C++ code.
- Python code should be typed using type hints where possible.
- Use
blackfor Python formatting andclang-formatfor C++.
Building from Source
Prerequisites
- Python 3.9+
- CMake 3.18+
- C++17 compatible compiler (MSVC on Windows, GCC/Clang on Linux/macOS)
- CUDA Toolkit (optional, for GPU support)
Installation
bash
pip install -r requirements.txt
python setup.py installOr for development (editable install):
bash
pip install -e .Running Tests
We use pytest for testing.
bash
# Run all tests
pytest
# Run specific test file
pytest test/test_tensor_basic.pyDocumentation
Documentation is built using Sphinx.
bash
cd docs
pip install -r requirements.txt
make htmlThe generated HTML files will be in docs/_build/html.
License
By contributing, you agree that your contributions will be licensed under its Apache 2.0 License.
