From 774ed5371fbed34fc3723354eb74a89c48c06bd5 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 8 Oct 2021 15:21:19 +0200 Subject: [PATCH 1/3] some fixes to pass cran checks --- .Rbuildignore | 2 ++ DESCRIPTION | 2 +- inst/check.R~ | 52 --------------------------------------------------- 3 files changed, 3 insertions(+), 53 deletions(-) delete mode 100644 inst/check.R~ diff --git a/.Rbuildignore b/.Rbuildignore index b2ffde1..d978c4f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -22,3 +22,5 @@ src/scs/linsys/indirect inst/tools/* Work +# Remove the citation file to pass checks. It is also in inst/CITATION +src/scs/CITATION.cff diff --git a/DESCRIPTION b/DESCRIPTION index b6e6ef9..6b79e3c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: scs -Version: 1.4 +Version: 3.0.0 Title: Splitting Conic Solver Authors@R: c( person("Florian", "Schwendinger", role = c("ctb", "cre"), email = "FlorianSchwendinger@gmx.at"), person("Brendan", "O'Donoghue", role = c("aut", "cph")), diff --git a/inst/check.R~ b/inst/check.R~ deleted file mode 100644 index 550dd2f..0000000 --- a/inst/check.R~ +++ /dev/null @@ -1,52 +0,0 @@ -context("Saved Problems") - -rds_files <- c( - "degenerate1.RDS", - "degenerate2.RDS", - "degenerate3.RDS", - "degenerate4.RDS", - "small_lp.RDS", - "rob_gauss_cov_est1.RDS", - "rob_gauss_cov_est2.RDS", - "hs21_tiny_qp1.RDS", - "hs21_tiny_qp2.RDS", - "qafiro_tiny_qp1.RDS", - "qafiro_tiny_qp2.RDS", - "qafiro_tiny_qp3.RDS", - "infeasible_tiny_qp.RDS", - "unbounded_tiny_qp.RDS", - "random_prob.RDS" -) - -info_vars_to_check <- c( - "iter", - "status", - "statusVal", - "scaleUpdates", - "pobj", - "dobj", - ## "resPri", - ## "resDual", - ## "gap", - "resInfeas", - "resUnbddA", - "resUnbddP", - ## "setupTime", - ## "solveTime", - "scale", - ## "compSlack", - "rejectedAccelSteps", - "acceptedAccelSteps" - ## "linsysTime", - ## "coneTime", - ## "accelTime" -) - -sol_vars_to_check <- c("x", "y", "s") - -fname <- rds_files[8] -d <- readRDS(file.path("../tests/testthat/problem_results", fname)) -sol <- scs(A = d$data$A, P = d$data$P, b = d$data$b, obj = d$data$obj, initial = d$sol, cone = d$cone, control = d$settings) - -expect_equal(sol$info[info_vars_to_check], d$sol$info[info_vars_to_check], tolerance = d$settings$eps_abs) -expect_equal(sol[sol_vars_to_check], d$sol[sol_vars_to_check], tolerance = d$settings$eps_abs) From f4a6f1594535953a2467952f75c716e7722d4543 Mon Sep 17 00:00:00 2001 From: FlorianSchwendinger Date: Fri, 8 Oct 2021 18:20:10 +0200 Subject: [PATCH 2/3] improve .Rbuildignore --- .Rbuildignore | 1 + DESCRIPTION | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index d978c4f..97c305f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ +.git* .gitignore .Rhistory README.html diff --git a/DESCRIPTION b/DESCRIPTION index 6b79e3c..c4bea0f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: scs -Version: 3.0.0 +Version: 3.0-0 Title: Splitting Conic Solver Authors@R: c( person("Florian", "Schwendinger", role = c("ctb", "cre"), email = "FlorianSchwendinger@gmx.at"), person("Brendan", "O'Donoghue", role = c("aut", "cph")), From 6cb6cacf20c29d7e01e9098b32cfbbf1f43c9116 Mon Sep 17 00:00:00 2001 From: Florian Schwendinger Date: Fri, 12 Aug 2022 14:47:12 +0200 Subject: [PATCH 3/3] remove Matrix dependency since Matrix will no longer support necessary functions --- .Rbuildignore | 7 ++++-- DESCRIPTION | 5 ++--- Makefile | 35 ++++++++++++++++++++++++++++++ tests/testthat.R | 1 - tests/testthat/test_problems.R | 2 +- tests/testthat/test_sparse_utils.R | 1 + 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 Makefile diff --git a/.Rbuildignore b/.Rbuildignore index 97c305f..b5f21ca 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,7 +1,8 @@ .git* .gitignore .Rhistory -README.html +^README.html +^Makefile src/build_makevars.R src/Makevars_unix src/Makevars.win_win @@ -21,7 +22,9 @@ src/scs/.travis.yml src/scs/linsys/gpu src/scs/linsys/indirect inst/tools/* -Work + +tests/testthat/test_sparse_utils.R +tests/testthat/test_problems.R # Remove the citation file to pass checks. It is also in inst/CITATION src/scs/CITATION.cff diff --git a/DESCRIPTION b/DESCRIPTION index c4bea0f..1b8fec2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: scs -Version: 3.0-0 +Version: 3.0-1 Title: Splitting Conic Solver Authors@R: c( person("Florian", "Schwendinger", role = c("ctb", "cre"), email = "FlorianSchwendinger@gmx.at"), person("Brendan", "O'Donoghue", role = c("aut", "cph")), @@ -14,10 +14,9 @@ Description: Solves convex cone programs via operator splitting. Can solve: Depends: R (>= 3.5.0) SystemRequirements: GNU Make Suggests: - Matrix, slam, testthat Encoding: UTF-8 License: GPL-3 URL: https://github.com/FlorianSchwendinger/scs -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.0 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5802936 --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ + +docs: + R -e 'library("roxygen2"); roxygenize(".", c("rd", "namespace"), load_source)' + +build: + R CMD build . + +inst: build + R CMD INSTALL scs*.tar.gz + +check: build + R CMD check scs*.tar.gz + +cran_check: build + R CMD check --as-cran scs*.tar.gz + +manual: clean + R CMD Rd2pdf --output=Manual.pdf . + +clean: + rm -f Manual.pdf README.knit.md README.html + rm -rf .Rd2pdf* + +check_mac_m1: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'macos-m1-bigsur-release')" + +check_mac_old: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'macos-highsierra-release-cran')" + +check_gcc_san: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'linux-x86_64-rocker-gcc-san')" + +check_debian_clang: build + R -e "rhub::check(dir(pattern = 'scs_.*.tar.gz'), platform = 'debian-clang-devel')" + diff --git a/tests/testthat.R b/tests/testthat.R index aaff9ce..c06af05 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,5 +1,4 @@ library(testthat) library(scs) library(slam) -library(Matrix) test_check("scs") diff --git a/tests/testthat/test_problems.R b/tests/testthat/test_problems.R index 2517ee3..95b3ce2 100644 --- a/tests/testthat/test_problems.R +++ b/tests/testthat/test_problems.R @@ -45,7 +45,7 @@ info_vars_to_check <- c( sol_vars_to_check <- c("x", "y", "s") for (fname in rds_files) { - d <- readRDS(file.path("problem_results", fname)) + d <- readRDS(file.path("problem_results", fname)) test_that(sprintf("Checking results for %s", fname), { sol <- scs(A = d$data$A, P = d$data$P, b = d$data$b, obj = d$data$obj, cone = d$cone, control = d$settings) if (fname == "random_prob.RDS") { ## Need lenient tolerance diff --git a/tests/testthat/test_sparse_utils.R b/tests/testthat/test_sparse_utils.R index 7f1504c..8408c1d 100644 --- a/tests/testthat/test_sparse_utils.R +++ b/tests/testthat/test_sparse_utils.R @@ -1,4 +1,5 @@ ## Some tests for utils +# Removed this test from the build via .Rbuildignore since Matrix pkg will change. s <- Matrix::sparseMatrix(i = c(2,4,3:5), j= c(4,7:5,5), x = 1:5, dims = c(7,7), symmetric = TRUE)