Thank you for your interest in contributing to TeachSim! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- How to Contribute
- Development Setup
- Coding Standards
- Testing Guidelines
- Submitting Changes
- Reporting Issues
- Feature Requests
We are committed to providing a welcoming and inclusive environment for all contributors. Please be respectful and constructive in all interactions.
- Use welcoming and inclusive language
- Be respectful of differing viewpoints and experiences
- Gracefully accept constructive criticism
- Focus on what is best for the community
- Show empathy towards other community members
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/teaching_simulation.git cd teaching_simulation - Create a branch for your changes:
git checkout -b feature/your-feature-name
There are many ways to contribute to TeachSim:
- 🐛 Report bugs - Help us identify issues
- 💡 Suggest features - Propose new functionality
- 📝 Improve documentation - Make it easier for others to understand
- 🔧 Fix bugs - Submit patches for known issues
- ✨ Add features - Implement new capabilities
- 🧪 Write tests - Improve code coverage and reliability
- 📊 Add experiments - Contribute new experimental configurations
- Python 3.10 or higher
- pip package manager
- Git
-
Install dependencies:
cd teaching_simulation pip install -r requirements.txt -
Verify installation:
python main.py --mock_test --n_rounds 5
For development, you may want to install additional tools:
pip install black flake8 pytest mypyWe follow PEP 8 style guidelines with some modifications:
- Line length: Maximum 88 characters (Black default)
- Indentation: 4 spaces (no tabs)
- Imports: Organized in three groups (stdlib, third-party, local)
- Naming conventions:
- Classes:
PascalCase - Functions/methods:
snake_case - Constants:
UPPER_CASE - Private methods:
_leading_underscore
- Classes:
We recommend using Black for consistent code formatting:
black teaching_simulation/Use type hints for function parameters and return values:
from typing import List, Tuple
import numpy as np
from numpy.typing import NDArray
def compute_likelihood(
data: List[Point],
hypothesis: Hypothesis
) -> NDArray[np.float64]:
...- Docstrings: Use Google-style docstrings for all public functions and classes
- Comments: Explain why, not what (code should be self-explanatory)
- README: Update documentation when adding new features
Example docstring:
def select_data_point(self, strategy: str = "random") -> Tuple[Point, int]:
"""
Select a data point to show to the student.
Args:
strategy: Selection strategy ('random' or 'hypothesis')
Returns:
A tuple of (selected_point, cluster_label)
Raises:
ValueError: If strategy is not recognized
"""
...Before submitting changes, ensure all tests pass:
# Run mock test
python main.py --mock_test --n_rounds 5
# Run with different configurations
python main.py --config configs/test.yamlWhen adding new features:
- Add test cases that cover normal operation
- Add edge case tests
- Test error handling
- Verify backward compatibility
Create test configuration files in configs/ directory:
# configs/test_new_feature.yaml
n_hypotheses: 5
n_clusters: 2
teacher_strategy: hypothesis
student_mode: rational
...Write clear, descriptive commit messages:
[Component] Brief description of change
More detailed explanation if needed. Wrap at 72 characters.
- List specific changes
- Use bullet points for clarity
- Reference issue numbers (#123)
Examples:
[agents] Add uncertainty-based student strategy
[env] Fix data generation for uniform initialization
[docs] Update README with new parameter descriptions
[experiments] Add experiment 7 comparing belief particle counts
-
Update your fork with the latest changes:
git fetch upstream git rebase upstream/main
-
Push your changes:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub with:
- Clear title describing the change
- Description of what changed and why
- Reference to related issues (if any)
- Screenshots/plots if applicable
- Test results
-
Address review comments promptly and respectfully
-
Ensure CI passes (if configured)
Before submitting, ensure:
- Code follows style guidelines
- Documentation is updated
- Tests pass locally
- Commit messages are clear
- No unnecessary files included
- Configuration files are valid YAML
- Results can be reproduced with provided configs
When reporting bugs, please include:
- Description: Clear description of the issue
- Steps to reproduce: Exact steps to trigger the bug
- Expected behavior: What should happen
- Actual behavior: What actually happens
- Environment:
- Python version
- OS (macOS, Linux, Windows)
- Package versions (
pip list)
- Configuration: Config file or command-line arguments used
- Logs/errors: Full error messages and stack traces
- Results: Any relevant output files or plots
## Bug Description
Brief description of the bug
## Steps to Reproduce
1. Step 1
2. Step 2
3. Step 3
## Expected Behavior
What should happen
## Actual Behavior
What actually happens
## Environment
- Python version: 3.10
- OS: macOS 14
- NumPy version: 1.26.4
## Configuration
```yaml
# paste config here# paste error here
## Feature Requests
We welcome feature suggestions! When proposing new features:
1. **Use case**: Describe the problem or use case
2. **Proposed solution**: How you envision the feature working
3. **Alternatives**: Any alternative approaches considered
4. **Implementation notes**: Technical details if you have ideas
### Feature Request Template
```markdown
## Feature Description
Brief description of the proposed feature
## Motivation
Why is this feature needed? What problem does it solve?
## Proposed Implementation
How should this feature work?
## Example Usage
```python
# Show example code using the feature
What other approaches did you consider?
Any other information, diagrams, or references
## Areas for Contribution
We especially welcome contributions in these areas:
### High Priority
- 🧪 **Unit tests**: Increase test coverage
- 📚 **Documentation**: Improve docstrings and tutorials
- 🐛 **Bug fixes**: Address known issues
- 🎯 **Performance**: Optimize computational bottlenecks
### Medium Priority
- 🔬 **New experiments**: Add interesting experimental setups
- 📊 **Visualization**: Improve plotting and analysis tools
- 🤖 **Agent strategies**: Implement new selection strategies
- 🌐 **Environment types**: Add new hypothesis spaces
### Future Directions
- 🔄 **Active learning**: More sophisticated query strategies
- 🧠 **Deep learning**: Neural network-based agents
- 📈 **Scalability**: Handle larger hypothesis spaces
- 🎮 **Interactive demos**: Web-based visualization
## Questions?
If you have questions about contributing:
1. Check existing [issues](https://github.com/martinakaduc/teaching_simulation/issues)
2. Read the [README](README.md) and code documentation
3. Open a new issue with the `question` label
## Recognition
Contributors will be:
- Listed in the project's contributors page
- Acknowledged in release notes
- Credited in academic citations (where appropriate)
Thank you for helping improve TeachSim! 🎉