Thank you for your interest in contributing to the LLM Cognitive Profiling Framework! This document provides guidelines and instructions for contributing to the project.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Check if the issue already exists in the Issues section
- If not, create a new issue with:
- Clear, descriptive title
- Detailed description of the problem
- Steps to reproduce
- Expected vs actual behavior
- System information (OS, Python version, etc.)
- Relevant logs or error messages
- Check existing Issues for similar suggestions
- Create a new issue with the
enhancementlabel - Describe the enhancement and its benefits
- Provide use cases if applicable
- Fork the repository
- Create a feature branch from
main:git checkout -b feature/your-feature-name
- Make your changes following the coding standards
- Add tests for new functionality
- Update documentation as needed
- Commit with clear messages:
git commit -m "feat: add new cognitive metric for attention span" - Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request
-
Fork and clone the repository:
git clone https://github.com/yourusername/llm-cognitive-framework.git cd llm-cognitive-framework -
Create virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt # Development dependencies python -m spacy download en_core_web_sm -
Install pre-commit hooks:
pre-commit install
Run before committing:
black .
pylint src/Use Google-style docstrings:
def calculate_metric(data: List[float], method: str = "mean") -> float:
"""Calculate a cognitive metric from response data.
Args:
data: List of numerical values from analysis
method: Calculation method ('mean', 'median', 'weighted')
Returns:
Calculated metric value
Raises:
ValueError: If method is not recognized
"""Use type hints for all function signatures:
from typing import Dict, List, Optional
def analyze_responses(
responses: List[Dict[str, str]],
model_name: Optional[str] = None
) -> Dict[str, float]:# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=src --cov-report=html
# Run specific test
pytest tests/test_analyzer.py::test_specific_function- Place tests in
tests/directory - Mirror source structure
- Use descriptive test names
- Include edge cases
- Aim for >80% coverage
Example:
def test_cognitive_analyzer_identifies_reasoning_patterns():
"""Test that analyzer correctly identifies reasoning patterns."""
analyzer = CognitiveAnalyzer()
response = "Therefore, we can conclude that..."
result = analyzer._identify_reasoning_style(response)
assert result['deductive'] > 0
assert result['dominant'] == 'deductive'Follow Conventional Commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Test additions or fixeschore:Maintenance tasks
Examples:
feat: add support for Llama models
fix: correct metric calculation for working memory
docs: update API documentation
test: add tests for task generator
When adding new features, maintain the project structure:
src/
├── models/ # Model interfaces
├── tasks/ # Task generators
├── analysis/ # Response analyzers
├── metrics/ # Metric calculators
├── visualization/ # Visualizers
└── utils/ # Utilities
tests/
├── test_models/
├── test_tasks/
├── test_analysis/
├── test_metrics/
└── test_integration/
To add support for a new LLM:
- Create interface in
src/models/ - Add configuration in
config/config.yaml - Update
README.mdwith setup instructions - Add tests in
tests/test_models/ - Update requirements if needed
To add a new cognitive metric:
- Define metric in
src/metrics/metric_calculator.py - Add analysis method in
src/analysis/cognitive_analyzer.py - Create visualization in
src/visualization/profile_visualizer.py - Add tests
- Update documentation
- Update docstrings for all changes
- Update README.md for user-facing changes
- Add examples for new features
- Update configuration documentation
- Update version in
setup.pyandsrc/__init__.py - Update CHANGELOG.md
- Create release PR
- After merge, tag release:
git tag -a v1.0.1 -m "Release version 1.0.1" git push origin v1.0.1
- Open an issue for questions
- Join discussions in the Issues section
- Contact: tislam38@gatech.edu
By contributing, you agree that your contributions will be licensed under the MIT License.