Contributing to EldenGym¶
Thank you for your interest in contributing to EldenGym!
Development Setup¶
1. Fork and Clone¶
2. Install Development Dependencies¶
# Install with dev dependencies using uv
uv sync --group dev --group docs
# Or with pip
pip install -e ".[dev,docs]"
3. Set Up Pre-commit Hooks¶
Development Workflow¶
Code Style¶
We use ruff for linting and formatting:
# Format code
uv run ruff format .
# Check linting
uv run ruff check .
# Fix linting issues
uv run ruff check --fix .
Testing¶
# Run tests (when implemented)
uv run pytest
# Run specific test
uv run pytest tests/test_env.py
# With coverage
uv run pytest --cov=eldengym
Documentation¶
Build and serve documentation locally:
# Install docs dependencies
uv sync --group docs
# Serve docs locally
uv run mkdocs serve
# Build docs
uv run mkdocs build
Visit http://localhost:8000 to see the documentation.
Making Changes¶
1. Create a Branch¶
2. Make Your Changes¶
- Write clear, documented code
- Add docstrings to new functions/classes
- Update documentation if needed
- Add tests for new features
3. Commit¶
We use semantic commit messages:
# Feature
git commit -m "feat(env): add new observation type"
# Bug fix
git commit -m "fix(client): resolve connection timeout"
# Documentation
git commit -m "docs: update installation guide"
# Breaking change
git commit -m "feat(api)!: redesign action space
BREAKING CHANGE: Action space now uses continuous values"
4. Push and Create PR¶
Then create a Pull Request on GitHub.
Contribution Areas¶
High Priority¶
- ๐งช Tests - Add unit and integration tests
- ๐ Documentation - Improve guides and examples
- ๐ฎ Scenarios - Add new boss fight scenarios
- ๐ Wrappers - Create useful environment wrappers
Features¶
- Reward Functions - New reward function implementations
- Observation Processing - Better frame preprocessing
- Action Spaces - Alternative action representations
- Memory Patterns - Support for different game versions
Bug Fixes¶
- Performance improvements
- Memory leaks
- Connection issues
- Game state synchronization
Code Guidelines¶
Python Style¶
- Follow PEP 8
- Use type hints
- Maximum line length: 88 characters
- Docstrings: Google style
def my_function(arg1: int, arg2: str) -> bool:
"""Short description.
Longer description if needed.
Args:
arg1: Description of arg1
arg2: Description of arg2
Returns:
Description of return value
Raises:
ValueError: When something is wrong
"""
return True
Docstring Examples¶
class MyClass:
"""Brief description.
Detailed description of the class purpose and usage.
Attributes:
attr1: Description
attr2: Description
Example:
>>> obj = MyClass()
>>> obj.method()
'result'
"""
def method(self) -> str:
"""Method description."""
return "result"
Project Structure¶
eldengym/
โโโ eldengym/
โ โโโ __init__.py
โ โโโ env.py # Main environment
โ โโโ envs.py # Environment registration
โ โโโ rewards.py # Reward functions
โ โโโ wrappers.py # Gymnasium wrappers
โ โโโ utils.py # Utility functions
โ โโโ registry.py # Scenario registry
โ โโโ client/
โ โ โโโ siphon_client.py # gRPC client
โ โ โโโ elden_client.py # Game-specific client
โ โโโ files/
โ โโโ configs/ # Game configurations
โโโ examples/ # Example notebooks
โโโ docs/ # Documentation
โโโ tests/ # Test suite
โโโ pyproject.toml # Project config
Getting Help¶
- Issues: Open an issue for bugs or features
- Discussions: Use GitHub Discussions for questions
- Discord: (link if available)
Code of Conduct¶
Be respectful and constructive. We're all here to learn and build something cool!
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.