Development Workflow¶
This document provides a practical guide for the development workflow used in the QPERA project. Its purpose is to ensure consistency and reproducibility for the authors and any future researchers building on this work.
1. Development Environment Setup¶
Prerequisites¶
- Python 3.9+
- Conda/Miniconda
- Git
Installation Steps¶
-
Fork and Clone the Repository
-
Create and Activate the Environment
-
Install the Project Package
2. Core Development Workflow¶
Branching¶
All changes should be made in a feature branch to keep the main
branch stable.
Code Quality¶
We use ruff
for fast linting and formatting.
- Check for issues: make lint
- Automatically format code: make format
Testing¶
Before committing, run a small-scale experiment to ensure your changes haven't broken the pipeline.
# Run a quick test on the MovieLens dataset
python -m qpera.main --algo CF --dataset movielens --rows 1000
3. Extending the Project¶
This section provides a high-level overview of how to add new components.
Adding a New Algorithm¶
- Create a new file (e.g.,
qpera/NEW_ALGORITHM.py
) with an experiment loop function that matches the signature of existing algorithms (likecf_experiment_loop
). - Implement the data loading, training, prediction, and evaluation logic.
- Register the new algorithm in the
EXPERIMENT_CONFIGS
list inqpera/main.py
.
Adding a New Metric¶
- Add the metric calculation function to
qpera/metrics.py
. - Integrate the new metric into the evaluation section of the relevant algorithm loops (e.g., in
qpera/CF.py
).
Adding a New Dataset¶
- Create a new loader class in
qpera/datasets_loader.py
that inherits fromBaseDatasetLoader
. - Implement the
merge_datasets
method for your specific data source. - Register the new loader in the
dataset_loaders
dictionary within theloader
function.
4. Documentation¶
The documentation is built with MkDocs. To preview your changes locally:
5. Contact¶
For questions about the project, please contact the authors: - Julia Podsadna - Bartosz Chwiłkowski - Supervisor: Prof. Mikołaj Morzy