Contributing to customhysο
Thank you for your interest in contributing to customhys! This document provides guidelines and instructions for contributing.
Development Setupο
Fork and clone the repository
git clone https://github.com/YOUR_USERNAME/customhys.git cd customhys
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install development dependencies
make setup-dev # or manually: pip install -e ".[dev,ml,examples]" pre-commit install
Development Workflowο
Code Qualityο
We use several tools to maintain code quality:
Black: Code formatting (line length: 120)
Ruff: Fast linting and code quality checks
MyPy: Static type checking
Pytest: Testing framework
Run all checks before committing:
make check-all
Or run individually:
make format # Format code with black
make lint # Check code with ruff
make typecheck # Type check with mypy
make test # Run tests
Pre-commit Hooksο
Pre-commit hooks will run automatically before each commit:
pre-commit install # Install hooks
pre-commit run --all-files # Run manually
Testingο
Write tests for new features and bug fixes:
make test # Run tests with coverage
make test-fast # Run tests without coverage
Tests should be placed in the tests/ directory.
Making Changesο
Create a new branch
git checkout -b feature/your-feature-name # or git checkout -b fix/bug-description
Make your changes
Write clear, documented code
Add tests for new functionality
Update documentation as needed
Run checks
make check-all make test
Commit your changes
git add . git commit -m "Clear description of your changes"
Push and create a Pull Request
git push origin your-branch-name
Coding Standardsο
Python Styleο
Follow PEP 8 guidelines
Maximum line length: 120 characters
Use type hints where appropriate
Write docstrings for all public functions/classes
Documentationο
Update README.md if adding new features
Document all public APIs
Include examples for complex functionality
Commit Messagesο
Use clear, descriptive commit messages
Start with a verb in present tense (e.g., βAddβ, βFixβ, βUpdateβ)
Reference issue numbers when applicable
Project Structureο
customhys/
βββ customhys/ # Main package
β βββ __init__.py
β βββ benchmark_func.py
β βββ experiment.py
β βββ hyperheuristic.py
β βββ metaheuristic.py
β βββ operators.py
β βββ population.py
β βββ tools.py
β βββ visualisation.py
βββ tests/ # Test files
βββ examples/ # Example notebooks and scripts
βββ docfiles/ # Documentation assets
βββ pyproject.toml # Project configuration
βββ setup.py # Setup script
βββ requirements.txt # Core dependencies
Optional Dependenciesο
The project has several optional dependency groups:
ml: Machine Learning support (TensorFlow)dev: Development tools (pytest, black, ruff, mypy)examples: Jupyter notebooks supportdocs: Documentation building tools
Install with:
pip install -e ".[ml,dev,examples]" # Install specific groups
pip install -e ".[all]" # Install all optional dependencies
Reporting Issuesο
When reporting issues, please include:
Python version
Operating system
Clear description of the problem
Minimal code example to reproduce
Expected vs actual behavior
Questions?ο
Feel free to open an issue for questions or reach out to the maintainers.
Licenseο
By contributing, you agree that your contributions will be licensed under the MIT License.