A tested PyTorch framework for computational pathology research with working benchmarks on PatchCamelyon and CAMELYON16
View on GitHub matthewvaishnav/computational-pathology-research
This document describes all available Makefile targets for the Computational Pathology Research Framework.
make help # Show all available targets
make install # Install dependencies
make test # Run tests
make demo # Run quick demo
make docker-build # Build Docker image
Use make directly:
make install
make test
Use the batch file wrapper:
make.bat install
make.bat test
Or install make for Windows:
choco install makescoop install makemake installInstall production dependencies.
What it does:
Usage:
make install
make install-devInstall development dependencies including testing and linting tools.
What it does:
Usage:
make install-dev
make dev-setupComplete development environment setup.
What it does:
install-devUsage:
make dev-setup
make testRun all tests with verbose output.
Usage:
make test
Output: Test results in terminal
make test-covRun tests with coverage reporting.
Usage:
make test-cov
Output:
htmlcov/View HTML report:
open htmlcov/index.html # macOS
xdg-open htmlcov/index.html # Linux
start htmlcov/index.html # Windows
make test-quickRun only quick tests (excludes slow tests).
Usage:
make test-quick
make test-watchRun tests in watch mode (re-runs on file changes).
Usage:
make test-watch
Requirements: pytest-watch (included in requirements-dev.txt)
make lintRun all linting checks.
Checks:
Usage:
make lint
make formatAuto-format code with black and isort.
Usage:
make format
What it does:
make type-checkRun static type checking with mypy.
Usage:
make type-check
make securityRun security vulnerability scanning.
Usage:
make security
Output: bandit-report.json
make check-allRun all code quality checks (lint + type-check + security).
Usage:
make check-all
make demoRun quick demo (3 minutes).
Usage:
make demo
Output: results/quick_demo/
make demo-missingRun missing modality robustness demo.
Usage:
make demo-missing
Output: results/missing_modality_demo/
make demo-temporalRun temporal reasoning demo.
Usage:
make demo-temporal
Output: results/temporal_demo/
make demo-allRun all demos sequentially.
Usage:
make demo-all
Time: ~10 minutes total
make trainTrain model with default configuration.
Usage:
make train
Config: experiments/configs/default.yaml
make train-quickQuick training for testing (5 epochs).
Usage:
make train-quick
Config: experiments/configs/quick_demo.yaml
make train-fullFull production training (200 epochs).
Usage:
make train-full
Config: experiments/configs/full_training.yaml
Custom training:
python experiments/train.py --config-name <config>
make evaluateEvaluate trained model.
Usage:
make evaluate
Requirements: Trained model at checkpoints/best_model.pth
Output: results/evaluation/
make evaluate-ablationRun comprehensive ablation study.
Usage:
make evaluate-ablation
What it does:
Output: results/ablation/
make docker-buildBuild Docker image.
Usage:
make docker-build
Output: Docker image pathology-api:latest
make docker-runStart Docker container with API.
Usage:
make docker-run
Access: http://localhost:8000
API docs: http://localhost:8000/docs
make docker-stopStop Docker containers.
Usage:
make docker-stop
make docker-logsView container logs (follow mode).
Usage:
make docker-logs
Exit: Ctrl+C
make docker-shellOpen bash shell in running container.
Usage:
make docker-shell
make docker-testRun Docker integration tests.
Usage:
make docker-test
What it does:
make jupyterStart Jupyter notebook server.
Usage:
make jupyter
Access: http://localhost:8888
make jupyter-dockerStart Jupyter in Docker container.
Usage:
make jupyter-docker
Access: http://localhost:8888
make cleanClean generated files and caches.
Removes:
__pycache__ directories*.pyc files.pytest_cache.mypy_cachehtmlcov/dist/ and build/Usage:
make clean
make clean-resultsClean result files from demos and evaluations.
Usage:
make clean-results
make clean-modelsClean saved model checkpoints (with confirmation).
Usage:
make clean-models
Warning: This deletes all saved models!
make clean-allClean everything except models.
Usage:
make clean-all
make dev-checkRun complete development check pipeline.
What it does:
Usage:
make dev-check
make ciSimulate CI pipeline locally.
What it does:
Usage:
make ci
Time: ~15 minutes
make versionShow version information.
Usage:
make version
Output:
make infoShow project information.
Usage:
make info
Output:
make statusShow project status.
Usage:
make status
Output:
make data-checkCheck data availability.
Usage:
make data-check
Output: Status of data directories
make monitor-trainingStart TensorBoard for monitoring training.
Usage:
make monitor-training
Access: http://localhost:6006
Logs directory: logs/
make quick-startQuick start workflow for new users.
What it does:
Usage:
make quick-start
make full-workflowComplete workflow for development.
What it does:
Usage:
make full-workflow
make helpShow all available targets with descriptions.
Usage:
make help
make help-dockerShow Docker-specific help.
Usage:
make help-docker
make help-trainingShow training-specific help.
Usage:
make help-training
make install-dev
make test
make demo
make format # Format code
make dev-check # Run all checks
make test # Run tests
make format # Format code
make lint # Check linting
make test-cov # Run tests with coverage
make ci # Simulate full CI pipeline
make train-quick # Quick test
make train # Full training
make evaluate # Evaluate results
make docker-build # Build image
make docker-run # Start container
make docker-logs # View logs
make docker-stop # Stop container
make release-check # Check release readiness
make clean-all # Clean everything
make ci # Run full CI
# Then create git tag
make: command not foundSolution:
make.bat insteadchoco install make (Windows)Solution:
make clean # Clean caches
make install # Reinstall dependencies
make test # Run tests again
Solution:
make clean # Clean build artifacts
docker system prune # Clean Docker cache
make docker-build # Rebuild
Solution:
make clean-all # Clean generated files
docker system prune -a # Clean Docker
make clean-models # Clean models (if needed)
make clean test demo
pytest tests/ -n auto # Use all CPU cores
make test-watch # Auto-run tests on changes
# Override Makefile variables
make train CONFIG=my_config
make test > /dev/null # Suppress output
make -n test # Show commands without executing
Set these in your shell or .env file:
# Python
export PYTHONPATH=.
# CUDA
export CUDA_VISIBLE_DEVICES=0
# Logging
export LOG_LEVEL=INFO
# Weights & Biases
export WANDB_API_KEY=your_key
Add to .vscode/tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "Run Tests",
"type": "shell",
"command": "make test",
"group": "test"
}
]
}
make testREADME.mdDOCKER.mdexperiments/configs/README.md.github/workflows/README.md