Contributing
We welcome contributions to Game Reasoning Arena! This guide will help you get started.
Development Setup
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/game_reasoning_arena.git
cd game_reasoning_arena
Create a development environment:
conda env create -f environment.yaml
conda activate game_reasoning_arena
pip install -e .
Install development dependencies:
pip install pytest black flake8 mypy
Code Style
We follow PEP 8 style guidelines. Please ensure your code is formatted with black:
black src/ tests/
Run linting checks:
flake8 src/ tests/
mypy src/
Testing
Run the test suite before submitting changes:
pytest tests/
Add tests for new functionality:
# tests/test_new_feature.py
import pytest
from game_reasoning_arena.your_module import YourClass
def test_your_function():
# Test implementation
assert True
Documentation
Update documentation for new features:
Add docstrings to new functions and classes
Update relevant .rst files in the docs/ directory
Build documentation locally to verify:
cd docs/
make html
Submitting Changes
Create a new branch for your feature:
git checkout -b feature/your-feature-name
Make your changes and commit:
git add .
git commit -m "Add your feature description"
Push to your fork:
git push origin feature/your-feature-name
Create a Pull Request on GitHub
Pull Request Guidelines
Include a clear description of the changes
Reference any related issues
Ensure all tests pass
Update documentation as needed
Keep changes focused and atomic
Adding New Games
To add support for a new game:
Create a new environment class in src/game_reasoning_arena/arena/envs/
Inherit from the base environment class
Implement required methods: reset(), step(), get_legal_actions()
Add configuration support
Include tests and documentation
Example:
from .base_env import BaseEnv
class NewGameEnv(BaseEnv):
def __init__(self, config):
super().__init__(config)
# Game-specific initialization
def reset(self):
# Reset game state
pass
def step(self, action):
# Execute action and return new state
pass
Adding New Agents
To add a new agent type:
Create a new agent class in src/game_reasoning_arena/arena/agents/
Inherit from BaseAgent
Implement get_action() and reset() methods
Add to agent registry if needed
Bug Reports
When reporting bugs, please include:
Python version and operating system
Full error traceback
Minimal example to reproduce the issue
Expected vs actual behavior
Feature Requests
For feature requests:
Describe the use case and motivation
Provide examples of how the feature would be used
Consider implementation complexity
Thank you for contributing to Game Reasoning Arena!