Thank you for your interest in contributing to Auto3D! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- Making Changes
- Testing
- Documentation
- Submitting Changes
- Style Guide
Please be respectful and constructive in all interactions. We welcome contributors of all experience levels.
We welcome:
- Bug reports: Found a bug? Open an issue with a minimal reproducible example
- Feature requests: Have an idea? Open a discussion first
- Bug fixes: Fix an issue and submit a PR
- Documentation: Improve docs, fix typos, add examples
- New features: Discuss in an issue first, then implement
- Check existing issues to avoid duplicates
- For new features, open an issue to discuss the approach
- For large changes, get feedback before investing significant time
- Python 3.10 or later
- Git
- conda (recommended) or pip
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/Auto3D_pkg.git cd Auto3D_pkg -
Create a development environment:
# Using conda (recommended) conda env create -f installation.yml -n auto3d-dev conda activate auto3d-dev # Or using pip python -m venv venv source venv/bin/activate # Linux/Mac # or: venv\Scripts\activate # Windows
-
Install in development mode:
pip install -e ".[dev]" -
Install pre-commit hooks (optional but recommended):
pip install pre-commit pre-commit install
# Run tests
pytest tests/
# Check CLI works
auto3d --version
# Build docs
cd docs && make html-
Create a branch from
main:git checkout -b feature/your-feature-name # or: git checkout -b fix/issue-description -
Make your changes in small, focused commits
-
Keep your branch up to date:
git fetch origin git rebase origin/main
Use clear, descriptive commit messages:
type: Short description (max 50 chars)
Longer description if needed. Explain what and why,
not how (the code shows how).
Fixes #123
Types:
feat: New featurefix: Bug fixdocs: Documentation onlytest: Adding or updating testsrefactor: Code change that neither fixes a bug nor adds a featurestyle: Formatting, missing semicolons, etc.chore: Maintenance tasks
Before committing:
# Format code
ruff format src/ tests/
# Check linting
ruff check src/ tests/
# Type checking
mypy src/Auto3D/
# Run tests
pytest tests/# Run all tests
pytest tests/
# Run specific test file
pytest tests/test_auto3D.py
# Run specific test
pytest tests/test_auto3D.py::test_smiles2mols
# Run with coverage
pytest --cov=Auto3D tests/
# Run with verbose output
pytest -v tests/- Add tests for new features in
tests/ - Follow existing test patterns
- Use descriptive test names
- Include edge cases
Example:
def test_auto3d_options_validation():
"""Test that Auto3DOptions validates parameters correctly."""
# Valid configuration
config = Auto3DOptions(path="test.smi", k=1)
assert config.k == 1
# Invalid: both k and window set
with pytest.raises(ValueError):
Auto3DOptions(path="test.smi", k=1, window=5.0)- Use small test molecules in
tests/files/ - Don't commit large data files
- Use fixtures for common test data
cd docs
pip install -r requirements.txt
make html
# Open build/html/index.html in browser- Use reStructuredText for Sphinx docs
- Include code examples that actually work
- Keep explanations concise
- Add cross-references where helpful
Use Google-style docstrings:
def function_name(param1: str, param2: int = 0) -> bool:
"""Short description of function.
Longer description if needed. Explain what the function
does, not how it does it.
Args:
param1: Description of param1.
param2: Description of param2. Defaults to 0.
Returns:
Description of return value.
Raises:
ValueError: When param1 is empty.
Example:
>>> result = function_name("test", 5)
>>> print(result)
True
"""-
Ensure all tests pass:
pytest tests/
-
Update documentation if needed
-
Push your branch:
git push origin feature/your-feature-name
-
Open a Pull Request:
- Use a clear title describing the change
- Reference related issues (
Fixes #123) - Describe what changes you made and why
- Include screenshots for UI changes
-
Address review feedback:
- Make requested changes
- Push additional commits
- Re-request review when ready
- Tests pass locally
- New code has tests
- Documentation updated (if needed)
- Commit messages are clear
- Branch is up to date with main
- No unrelated changes included
We follow PEP 8 with these specifics:
- Line length: 100 characters max
- Imports: Use
isortordering - Formatting: Use
ruff format - Type hints: Required for public APIs
# Standard library imports
import os
from pathlib import Path
# Third-party imports
import torch
from rdkit import Chem
# Local imports
from Auto3D.config import Auto3DOptions
from Auto3D.exceptions import Auto3DErrorsnake_casefor functions, variables, modulesPascalCasefor classesUPPER_CASEfor constants- Descriptive names over abbreviations
def process_molecules(
smiles: list[str],
config: Auto3DOptions,
) -> list[Chem.Mol]:
"""Process molecules with type hints."""
...- Questions: Open a Discussion
- Bugs: Open an Issue
- Security: See SECURITY.md
Contributors are recognized in:
- Release notes
- The contributors list
Thank you for contributing to Auto3D!