Skip to content

GenerateBaseline

GenerateBaseline #11

Workflow file for this run

name: GenerateBaseline
on:
workflow_dispatch:
workflow_run:
workflows: [ForecastUpload]
types:
- completed
jobs:
baseline_job:
if: ${{ github.event.workflow_run.conclusion == 'success' && github.repository_owner == 'european-modelling-hubs' }}
outputs:
changed_files: ${{ steps.compute_baseline.outputs.baseline_file }}
runs-on: ubuntu-latest
steps:
# Checkout the python tools repo
# -------------------------------------------
- name: checkout python tools repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'european-modelling-hubs/hub-tools'
ref: 'main'
path: './tools/'
# Checkout the data repository
# -------------------------------------------
- name: checkout data repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'european-modelling-hubs/flu-forecast-hub'
ref: 'main'
path: './repo/'
# Run Pyton code
# -------------------------
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: pip install pandas==1.2.5 numpy==1.22.4
- name: compute baseline
id: compute_baseline
run: |
python ./tools/code/quantile_baseline.py --hub_path ./repo --target_name "ILI incidence" --filename "ILI_incidence" --symmetrize True --nsamples 10000 --horizon 4 --team_abbr "respicast" --model_abbr "quantileBaseline" --submission_end_weekday 2
- name: Commit data repo changes
uses: EndBug/add-and-commit@v7
with:
cwd: './repo'
message: "Update data storage"
default_author: github_actions
push: true
call-persisting-wf:
needs: baseline_job
uses: european-modelling-hubs/flu-forecast-hub/.github/workflows/persist_changes.yml@main
with:
changes-list: ${{ needs.baseline_job.outputs.changed_files }}
secrets:
envPAT: ${{ secrets.GITHUB_TOKEN }}
# # Save changes to artifact for later persisting
# - name: Save changes to artifact
# env:
# changed_files: ${{ steps.compute_baseline.outputs.baseline_file }}
# run: |
# echo "{ \"pr-changes\" : \"$changed_files\" }" > pr_changes.json
# - name: Upload changes
# uses: actions/upload-artifact@v2
# with:
# name: pr_changes
# path: ./pr_changes.json