Skip to content

Commit

Permalink
fixed try-catch error + update makevars etc
Browse files Browse the repository at this point in the history
  • Loading branch information
borishejblum committed Jan 12, 2024
1 parent b67da56 commit 1204bf7
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 27 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Workflow derived from https://github.com/r-lib/actions/tree/master/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branches: [main, master, CRANrelease]
pull_request:
branches: [main, master]
branches: [main, master, CRANrelease]

name: R-CMD-check

Expand All @@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
Expand All @@ -29,18 +29,21 @@ jobs:
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v1
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: NPflow
Type: Package
Title: Bayesian Nonparametrics for Automatic Gating of Flow-Cytometry Data
Version: 0.13.3
Date: 2020-02-06
Version: 0.13.4
Date: 2023-01-12
Authors@R: c(person(c("Boris", "P"), "Hejblum", role = c("aut", "cre"),
email = "[email protected]"),
person("Chariff", "Alkhassim", role = c("aut"),
Expand Down Expand Up @@ -37,4 +37,4 @@ Description: Dirichlet process mixture of multivariate normal, skew normal or sk
License: LGPL-3 | file LICENSE
BugReports: https://github.com/borishejblum/NPflow/issues
Encoding: UTF-8
RoxygenNote: 7.1.1
RoxygenNote: 7.3.0
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# News about the `NPflow` R package

### Main changes in Version 0.13.4 (2023-02-12) --- *this is only a minor release*:
* bug fixed in try-catch syntax

### Main changes in Version 0.13.3 (2020-02-06) --- *this is only a minor release*:
* bug fixed in documentation and compiling standards

Expand Down
7 changes: 3 additions & 4 deletions R/NPflow-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#'\tabular{ll}{
#'Package: \tab NPflow\cr
#'Type: \tab Package\cr
#'Version: \tab 0.13.3\cr
#'Date: \tab 2020-02-06\cr
#'Version: \tab 0.13.4\cr
#'Date: \tab 2023-01-12\cr
#'License:\tab \href{http://www.gnu.org/licenses/lgpl.txt}{LGPL-3}\cr
#'}
#'The main function in this package is \code{\link{DPMpost}}.
Expand All @@ -22,11 +22,10 @@
#'13(1): 638-660. <doi: 10.1214/18-AOAS1209> <arXiv: 1702.04407>
#'\url{https://arxiv.org/abs/1702.04407} \url{https://doi.org/10.1214/18-AOAS1209}
#'
#'@docType package
#'@name NPflow-package
#'@aliases NPflow
#'
#'@useDynLib NPflow, .registration = TRUE
#'@importFrom Rcpp evalCpp
#'
NULL
"_PACKAGE"
2 changes: 1 addition & 1 deletion R/plot_DPM.R
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ plot_DPM <- function(z, U_mu=NULL, U_Sigma=NULL, m, c, i, alpha="?", U_SS=NULL,
message("unable to display 2D densities because 1 cluster has only 1 observation")
upper_type <- GGally::wrap("points", alpha=0.1, size=0.2)
}
p <- GGally::ggpairs(data = rpairplotdata, mapping = aes(color=Cluster),
p <- GGally::ggpairs(data = rpairplotdata, mapping = aes_string(color="Cluster"),
title = paste(n, " obs.",
"\niteration ", i, ": ",
length(fullCl)," clusters",
Expand Down
2 changes: 1 addition & 1 deletion R/update_SSst.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ update_SSst <- function(z, S, ltn, scale, df, hyperprior=NULL){

X <- matrix(c(sc_sr, sc_sr*ltn), ncol=2, byrow=FALSE)
B <- try(solve(crossprod(X) + B0inv))
if(class(B)=="try-error"){
if(inherits(B, "try-error")){
# browser()
stop("error in inverting B")
}
Expand Down
4 changes: 2 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# This is an update of the NPflow package

## Test environments
* local R installation, R 4.1.2 on macOS 12.2.1
* local R installation, R 4.3.2 on macOS 13.5.2
* Linux (Ubuntu 20.04), macOS (11.6) and Windows (Server 2019 10.0), R devel and release (through GitHub Actions)

## R CMD check results
0 errors | 0 warnings | 0 note

On some architectures, the large volume of compiled file may trigger a note.
These compiled functions are necessary to ensure reasonnable computation time
These compiled functions are necessary to ensure reasonable computation time
for NPflow.

## Reverse dependencies
Expand Down
11 changes: 9 additions & 2 deletions man/NPflow-package.Rd

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

9 changes: 7 additions & 2 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (where available)
##
## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider
Expand All @@ -8,7 +8,12 @@
##
## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP
## support within Armadillo prefers / requires it
CXX_STD = CXX11
##
## R 4.0.0 made C++11 the default, R 4.1.0 switched to C++14, R 4.3.0 to C++17
## _In general_ we should no longer need to set a standard as any recent R
## installation will do the right thing. Should you need it, uncomment it and
## set the appropriate value, possibly CXX17.
#CXX_STD = CXX11

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
9 changes: 7 additions & 2 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

## With R 3.1.0 or later, you can uncomment the following line to tell R to
## With R 3.1.0 or later, you can uncomment the following line to tell R to
## enable compilation with C++11 (where available)
##
## Also, OpenMP support in Armadillo prefers C++11 support. However, for wider
Expand All @@ -8,7 +8,12 @@
##
## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP
## support within Armadillo prefers / requires it
CXX_STD = CXX11
##
## R 4.0.0 made C++11 the default, R 4.1.0 switched to C++14, R 4.3.0 to C++17
## _In general_ we should no longer need to set a standard as any recent R
## installation will do the right thing. Should you need it, uncomment it and
## set the appropriate value, possibly CXX17.
#CXX_STD = CXX11

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
5 changes: 5 additions & 0 deletions src/RcppExports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

using namespace Rcpp;

#ifdef RCPP_USE_GLOBAL_ROSTREAM
Rcpp::Rostream<true>& Rcpp::Rcout = Rcpp::Rcpp_cout_get();
Rcpp::Rostream<false>& Rcpp::Rcerr = Rcpp::Rcpp_cerr_get();
#endif

// FmeasureC
double FmeasureC(const NumericVector& pred, const NumericVector& ref);
RcppExport SEXP _NPflow_FmeasureC(SEXP predSEXP, SEXP refSEXP) {
Expand Down

0 comments on commit 1204bf7

Please sign in to comment.