|
| 1 | +# Contributing to JABS |
| 2 | + |
| 3 | +Thank you for your interest in contributing to JABS (JAX Animal Behavior System)! This document provides guidelines for contributing to the project. |
| 4 | + |
| 5 | +## Copyright and License |
| 6 | + |
| 7 | +**Important:** By contributing source code to JABS, you agree that your contributions will have their copyright assigned to The Jackson Laboratory. |
| 8 | + |
| 9 | +All code contributions become part of the JABS project and are subject to the project's license terms (see the LICENSE file in the repository root). JABS is licensed under a non-commercial use license. Contact [email protected] for information about commercial licensing. |
| 10 | + |
| 11 | +## Quick Start for Contributors |
| 12 | + |
| 13 | +```bash |
| 14 | +# 1. Fork and clone the repository |
| 15 | +git clone https://github.com/YOUR_USERNAME/JABS-behavior-classifier.git |
| 16 | +cd JABS-behavior-classifier |
| 17 | + |
| 18 | +# 2. Install uv (Python package manager) |
| 19 | +curl -LsSf https://astral.sh/uv/install.sh | sh # macOS/Linux |
| 20 | +# OR: powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows |
| 21 | + |
| 22 | +# 3. Set up development environment |
| 23 | +uv sync |
| 24 | +source .venv/bin/activate # macOS/Linux (or .venv\Scripts\activate on Windows) |
| 25 | +pre-commit install |
| 26 | + |
| 27 | +# 4. Create a feature branch |
| 28 | +git checkout -b feature/my-feature |
| 29 | + |
| 30 | +# 5. Make your changes and commit |
| 31 | +git add . |
| 32 | +git commit -m "Description of changes" |
| 33 | + |
| 34 | +# 6. Run tests |
| 35 | +pytest |
| 36 | + |
| 37 | +# 7. Push and create a pull request |
| 38 | +git push origin feature/my-feature |
| 39 | +``` |
| 40 | + |
| 41 | +## Contribution Guidelines |
| 42 | + |
| 43 | +Before submitting a contribution: |
| 44 | + |
| 45 | +1. **Follow the code style guidelines** - JABS uses Ruff for linting and formatting |
| 46 | +2. **Add tests** for new functionality |
| 47 | +3. **Update documentation** as needed (docstrings, user guide, developer guide) |
| 48 | +4. **Run the test suite** to ensure nothing is broken: `pytest` |
| 49 | +5. **Ensure pre-commit hooks pass** - They will run automatically when you commit |
| 50 | +6. **Submit a pull request** with a clear description of your changes |
| 51 | + |
| 52 | +### Code Style |
| 53 | + |
| 54 | +JABS uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting: |
| 55 | + |
| 56 | +```bash |
| 57 | +# Check for issues |
| 58 | +ruff check . |
| 59 | + |
| 60 | +# Auto-fix issues |
| 61 | +ruff check --fix . |
| 62 | + |
| 63 | +# Format code |
| 64 | +ruff format . |
| 65 | +``` |
| 66 | + |
| 67 | +Pre-commit hooks will automatically run these checks before each commit. If your commit is blocked: |
| 68 | + |
| 69 | +1. Fix issues: `ruff check --fix . && ruff format .` |
| 70 | +2. Stage fixes: `git add -u` |
| 71 | +3. Try committing again |
| 72 | + |
| 73 | +### Running Tests |
| 74 | + |
| 75 | +```bash |
| 76 | +pytest # Run all tests |
| 77 | +pytest -v # Verbose output |
| 78 | +pytest tests/path/ # Run specific tests |
| 79 | +``` |
| 80 | + |
| 81 | +## Types of Contributions Welcome |
| 82 | + |
| 83 | +We welcome various types of contributions: |
| 84 | + |
| 85 | +- **Bug fixes**: Help identify and fix issues |
| 86 | +- **New features**: Add new behavioral features, classifiers, or GUI improvements |
| 87 | +- **Documentation**: Improve user guides, developer documentation, or code comments |
| 88 | +- **Testing**: Add test coverage or improve existing tests |
| 89 | +- **Performance improvements**: Optimize code for better performance |
| 90 | + |
| 91 | +## Developer Documentation |
| 92 | + |
| 93 | +For detailed information about JABS architecture, development setup, and implementation guides, see: |
| 94 | + |
| 95 | +- **[Development Guide](docs/DEVELOPMENT.md)** - Comprehensive guide to JABS architecture, feature extraction system, building, and deployment |
| 96 | +- **[User Guide](docs/user-guide.md)** - End-user documentation |
| 97 | + |
| 98 | +## Pull Request Process |
| 99 | + |
| 100 | +1. **Create a feature branch** from `main` |
| 101 | +2. **Make your changes** with clear, focused commits |
| 102 | +3. **Update tests** and documentation |
| 103 | +4. **Ensure all tests pass** locally |
| 104 | +5. **Create a pull request** against the `main` branch |
| 105 | +6. **Wait for review** - Maintainers will review and may request changes |
| 106 | +7. **CI/CD checks must pass** - Automated checks will run on your PR |
| 107 | + |
| 108 | +## Questions? |
| 109 | + |
| 110 | +- **General questions**: Open an issue on GitHub |
| 111 | +- **Security issues **: Email [email protected] (do not open public issues) |
| 112 | +- **Development questions **: See [DEVELOPMENT.md ](docs/DEVELOPMENT.md) or contact [email protected] |
| 113 | + |
| 114 | +## Code of Conduct |
| 115 | + |
| 116 | +Be respectful and professional in all interactions. We aim to foster an inclusive and welcoming community. |
| 117 | + |
| 118 | +--- |
| 119 | + |
| 120 | +**Thank you for contributing to JABS!** |
| 121 | + |
0 commit comments