Skip to content

Commit

Permalink
Merge branch 'release/v0.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmphillippo committed Jun 11, 2024
2 parents 5a5ee91 + ca2ac01 commit 452dbd1
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 10 deletions.
95 changes: 95 additions & 0 deletions .github/workflows/rhub.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# R-hub's generic GitHub Actions workflow file. It's canonical location is at
# /~https://github.com/r-hub/actions/blob/v1/workflows/rhub.yaml
# You can update this file to a newer version using the rhub2 package:
#
# rhub::rhub_setup()
#
# It is unlikely that you need to modify this file manually.

name: R-hub
run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}"

on:
workflow_dispatch:
inputs:
config:
description: 'A comma separated list of R-hub platforms to use.'
type: string
default: 'linux,windows,macos'
name:
description: 'Run name. You can leave this empty now.'
type: string
id:
description: 'Unique ID. You can leave this empty now.'
type: string

jobs:

setup:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.rhub-setup.outputs.containers }}
platforms: ${{ steps.rhub-setup.outputs.platforms }}

steps:
# NO NEED TO CHECKOUT HERE
- uses: r-hub/actions/setup@v1
with:
config: ${{ github.event.inputs.config }}
id: rhub-setup

linux-containers:
needs: setup
if: ${{ needs.setup.outputs.containers != '[]' }}
runs-on: ubuntu-latest
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.containers) }}
container:
image: ${{ matrix.config.container }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/run-check@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}

other-platforms:
needs: setup
if: ${{ needs.setup.outputs.platforms != '[]' }}
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.label }}
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.setup.outputs.platforms) }}

steps:
- uses: r-hub/actions/checkout@v1
- uses: r-hub/actions/setup-r@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/platform-info@v1
with:
token: ${{ secrets.RHUB_TOKEN }}
job-config: ${{ matrix.config.job-config }}
- uses: r-hub/actions/setup-deps@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
- uses: r-hub/actions/run-check@v1
with:
job-config: ${{ matrix.config.job-config }}
token: ${{ secrets.RHUB_TOKEN }}
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ message: 'To cite package "multinma" in publications use:'
type: software
license: GPL-3.0-only
title: 'multinma: Bayesian Network Meta-Analysis of Individual and Aggregate Data'
version: 0.7.0
version: 0.7.1
doi: 10.5281/zenodo.3904454
abstract: Network meta-analysis and network meta-regression models for aggregate data,
individual patient data, and mixtures of both individual and aggregate data using
Expand All @@ -28,7 +28,7 @@ preferred-citation:
email: david.phillippo@bristol.ac.uk
orcid: https://orcid.org/0000-0003-2672-7841
year: '2023'
notes: R package version 0.7.0
notes: R package version 0.7.1
url: https://dmphillippo.github.io/multinma/
doi: 10.5281/zenodo.3904454
repository: https://CRAN.R-project.org/package=multinma
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: multinma
Title: Bayesian Network Meta-Analysis of Individual and Aggregate Data
Version: 0.7.0
Version: 0.7.1
Authors@R:
person(given = c("David", "M."),
family = "Phillippo",
Expand Down Expand Up @@ -51,7 +51,7 @@ LinkingTo:
RcppEigen (>= 0.3.3.3.0),
RcppParallel (>= 5.0.1),
rstan (>= 2.26.0),
StanHeaders (>= 2.26.0)
StanHeaders (>= 2.32.9)
SystemRequirements: GNU make
RoxygenNote: 7.3.1
Roxygen: list(markdown = TRUE)
Expand Down
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# multinma 0.7.1

* Fix: Producing survival/hazard/cumulative hazard predictions for survival
models with `predict()` outside of a `plot()` call no longer gives an error
(#40).
* Fix: Increased StanHeaders version requirement to version 2.32.9 or later, to
avoid CRAN sanitizer warnings (caused by stan-dev/rstan#1111).

# multinma 0.7.0

* Feature: The new `marginal_effects()` function produces marginal treatment
Expand Down
11 changes: 7 additions & 4 deletions R/predict.R
Original file line number Diff line number Diff line change
Expand Up @@ -1663,7 +1663,9 @@ predict.stan_nma <- function(object, ...,
if (packageVersion("dplyr") > "1.1.0") {
pd_undups <- dplyr::filter(preddat, .data$.study == studies[s], .data$.trt == treatments[trt]) %>%
dplyr::distinct(dplyr::pick(dplyr::all_of(collapse_by))) %>%
dplyr::mutate(.dup_id = 1:dplyr::n())
dplyr::mutate(.dup_id = seq_len(dplyr::n()))

if (nrow(pd_undups) == 0) next

pd_col <- dplyr::filter(preddat, .data$.study == studies[s], .data$.trt == treatments[trt]) %>%
dplyr::left_join(pd_undups, by = collapse_by) %>%
Expand All @@ -1673,7 +1675,9 @@ predict.stan_nma <- function(object, ...,
} else {
pd_undups <- dplyr::filter(preddat, .data$.study == studies[s], .data$.trt == treatments[trt]) %>%
dplyr::distinct(dplyr::across(dplyr::all_of(collapse_by))) %>%
dplyr::mutate(.dup_id = 1:dplyr::n())
dplyr::mutate(.dup_id = seq_len(dplyr::n()))

if (nrow(pd_undups) == 0) next

pd_col <- dplyr::filter(preddat, .data$.study == studies[s], .data$.trt == treatments[trt]) %>%
dplyr::left_join(pd_undups, by = collapse_by) %>%
Expand Down Expand Up @@ -2054,8 +2058,7 @@ predict.stan_nma_surv <- function(object, times = NULL,

# Set times_seq by default if called within plot()
if (is.null(times_seq) && type %in% c("survival", "hazard", "cumhaz") &&
(deparse(sys.call(-2)[[1]]) == "plot" ||
deparse(sys.call(-3)[[1]]) == "marginal_effects" && deparse(sys.call(-4)[[1]]) == "plot"))
"plot" %in% unlist(lapply(sys.calls(), function(x) deparse(x[[1]]))))
times_seq <- 50

# Other checks (including times, aux) in predict.stan_nma()
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ papers:
The `multinma` package can be cited as follows:

> Phillippo, D. M. (2024). *multinma: Bayesian Network Meta-Analysis of
> Individual and Aggregate Data*. R package version 0.7.0, doi:
> Individual and Aggregate Data*. R package version 0.7.1, doi:
> [10.5281/zenodo.3904454](https://doi.org/10.5281/zenodo.3904454).
When fitting ML-NMR models, please cite the methods paper:
Expand Down
8 changes: 7 additions & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
This release adds new features and fixes a few bugs.
Require StanHeaders version 2.32.9 or later in LinkingTo, as requested, which
fixes the UBSAN warnings.

Confirmed that this fixes the sanitizer warnings with rocker/r-devel-san and
rhub clang-asan.

## Test environments
* rocker/r-devel-san
* rhub clang-asan
* local R installation (Windows 10), R 4.4.0
* win-builder (release, devel)
* Ubuntu 22.04.4 on GitHub Actions (release, devel, oldrel)
Expand Down

0 comments on commit 452dbd1

Please sign in to comment.