Thank you for your interest in contributing to customhys! This document provides guidelines and instructions for contributing.
-
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
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-allOr run individually:
make format # Format code with black
make lint # Check code with ruff
make typecheck # Type check with mypy
make test # Run testsPre-commit hooks will run automatically before each commit:
pre-commit install # Install hooks
pre-commit run --all-files # Run manuallyWrite tests for new features and bug fixes:
make test # Run tests with coverage
make test-fast # Run tests without coverageTests should be placed in the tests/ directory.
-
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
- Follow PEP 8 guidelines
- Maximum line length: 120 characters
- Use type hints where appropriate
- Write docstrings for all public functions/classes
- Update README.md if adding new features
- Document all public APIs
- Include examples for complex functionality
- Use clear, descriptive commit messages
- Start with a verb in present tense (e.g., "Add", "Fix", "Update")
- Reference issue numbers when applicable
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
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 dependenciesWhen reporting issues, please include:
- Python version
- Operating system
- Clear description of the problem
- Minimal code example to reproduce
- Expected vs actual behavior
Feel free to open an issue for questions or reach out to the maintainers.
By contributing, you agree that your contributions will be licensed under the MIT License.