Skip to content

Commit

Permalink
Merge pull request #316 from epiforecasts/fix-gh-pages
Browse files Browse the repository at this point in the history
Improve gh pages and rendering of Vignettes
  • Loading branch information
nikosbosse authored Jul 28, 2023
2 parents 20f459c + 8605b17 commit b709010
Show file tree
Hide file tree
Showing 9 changed files with 70 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ jobs:

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
uses: JamesIves/github-pages-deploy-action@v4
with:
clean: false
branch: gh-pages
folder: docs
51 changes: 51 additions & 0 deletions .github/workflows/render_readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Name of the workflow
name: render-readme

# Controls when the action will run. Triggers include:
#
# - button trigger from github action page
# - on changes to readme.Rmd

on:
workflow_dispatch:
push:
paths:
- 'README.Rmd'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
render-readme:
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repos
uses: actions/checkout@v3

- name: Setup R
uses: r-lib/actions/setup-r@v2

- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, local::.

- name: Compile the readme
run: |
rmarkdown::render("README.Rmd")
shell: Rscript {0}

- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add README.md
git diff-index --quiet HEAD || git commit -m "Automatic readme update"
git status -sb | grep -q ahead && git push origin
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: scoringutils
Title: Utilities for Scoring and Assessing Predictions
Version: 1.2.0
Version: 1.2.1
Language: en-GB
Authors@R: c(
person(given = "Nikos",
Expand Down
9 changes: 9 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# scoringutils 1.2.1

## Package updates
- This minor update fixes a few issues related to gh actions and the vignettes displayed at epiforecasts.io/scoringutils. It
- gets rid of the preferably package in _pkgdown.yml. The theme had a toggle between light and dark theme that didn't work properly
- updates the gh pages deploy action to v4 and also cleans up files when triggered
- introduces a gh action to automatically render the Readme from Readme.Rmd
- removes links to vignettes that have been renamed

# scoringutils 1.2.0

This major release contains a range of new features and bug fixes that have been introduced in minor releases since `1.1.0`. The most important changes are:
Expand Down
2 changes: 1 addition & 1 deletion R/score.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' contributing a pull request.
#'
#' For additional help and examples, check out the [Getting Started
#' Vignette](https://epiforecasts.io/scoringutils/articles/getting-started.html)
#' Vignette](https://epiforecasts.io/scoringutils/articles/scoringutils.html)
#' as well as the paper [Evaluating Forecasts with scoringutils in
#' R](https://arxiv.org/abs/2205.07090).
#'
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ library(knitr)

The `scoringutils` package provides a collection of metrics and proper scoring rules and aims to make it simple to score probabilistic forecasts against the true observed values.

You can find additional information and examples in the papers [Evaluating Forecasts with scoringutils in R](https://arxiv.org/abs/2205.07090) [Scoring epidemiological forecasts on transformed scales](https://www.medrxiv.org/content/10.1101/2023.01.23.23284722v1) as well as the Vignettes ([Getting started](https://epiforecasts.io/scoringutils/articles/getting-started.html), [Details on the metrics implemented](https://epiforecasts.io/scoringutils/articles/metric-details.html) and [Scoring forecasts directly](https://epiforecasts.io/scoringutils/articles/scoring-forecasts-directly.html)).
You can find additional information and examples in the papers [Evaluating Forecasts with scoringutils in R](https://arxiv.org/abs/2205.07090) [Scoring epidemiological forecasts on transformed scales](https://www.medrxiv.org/content/10.1101/2023.01.23.23284722v1) as well as the Vignettes ([Getting started](https://epiforecasts.io/scoringutils/articles/scoringutils.html), [Details on the metrics implemented](https://epiforecasts.io/scoringutils/articles/metric-details.html) and [Scoring forecasts directly](https://epiforecasts.io/scoringutils/articles/scoring-forecasts-directly.html)).

The `scoringutils` package offers convenient automated forecast evaluation through the function `score()`. The function operates on data.frames (it uses `data.table` internally for speed and efficiency) and can easily be integrated in a workflow based on `dplyr` or `data.table`. It also provides experienced users with a set of reliable lower-level scoring metrics operating on vectors/matrices they can build upon in other applications. In addition it implements a wide range of flexible plots designed to cover many use cases.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ R](https://arxiv.org/abs/2205.07090) [Scoring epidemiological forecasts
on transformed
scales](https://www.medrxiv.org/content/10.1101/2023.01.23.23284722v1)
as well as the Vignettes ([Getting
started](https://epiforecasts.io/scoringutils/articles/getting-started.html),
started](https://epiforecasts.io/scoringutils/articles/scoringutils.html),
[Details on the metrics
implemented](https://epiforecasts.io/scoringutils/articles/metric-details.html)
and [Scoring forecasts
Expand Down Expand Up @@ -186,8 +186,8 @@ example_quantile %>%
#> 5: epiforecasts-EpiNow2 Cases log 6.005778e-01 0.1066329
#> 6: epiforecasts-EpiNow2 Cases natural 1.443844e+04 5664.3779484
#> underprediction overprediction coverage_deviation bias ae_median
#> 1: 3.521964e-01 0.3804607 -0.10940217 0.09726563 1.185905e+00
#> 2: 1.028497e+04 7702.9836957 -0.10940217 0.09726563 3.208048e+04
#> 1: 3.521964e-01 0.3804607 -0.10940217 0.09726562 1.185905e+00
#> 2: 1.028497e+04 7702.9836957 -0.10940217 0.09726562 3.208048e+04
#> 3: 1.356563e-01 0.3132561 -0.09785326 -0.05640625 7.410484e-01
#> 4: 4.237177e+03 3650.0047554 -0.09785326 -0.05640625 1.770795e+04
#> 5: 1.858699e-01 0.3080750 -0.06660326 -0.07890625 7.656591e-01
Expand Down
5 changes: 2 additions & 3 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
url: https://epiforecasts.io/scoringutils/
template:
bootstrap: 5
package: preferably
params:
toggle: manual
bslib:
font_weight_base : 300
twitter:
creator: "@nikosbosse"
card: summary_large_image
Expand Down
2 changes: 1 addition & 1 deletion man/score.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b709010

Please sign in to comment.