Skip to content

Fix output naming

Fix output naming #24

Workflow file for this run

name: Algorithm Analysis
on:
push:
branches:
- 'main'
- 'analysis/**'
jobs:
algorithms:
runs-on: ubuntu-latest
outputs: # here we use the outputs from steps, and set outputs for the job `configure`
config: ${{ steps.algorithms.outputs.algorithms }}
steps:
- uses: actions/checkout@v3
- name: Read algorithms
id: algorithms
run: |
echo "algorithms<<EOF" >> $GITHUB_OUTPUT
cat ./tests/IVIMmodels/unit_tests/algorithms.json >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Log algorithms
run: echo "${{fromJson(steps.algorithms.outputs.algorithms)}}"
build:
runs-on: ubuntu-latest
needs: algorithms
continue-on-error: false
strategy:
fail-fast: false
matrix:
algorithm: ${{fromJson(needs.algorithms.outputs.algorithms).algorithms}}
SNR: [10, 30, 50, 100, 200]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate fitting data
run: |
pip install pytest
python -m pytest -m slow --selectAlgorithm ${{ matrix.algorithm }} --saveFileName test_output.csv --SNR ${{ matrix.SNR }} --fitCount 300 --saveDurationFileName test_duration.csv
- name: Upload raw data
uses: actions/upload-artifact@v3
with:
name: RawData/raw_data_${{ matrix.algorithm }}_${{ matrix.SNR }}
path: |
test_output.csv
test_duration.csv
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Merge fitting results
run: |
cat artifacts/raw_data_*/test_output.csv > test_output.csv
- name: Merge timing results
run: |
cat artifacts/raw_data_*/test_duration.csv > test_duration.csv
- name: Upload merged artifacts
uses: actions/upload-artifacts@v3
with:
name: Raw Data
path: |
test_output.csv
test_duration.csv
analyze:
runs-on: ubuntu-latest
needs: merge
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::plyr
any::dplyr
any::tidyverse
any::data.table
any::ggplot2
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: Raw Data
- name: Generate figures
run: Rscript --vanilla tests/IVIMmodels/unit_tests/analyze.r test_output.csv test_duration.csv
- name: Upload figures
uses: actions/upload-artifact@v3
with:
name: Fit Figures
path: |
D.pdf
f.pdf
Dp.pdf
D_limited.pdf
f_limited.pdf
Dp_limited.pdf
durations.pdf
curve_plot.pdf
fitted_curves.pdf