Skip to content

Commit

Permalink
Bump version and finalize for release
Browse files Browse the repository at this point in the history
  • Loading branch information
torfason committed Aug 27, 2023
1 parent df5ec41 commit 9c7ff2a
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 32 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Expand Up @@ -10,3 +10,4 @@
^build$
^_pkgdown\.yml$
^\.github$
^revdep$
2 changes: 1 addition & 1 deletion 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 <m@zulutime.net>
Description: Improve the usage of model fitting functions within a piped
Expand Down
15 changes: 12 additions & 3 deletions 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),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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)
<!-- badges: end -->

Expand Down
2 changes: 2 additions & 0 deletions build/build_and_release_process.R
Expand Up @@ -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()

Expand Down
16 changes: 9 additions & 7 deletions cran-comments.md
Expand Up @@ -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

Expand All @@ -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
2 changes: 2 additions & 0 deletions inst/WORDLIST
Expand Up @@ -13,6 +13,8 @@ NSE
param
poisson
tibble
roxygen
roxygen2
zfitter
zfunction
zglm
Expand Down
7 changes: 7 additions & 0 deletions revdep/.gitignore
@@ -0,0 +1,7 @@
checks
library
checks.noindex
library.noindex
cloud.noindex
data.sqlite
*.html
24 changes: 24 additions & 0 deletions 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

7 changes: 7 additions & 0 deletions 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

1 change: 1 addition & 0 deletions revdep/failures.md
@@ -0,0 +1 @@
*Wow, no problems at all. :)*
1 change: 1 addition & 0 deletions revdep/problems.md
@@ -0,0 +1 @@
*Wow, no problems at all. :)*
41 changes: 21 additions & 20 deletions tests/testthat/test-zfit_base.R
Expand Up @@ -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
Expand All @@ -32,44 +34,44 @@ 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")

# then fold, constant and variable
"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")
Expand All @@ -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)
Expand All @@ -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) }
Expand All @@ -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")

Expand All @@ -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")

Expand All @@ -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",{
Expand All @@ -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))

})


0 comments on commit 9c7ff2a

Please sign in to comment.