Skip to content

Commit

Permalink
Merge pull request #6 from weberse2/main
Browse files Browse the repository at this point in the history
release 1.6-6 as on CRAN
  • Loading branch information
weberse2 authored Mar 3, 2023
2 parents 8301e9d + 1bb60a0 commit 97287ff
Show file tree
Hide file tree
Showing 28 changed files with 156 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ src/stan_files/.*\.hpp$
^man/package-doc$
^src/package-binary$
^Makefile$
^\.github$
^LICENSE$
1 change: 1 addition & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ name: pkgdown

jobs:
pkgdown:
if: github.repository_owner == 'Novartis'
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
Expand Down
11 changes: 5 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Description: Tool-set to support Bayesian evidence synthesis. This
for details on applying this package while Neuenschwander et al. (2010)
<doi:10.1177/1740774509356002> and Schmidli et al. (2014)
<doi:10.1111/biom.12242> explain details on the methodology.
Version: 1.6-5
Date: 2023-01-23
Version: 1.6-6
Date: 2023-03-03
Authors@R: c(person("Novartis", "Pharma AG", role = "cph")
,person("Sebastian", "Weber", email="[email protected]", role=c("aut", "cre"))
,person("Beat", "Neuenschwander", email="[email protected]", role="ctb")
Expand Down Expand Up @@ -49,6 +49,7 @@ LazyData: true
Biarch: true
NeedsCompilation: yes
UseLTO: true
URL: https://opensource.nibr.com/RBesT/
BugReports: https://github.com/Novartis/RBesT/issues
Suggests:
rmarkdown,
Expand All @@ -63,8 +64,6 @@ Suggests:
tidyr,
parallel
VignetteBuilder: knitr
SystemRequirements: GNU make, pandoc (>= 1.12.3), pandoc-citeproc
SystemRequirements: GNU make, pandoc (>= 1.12.3), pandoc-citeproc, C++17
Encoding: UTF-8
RoxygenNote: 7.1.1
ReleaseSHA1: 23ae246
URL: http://opensource.nibr.com/RBesT/
RoxygenNote: 7.2.3
64 changes: 40 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SRCDIR = ./demo ./inst/stan ./inst/stan/include ./man-roxygen
OUTDIR_ABS=$(abspath $(OUTDIR))
PROJROOT_ABS=$(abspath .)

RPKG=$(patsubst%’, %, $(word 2, $(shell grep ^Package: DESCRIPTION)))
INCS =
R_PKG_SRCS = $(wildcard R/*.R)
R_SRCS = $(wildcard *.R $(foreach fd, $(SRCDIR), $(fd)/*.R))
Expand All @@ -19,7 +20,7 @@ STAN_SRCS = $(wildcard *.stan $(foreach fd, $(SRCDIR), $(fd)/*.stan))
SRCS = $(R_PKG_SRCS) $(R_SRCS) $(RMD_SRCS) $(STAN_SRCS)
NODIR_SRC = $(notdir $(SRCS))
BIN_OBJS = src/package-binary R/sysdata.rda
DOC_OBJS = man/package-doc inst/doc/RBesT.pdf
DOC_OBJS = man/package-doc inst/doc/$(RPKG).pdf

R_HOME ?= $(shell R RHOME)
PKG_VERSION ?= $(patsubst%’, %, $(word 2, $(shell grep ^Version DESCRIPTION)))
Expand All @@ -43,13 +44,22 @@ all : $(TARGET)
cd $(@D); echo running R -q -e "rmarkdown::render('$(<F)', output_format=rmarkdown::html_document(self_contained=TRUE))"
cd $(@D); R -q -e "rmarkdown::render('$(<F)', output_format=rmarkdown::html_document(self_contained=TRUE))"

src/package-binary: $(STAN_SRCS)
R/stanmodels.R:
## ensure that NAMESPACE contains load directive
echo "# Generated by roxygen2: do not edit by hand" > NAMESPACE
echo "import(Rcpp)" >> NAMESPACE
echo "import(methods)" >> NAMESPACE
echo "importFrom(rstan, sampling)" >> NAMESPACE
echo "useDynLib(RBesT, .registration = TRUE)" >> NAMESPACE
echo "useDynLib($(RPKG), .registration = TRUE)" >> NAMESPACE
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"

src/package-binary: $(STAN_SRCS) R/stanmodels.R
## ensure that NAMESPACE contains load directive
echo "# Generated by roxygen2: do not edit by hand" > NAMESPACE
echo "import(Rcpp)" >> NAMESPACE
echo "import(methods)" >> NAMESPACE
echo "importFrom(rstan, sampling)" >> NAMESPACE
echo "useDynLib($(RPKG), .registration = TRUE)" >> NAMESPACE
"${R_HOME}/bin/R" --slave -e 'library(pkgbuild); pkgbuild::compile_dll()'
touch src/package-binary

Expand All @@ -64,10 +74,10 @@ inst/sbc/calibration.rds :
R/sysdata.rda: inst/sbc/calibration.rds
"${R_HOME}/bin/R" --slave --file=tools/make-ds.R

inst/doc/RBesT.pdf : man/package-doc
inst/doc/$(RPKG).pdf : man/package-doc
install -d inst/doc
"${R_HOME}/bin/R" CMD Rd2pdf --batch --no-preview --force --output=inst/doc/RBesT.pdf .
"${R_HOME}/bin/R" --vanilla --slave -e 'library(tools); tools::compactPDF("inst/doc/RBesT.pdf")'
"${R_HOME}/bin/R" CMD Rd2pdf --batch --no-preview --force --output=inst/doc/$(RPKG).pdf .
"${R_HOME}/bin/R" --vanilla --slave -e 'library(tools); tools::compactPDF("inst/doc/$(RPKG).pdf")'


NAMESPACE: man/package-doc
Expand All @@ -79,27 +89,27 @@ $(TARGET): build/r-source
build/r-source : $(BIN_OBJS) $(DOC_OBJS) $(SRCS)
install -d build
cd build; "${R_HOME}/bin/R" CMD build .. --no-build-vignettes --no-manual
cd build; mv RBesT_$(PKG_VERSION).tar.gz RBesT-source.tar.gz
cd build; mv $(RPKG)_$(PKG_VERSION).tar.gz $(RPKG)-source.tar.gz
touch build/r-source-fast

build/r-source-release : $(BIN_OBJS) $(DOC_OBJS) $(SRCS) inst/sbc/sbc_report.html
install -d build
git archive --format=tar.gz --prefix RBesT-$(GIT_TAG)/ HEAD > build/RBesT-$(GIT_TAG).tar.gz
rm -rf build/RBesT-$(GIT_TAG)
cd build; tar xf RBesT-$(GIT_TAG).tar.gz
cp -v NAMESPACE build/RBesT-$(GIT_TAG)
install -d build/RBesT-$(GIT_TAG)/inst/doc
cp -v inst/doc/RBesT.pdf build/RBesT-$(GIT_TAG)/inst/doc
cp -v inst/sbc/sbc_report.html build/RBesT-$(GIT_TAG)/inst/sbc/sbc_report.html
cd build/RBesT-$(GIT_TAG); "${R_HOME}/bin/R" --slave --file=tools/make-ds.R
install -d build/RBesT-$(GIT_TAG)/man
cp -v man/*.Rd build/RBesT-$(GIT_TAG)/man
git archive --format=tar.gz --prefix $(RPKG)-$(GIT_TAG)/ HEAD > build/$(RPKG)-$(GIT_TAG).tar.gz
rm -rf build/$(RPKG)-$(GIT_TAG)
cd build; tar xf $(RPKG)-$(GIT_TAG).tar.gz
cp -v NAMESPACE build/$(RPKG)-$(GIT_TAG)
install -d build/$(RPKG)-$(GIT_TAG)/inst/doc
cp -v inst/doc/$(RPKG).pdf build/$(RPKG)-$(GIT_TAG)/inst/doc
cp -v inst/sbc/sbc_report.html build/$(RPKG)-$(GIT_TAG)/inst/sbc/sbc_report.html
cd build/$(RPKG)-$(GIT_TAG); "${R_HOME}/bin/R" --slave --file=tools/make-ds.R
install -d build/$(RPKG)-$(GIT_TAG)/man
cp -v man/*.Rd build/$(RPKG)-$(GIT_TAG)/man
# set NOT_CRAN=true to get vignettes render with full sampling
cd build; NOT_CRAN=true "${R_HOME}/bin/R" CMD build RBesT-$(GIT_TAG)
#cd build; NOT_CRAN=false "${R_HOME}/bin/R" CMD build RBesT-$(GIT_TAG) --no-build-vignettes --no-manual
rm -rf build/RBesT-$(GIT_TAG)
cd build; $(MD5) RBesT-$(GIT_TAG).tar.gz > RBesT-$(GIT_TAG).md5
cd build; $(MD5) RBesT_$(PKG_VERSION).tar.gz > RBesT_$(PKG_VERSION).md5
cd build; NOT_CRAN=true "${R_HOME}/bin/R" CMD build $(RPKG)-$(GIT_TAG)
#cd build; NOT_CRAN=false "${R_HOME}/bin/R" CMD build $(RPKG)-$(GIT_TAG) --no-build-vignettes --no-manual
rm -rf build/$(RPKG)-$(GIT_TAG)
cd build; $(MD5) $(RPKG)-$(GIT_TAG).tar.gz > $(RPKG)-$(GIT_TAG).md5
cd build; $(MD5) $(RPKG)_$(PKG_VERSION).tar.gz > $(RPKG)_$(PKG_VERSION).md5
touch build/r-source-release

PHONY += r-source-release
Expand All @@ -108,6 +118,9 @@ r-source-release : build/r-source-release
PHONY += binary
binary : NAMESPACE src/package-binary

PHONY += derived
derived : NAMESPACE $(BIN_OBJS) $(DOC_OBJS)

#$(DIR_OBJ)/%.o: %.c $(INCS)
# mkdir -p $(@D)
# $(CC) -o $@ $(CFLAGS) -c $< $(INC_DIRS)
Expand All @@ -117,12 +130,15 @@ clean:
rm -rf build/*
rm -f man/*.Rd
rm -f NAMESPACE
rm -f inst/doc/RBesT.pdf
rm -f src/RBesT.so
rm -f inst/doc/$(RPKG).pdf
rm -f src/$(RPKG).so
rm -f src/*.o
rm -f man/package-doc
rm -f src/package-binary
rm -f R/sysdata.rda
rm -f demo/*.html
rm -f vignettes/*.html
rm -f vignettes/*.docx
rm -rf .Rd2pdf*

PHONY += doc
Expand Down
16 changes: 15 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# RBesT 1.6-5 - January 23rd, 2023
# RBesT 1.6-6 - March 3rd, 2023

## Bug fixes

* ensure C++17 compatiblity per CRAN (triggers an issue with
clang 16)
* fix links in README.md to now link to new public pkgdown web-site

# RBesT 1.6-5 - February 8th, 2023

## Enhancements

* upon package load `RBesT` will now report the date of the release
and the respective git commit hash used to create the sources of the
package.

## Bug fixes

Expand Down
2 changes: 2 additions & 0 deletions R/predict_gMAP.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#'
#' @seealso \code{\link{gMAP}}, \code{\link{predict.glm}}
#'
#' @template example-start
#' @examples
#' # create a fake data set with a covariate
#' trans_cov <- transform(transplant, country=cut(1:11, c(0,5,8,Inf), c("CH", "US", "DE")))
Expand Down Expand Up @@ -57,6 +58,7 @@
#' pred_new <- predict(map, data.frame(country="CH", study=12))
#' pred_new
#'
#' @template example-stop
#' @rdname predict.gMAP
#' @method predict gMAP
#' @export
Expand Down
Binary file modified R/sysdata.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

.onAttach <- function(...) {
ver <- utils::packageVersion("RBesT")
packageStartupMessage("This is RBesT version ", ver)
packageStartupMessage("This is RBesT version ", ver, " (released ", format(pkg_create_date, "%F"), ", git-sha ", pkg_sha, ")")
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ methodology.
## Getting Started

To get a quick overview over the package functionality, please refer
to the introductory [vignettes](articles/index.html). We recommend
to the introductory [vignettes](https://opensource.nibr.com/RBesT/articles/index.html). We recommend
starting with the [Getting started with `RBesT`
(binary)](articles/introduction.html) vignette as a first read.
(binary)](https://opensource.nibr.com/RBesT/articles/introduction.html) vignette as a first read.

2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
url: http://opensource.nibr.com/RBesT/
url: https://opensource.nibr.com/RBesT/
template:
bootstrap: 5

13 changes: 12 additions & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Generated by rstantools. Do not edit by hand.

#! /bin/sh
"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()" -e 'writeLines(sub("CXX14$", "CXX17", readLines("src/Makevars")), "src/Makevars")' -e 'writeLines(sub("CXX14$", "CXX17", readLines("src/Makevars.win")), "src/Makevars.win")'
#"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()"

"${R_HOME}/bin/Rscript" -e "rstantools::rstan_config()" \
-e 'mv <- readLines("src/Makevars")' \
-e 'con <- file("src/Makevars", "wb")' \
-e 'writeLines(c(sub("^CXX_STD = CXX14$", "CXX_STD = CXX17", mv), "PKG_CPPFLAGS += -D_HAS_AUTO_PTR_ETC=0"), con=con, useBytes=TRUE)' \
-e 'close(con)' \
-e 'mv_win <- readLines("src/Makevars.win")' \
-e 'con_win <- file("src/Makevars.win", "wb")' \
-e 'writeLines(c(sub("^CXX_STD = CXX14$", "CXX_STD17 = CXX17", mv_win), "PKG_CPPFLAGS += -D_HAS_AUTO_PTR_ETC=0"), con=con_win, useBytes=TRUE)' \
-e 'close(con_win)'


12 changes: 11 additions & 1 deletion configure.win
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# Generated by rstantools. Do not edit by hand.

#! /bin/sh
"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "rstantools::rstan_config()" -e 'writeLines(sub("CXX14$", "CXX17", readLines("src/Makevars")), "src/Makevars")' -e 'writeLines(sub("CXX14$", "CXX17", readLines("src/Makevars.win")), "src/Makevars.win")'
#"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "rstantools::rstan_config()"

"${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "rstantools::rstan_config()" \
-e 'mv <- readLines("src/Makevars")' \
-e 'con <- file("src/Makevars", "wb")' \
-e 'writeLines(c(sub("^CXX_STD = CXX14$", "CXX_STD = CXX17", mv), "PKG_CPPFLAGS += -D_HAS_AUTO_PTR_ETC=0"), con=con, useBytes=TRUE)' \
-e 'close(con)' \
-e 'mv_win <- readLines("src/Makevars.win")' \
-e 'con_win <- file("src/Makevars.win", "wb")' \
-e 'writeLines(c(sub("^CXX_STD = CXX14$", "CXX_STD = CXX17", mv_win), "PKG_CPPFLAGS += -D_HAS_AUTO_PTR_ETC=0"), con=con, useBytes=TRUE)' \
-e 'close(con_win)'
4 changes: 2 additions & 2 deletions man/decision1S.Rd

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

8 changes: 4 additions & 4 deletions man/decision1S_boundary.Rd

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

4 changes: 2 additions & 2 deletions man/decision2S.Rd

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

8 changes: 4 additions & 4 deletions man/decision2S_boundary.Rd

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

8 changes: 4 additions & 4 deletions man/ess.Rd

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

Loading

0 comments on commit 97287ff

Please sign in to comment.