CVDNet pipeline
This repository contains the pipeline for Calibration from Fay Frost as part of the CVDNet project.
Installation
-
Clone the repository:
git clone https://github.com/alan-turing-institute/cvd-net-pipeline cd cvd-net-pipeline
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On macOS/Linux
-
Install
You can install the dependencies using the pyproject.toml file:
pip install .
Usage
The pipeline can be run by executing the main.py script. You must specify a configuration file in JSON format using the --config argument.
Configuration File
The configuration file should define the steps to run and other parameters such as the number of samples and with outputs used for calibration. Below is an example configuration file:
{
"input_parameters": "parameters_pulmonary_sensitive_summarystats.json",
"output_path": "output_synthetic/",
"steps": ["1", "2", "3", "4", "5"],
"nsamples": 64,
"n_pca_components": 10,
"n_params": 9,
"include_timeseries": 0,
"output_keys": [
"t_max_dpdt", "a_epad", "epad", "s_a_epad", "s_epad",
"min_dpdt", "max_dpdt", "A_p", "P_max", "esp", "sys",
"EF", "dia", "Ees/Ea", "iT", "PC1", "PC2", "PC3"
],
"epsilon_obs_scale": 0.05,
"output_dir_bayesian": "output_synthetic/output_5000_9params/bayesian_calibration_results/18_output_keys/calibration_20250619_135107"
}
input_parameters: The json file containting parameters and their ranges to sample from.
output_path: The path you want output to be saved to.
steps: The steps you want to run.
nsamples: The number of samples you want to run.
n_pca_components: The number of pca components to compute.
n_params: The number of non-fixed parameters sampled.
include_timeseries: (Not implemented yet) Whether the timeseries waveform should be included in the calibration 0/1 for true/false.
output_keys: The outputs you want to calibrate on.
epsilon_obs_scale: (Hard coded for now) Observation error
output_dir_bayesian: The directory where calibration files are saved if you are only running steps 6 onwards.
Running the Pipeline
To run the pipeline, specify the configuration file as follows:
python main.py --config config/pipeline_config.json
Steps in the Pipeline
- Simulate Data: Generates input and output data based on parameters.
- Analyze Giessen: Performs analysis on the simulated pressure waveform data.
- Compute PCA: Performs a PCA on the output data.
- Build Emulator: Builds an emulator for the data.
- Calibration: Calibrates the model.
- Simulate Posterior Data: Simulates data from posterior samples.
- Final Resampling: Performs final resampling on posterior simulations.
Example
To run specific steps, modify the steps field in the configuration file. For example, to run steps 1, 2, and 3, use the following within your configuration:
{
"steps": ["1", "2", "3"],
}
Then execute:
python main.py --config config/pipeline_config.json
Project Structure
main.py: Entry point for running the pipeline.pipeline/: Contains the modules for each step of the pipeline.simulate_data.py: Simulates input and output data.analyse_giessen.py: Analyzes the data.build_emulator.py: Builds the emulator.simulate_posterior.py: Simulates posterior data.calibrate.py: Calibrates the model.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Metadata
Release files for cvdnet-pipeline 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cvdnet_pipeline-0.1.0.tar.gz | 26.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cvdnet_pipeline-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 52.9 kB
Release files / cvdnet_pipeline-0.1.0.tar.gz
| Download URL | cvdnet_pipeline-0.1.0.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3c8f2d3025cdcd082b199d82cc72eb846ecc91aea06958d165d31874d28397d6
|
|
BLAKE2b-256 checksum How to use checksums |
0d8e238d9eeee9b01a62fb7a493d893a7203bd4621d5a2052b09650a304b9c8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2025.
Transparency logRelease files / cvdnet_pipeline-0.1.0-py3-none-any.whl
| Download URL | cvdnet_pipeline-0.1.0-py3-none-any.whl |
|---|---|
| Size | 26.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc7c6a6a23fe1c24dbab4f21b1f2de2a2df05bf086365d56e63d010871558089
|
|
BLAKE2b-256 checksum How to use checksums |
229b8c38bfa2eecf1ba739679555ba72e8ed98cd5871a194635032085ac43045
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2025.
Transparency log