Development Guide#

This guide helps developers set up and contribute to the HBAT project.

Quick Start#

  1. Clone the repository

git clone https://github.com/abhishektiwari/hbat.git
cd hbat
  1. Set up development environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements-dev.txt
pip install -e .
  1. Run tests

make test
  1. Try the applications

# CLI
python hbat_cli.py example_pdb_files/6rsa.pdb --verbose

# GUI (if tkinter available)
python hbat_gui.py

Development Workflow#

Code Style#

We use Python standard tools for code quality:

# Format code
make format

# Check style
make lint

# Type checking
make type-check

Testing#

The project uses a comprehensive, modular test suite with both pytest and custom test runner support. The test architecture is organized by module with flexible execution options and extensive coverage reporting.

# Run all tests (recommended)
make test

# Test specific components
make test-core      # Core module tests (vector, parser, analysis)
make test-cli       # CLI tests (argument parsing, presets)
make test-gui       # GUI tests (components, imports)
make test-coverage  # Generate HTML coverage report

Building and Distribution#

# Build package
make build

# Check package
make check

# Install in development mode
pip install -e .

# Install with optional dependencies
pip install -e .[dev,visualization,export]

Contributing Workflow#

Pull Request Process#

  1. Fork the repository

  2. Create a feature branch

  3. Make changes with tests

  4. Run code quality checks

  5. Submit pull request with description

Code Review Checklist#

  • Code follows style guidelines

  • Tests pass

  • Documentation updated

  • No performance regressions

  • Backwards compatibility maintained

License#

This project is licensed under the MIT License. See LICENSE file for details.