From 9c7ff2a2f2872f9f252e00d0197f8362a8bd596e Mon Sep 17 00:00:00 2001 From: torfason Date: Sun, 27 Aug 2023 09:18:15 +0000 Subject: [PATCH] Bump version and finalize for release --- .Rbuildignore | 1 + DESCRIPTION | 2 +- NEWS.md | 15 ++++++++--- README.md | 2 +- build/build_and_release_process.R | 2 ++ cran-comments.md | 16 ++++++------ inst/WORDLIST | 2 ++ revdep/.gitignore | 7 ++++++ revdep/README.md | 24 ++++++++++++++++++ revdep/cran.md | 7 ++++++ revdep/failures.md | 1 + revdep/problems.md | 1 + tests/testthat/test-zfit_base.R | 41 ++++++++++++++++--------------- 13 files changed, 89 insertions(+), 32 deletions(-) create mode 100644 revdep/.gitignore create mode 100644 revdep/README.md create mode 100644 revdep/cran.md create mode 100644 revdep/failures.md create mode 100644 revdep/problems.md diff --git a/.Rbuildignore b/.Rbuildignore index 67d8380..828b733 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -10,3 +10,4 @@ ^build$ ^_pkgdown\.yml$ ^\.github$ +^revdep$ diff --git a/DESCRIPTION b/DESCRIPTION index cc8691c..a595935 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: zfit Title: Fit Models in a Pipe -Version: 0.3.0.9001 +Version: 0.4.0 Author: Magnus Thor Torfason Maintainer: Magnus Thor Torfason Description: Improve the usage of model fitting functions within a piped diff --git a/NEWS.md b/NEWS.md index d129c73..53460a0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,13 +1,22 @@ +# zfit 0.4.0 + +* New function, `zfold()` creates a reordered wrapper around + any function, which is useful for reordering S3 functions. + +* Various minor fixes to documentation and website. + +* Document "_PACKAGE" rather than NULL to fix recently + discovered issue with roxygen2 package docs. + + # zfit 0.3.0 * Two general-purpose wrapping functions to quickly create custom wrappers for any fitting functions for which a wrapper is not provided. -* No required dependencies. - - + # zfit 0.2.0 * New wrapper for estimating poisson models (through glm), diff --git a/README.md b/README.md index 0cd9a79..e50d5e1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![CRAN status](https://www.r-pkg.org/badges/version/zfit)](https://cran.r-project.org/package=zfit) [![CRAN status -shields](https://img.shields.io/badge/Git-0.3.0.9001-success)](https://github.com/torfason/zmisc) +shields](https://img.shields.io/badge/Git-0.4.0-success)](https://github.com/torfason/zmisc) [![R-CMD-check](https://github.com/torfason/zfit/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/torfason/zfit/actions/workflows/R-CMD-check.yaml) diff --git a/build/build_and_release_process.R b/build/build_and_release_process.R index 7b07a2d..e44a3ec 100644 --- a/build/build_and_release_process.R +++ b/build/build_and_release_process.R @@ -20,9 +20,11 @@ devtools::build_manual() ## Do the final checking steps before release devtools::spell_check() +urlchecker::url_check() devtools::build() devtools::test() devtools::check() +devtools::check(remote = TRUE, manual = TRUE) devtools::release_checks() devtools:::git_checks() diff --git a/cran-comments.md b/cran-comments.md index 94aadd9..19f370c 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -3,17 +3,19 @@ There were no ERRORs or WARNINGs, or NOTEs in local builds -There was one note when using r-hub.io: +There were two notes when using r-hub.io (Windows Server only): + +* checking for non-standard things in the check directory ... NOTE +Found the following files/directories: + ''NULL'' * checking for detritus in the temp directory ... NOTE Found the following files/directories: 'lastMiKTeXException' -This note is not reproducible locally or on win-builder, -and seems not to affect the output, because the check -reports no errors related to the PDF version of the manual: +These notes are not reproducible locally, on other r-hub.io platforms, or on win-builder, and they not to affect the output, because the check reports no errors related to the PDF version of the manual: -#> * checking PDF version of manual ... OK +#> * checking PDF version of manual ... [12s] OK ## Downstream dependencies @@ -22,8 +24,8 @@ There are currently no downstream dependencies for this package ## Release summary -* This is the 0.3.0 release of zfit +* This is the 0.4.0 release of zfit * Package has been checked locally and on r-hub.io -* R CMD check ran without errors, warnings or notes, apart from "lastMiKTeXException" note +* R CMD check ran without errors, warnings or notes, apart from the specific issue noted above diff --git a/inst/WORDLIST b/inst/WORDLIST index 1829a88..4ebd0d4 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -13,6 +13,8 @@ NSE param poisson tibble +roxygen +roxygen2 zfitter zfunction zglm diff --git a/revdep/.gitignore b/revdep/.gitignore new file mode 100644 index 0000000..111ab32 --- /dev/null +++ b/revdep/.gitignore @@ -0,0 +1,7 @@ +checks +library +checks.noindex +library.noindex +cloud.noindex +data.sqlite +*.html diff --git a/revdep/README.md b/revdep/README.md new file mode 100644 index 0000000..5a6288b --- /dev/null +++ b/revdep/README.md @@ -0,0 +1,24 @@ +# Platform + +|field |value | +|:--------|:------------------------------------------| +|version |R version 4.3.1 (2023-06-16) | +|os |macOS Monterey 12.1 | +|system |x86_64, darwin20 | +|ui |RStudio | +|language |(EN) | +|collate |en_US.UTF-8 | +|ctype |en_US.UTF-8 | +|tz |Atlantic/Reykjavik | +|date |2023-08-27 | +|rstudio |2023.06.0+421 Mountain Hydrangea (desktop) | +|pandoc |3.1.6.1 @ /usr/local/bin/ (via rmarkdown) | + +# Dependencies + +|package |old |new |Δ | +|:-------|:-----|:-----|:--| +|zfit |0.3.0 |0.4.0 |* | + +# Revdeps + diff --git a/revdep/cran.md b/revdep/cran.md new file mode 100644 index 0000000..33114b6 --- /dev/null +++ b/revdep/cran.md @@ -0,0 +1,7 @@ +## revdepcheck results + +We checked 0 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package. + + * We saw 0 new problems + * We failed to check 0 packages + diff --git a/revdep/failures.md b/revdep/failures.md new file mode 100644 index 0000000..9a20736 --- /dev/null +++ b/revdep/failures.md @@ -0,0 +1 @@ +*Wow, no problems at all. :)* \ No newline at end of file diff --git a/revdep/problems.md b/revdep/problems.md new file mode 100644 index 0000000..9a20736 --- /dev/null +++ b/revdep/problems.md @@ -0,0 +1 @@ +*Wow, no problems at all. :)* \ No newline at end of file diff --git a/tests/testthat/test-zfit_base.R b/tests/testthat/test-zfit_base.R index 0d0842d..c8c9f63 100644 --- a/tests/testthat/test-zfit_base.R +++ b/tests/testthat/test-zfit_base.R @@ -14,8 +14,10 @@ test_that("zfunction works", { }) + test_that("zfunction curly notation works", { + # Define a parameter name the_param_name <- "x" # Define the zgrep function, which is our test case @@ -32,20 +34,21 @@ test_that("zfunction curly notation works", { expect_equal(zgrep, zgrep_curly_named) }) + context("zfold") test_that("zfold works", { + # Check that the abc() helper works as expected abc() |> expect_output(".*a.*b.*c") - - hi <- "hi" - "hi" |> abc() |> expect_output("a.*hi.*b") + # Define alternative functions bac_function <- zfunction(abc, b) bac_fold <- zfold(abc, b) # function first, constant and variable + hi <- "hi" "hi" |> bac_function() |> expect_output("b.*hi.*c") hi |> bac_function() |> expect_output("b.*hi.*c") @@ -53,23 +56,22 @@ test_that("zfold works", { "hi" |> bac_fold() |> expect_output("b.*hi.*c") hi |> bac_fold() |> expect_output("b.*hi.*c") + # Define the zgrep function + zgrep <- zfold(grep, x) - # # Define the zgrep function, which is our test case - # zgrep <- zfold(grep, x) - # - # # Run grep and zgrep on the same input (apart from order) - # char_vector <- rownames(mtcars) - # r.grep <- grep("ll", char_vector, value=TRUE) - # r.zgrep <- zgrep(char_vector, "ll", value=TRUE) - # expect_equal(r.zgrep, r.grep) - + # Run grep and zgrep on the same input (apart from order) + carnames <- rownames(mtcars) + r.grep <- grep("ll", carnames, value=TRUE) + r.zgrep <- zgrep(carnames, "ll", value=TRUE) + expect_equal(r.zgrep, r.grep) }) test_that("zfold curly notation works", { + # Define parameter the_param_name <- "x" - # Define the zgrep function, which is our test case + # Define the zgrep function zgrep <- zfold(grep, x) zgrep_constant <- zfold(grep, "x") zgrep_constant_named <- zfold(grep, x = "x") @@ -83,10 +85,12 @@ test_that("zfold curly notation works", { expect_equal(zgrep, zgrep_curly_named) }) + context("zfold generics") test_that("zfold on S3 generic print works", { if (requireNamespace("tibble") && getRversion() >= "4.1.0") { + # Flip order of print generic, but still dispatch to print.tbl_df ztbl_print <- zfold(print, "n", x_not_found = "ok") cartibble <- tibble::tibble(cars) @@ -99,12 +103,13 @@ test_that("zfold on S3 generic print works", { 13 |> ztbl_print(cartibble) |> expect_output("37 more rows") } - }) + test_that("zfold on well-behaved S3 generics works", { if (getRversion() >= "4.1.0") { + # Define dispatch functions dispatch <- function(x, y) { UseMethod("dispatch") } dispatch.default <- function(x, y) { paste("default", x, y) } dispatch.numeric <- function(x, y) { paste("numeric", x, y) } @@ -125,6 +130,7 @@ test_that("zfold on well-behaved S3 generics works", { test_that("zfold on poorly-behaved S3 generics doesn't work", { if (getRversion() >= "4.1.0") { + # Flip order of t.test generic, but still dispatch t.test.formula zgt.test <- zfold(t.test, "data", x_not_found = "ok") @@ -137,9 +143,6 @@ test_that("zfold on poorly-behaved S3 generics doesn't work", { } }) -test_that("docs for zfunction, zfold, and zfitter are combined", { - skip("Need to combine docs for zfunction, zfold, and zfitter") -}) context("zfitter") @@ -164,11 +167,10 @@ test_that("zfitter works", { } # Test usage in the context of native pipes - if ( getRversion() >= "4.1" ) { + if ( getRversion() >= "4.1.0" ) { m.zzlm.np <- cars |> zzlm(dist~speed) expect_equal(m.zzlm.np, m.lm) } - }) test_that("zfitter error checking works",{ @@ -182,7 +184,6 @@ test_that("zfitter error checking works",{ # The target function must have both function and data parameters expect_error(zfitter(grep)) expect_error(zfitter(within)) - })