Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
^appveyor\.yml$
^containers$
^README\.Rmd$
^LICENSE\.md$
^LICENSE\.md$
^\.github$
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
84 changes: 84 additions & 0 deletions .github/workflows/R-CMD-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
on:
push:
branches:
- master
- devel
pull_request:
branches:
- master
schedule:
- cron: "0 0 * * 1"

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: ubuntu-16.04, r: '3.6', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'release', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}
- {os: ubuntu-16.04, r: 'devel', rspm: "https://demo.rstudiopm.com/all/__linux__/xenial/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ matrix.config.r }}-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-r-${{ matrix.config.r }}-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"

- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@master
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

55 changes: 55 additions & 0 deletions .github/workflows/test_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- master
- devel
pull_request:
branches:
- master

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@master

- uses: r-lib/actions/setup-pandoc@master

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}

- name: Cache R packages
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ubuntu-r-release-${{ hashFiles('depends.Rds') }}
restore-keys: ubuntu-r-release-

- name: Install system dependencies
if: runner.os == 'Linux'
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('rcannood/sysreqs')"
sysreqs=$(Rscript -e "pkgs <- unique(c(sysreqs:::get_cran_sysreqs(sysreqs:::get_cran_deps('covr')), sysreqs::sysreqs('DESCRIPTION'))); cat(sysreqs:::sysreq_commands_pkgs(pkgs))")
sudo -s eval "$sysreqs"

- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("covr")
shell: Rscript {0}

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}

10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

13 changes: 5 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: dynparam
Type: Package
Title: Creating Meta-Information for Parameters
Version: 1.0.0
Version: 1.0.2
Authors@R: c(
person(
"Robrecht",
Expand All @@ -24,9 +24,9 @@ Description: Provides tools for describing parameters of algorithms in an abstra
Description can include an id, a description, a domain (range or list of values),
and a default value. 'dynparam' can also convert parameter sets to a 'ParamHelpers' format,
in order to be able to use 'dynparam' in conjunction with 'mlrMBO'.
License: GPL-3
License: MIT + file LICENSE
LazyData: TRUE
RoxygenNote: 6.1.1
RoxygenNote: 7.1.1
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Depends:
Expand All @@ -36,15 +36,12 @@ Imports:
carrier,
dplyr,
dynutils (>= 1.0.2),
Hmisc,
magrittr,
purrr,
stringr,
testthat,
tibble,
tidyr
Suggests:
lhs,
ParamHelpers,
lhs
Remotes:
dynverse/dynutils@master
testthat
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2014-2020
COPYRIGHT HOLDER: Robrecht Cannoodt, Wouter Saelens
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2014-2020 Robrecht Cannoodt, Wouter Saelens

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import(dplyr)
import(dynutils)
import(purrr)
import(tidyr)
importFrom(Hmisc,capitalize)
importFrom(carrier,crate)
importFrom(magrittr,"%$%")
importFrom(magrittr,"%<>%")
Expand Down
11 changes: 11 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# dynparam 1.0.2 (04-01-2021)

* MINOR CHANGES: Set `check.environment` to `FALSE` in unit tests to fix breaking changes in R devel.

# dynparam 1.0.1 (24-06-2020)
* MINOR CHANGES: Move testthat to Suggests.
* MINOR CHANGES: Use `expect_equal(., ., tolerance = .)` instead of `expect_lte(abs(. - .), .)` in tests.

# dynparam 1.0.0 (02-04-2019)

* INITIAL RELEASE: dynparam helps describe method parameters.
13 changes: 10 additions & 3 deletions R/param_super.R
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ on_failure(is_parameter) <- function(call, env) {
#' @param x The parameter
#' @param sep A separator between different fields
#'
#' @importFrom Hmisc capitalize
#' @importFrom stringr str_replace_all str_replace str_glue_data
#'
#' @export
Expand All @@ -167,7 +166,7 @@ get_description <- function(
description <-
(x$description %||% "") %>% # use "" if no description is provided
str_replace_all("\n", "") %>% # remove newlines
Hmisc::capitalize() %>% # capitalise sentences
capitalise() %>% # capitalise sentences
str_replace_all("\\\\link\\[[a-zA-Z0-9_:]*\\]\\{([^\\}]*)\\}", "\\1") %>% # substitute \link[X](Y) with just Y
str_replace_all("[ \t\\.]*$", "") # remove trailing whitespace and punctuation

Expand All @@ -180,7 +179,7 @@ get_description <- function(
lis[!names(lis) %in% c("id", "type")] %>%
as.list() %>%
stringr::str_glue_data("{names(.)}: {.}") %>%
Hmisc::capitalize() %>%
capitalise() %>%
paste0(collapse = sep)

paste0(description, sep, extra_text)
Expand All @@ -201,3 +200,11 @@ as_descriptive_tibble.parameter <- function(x) {
default = collapse_set(x$default)
)
}



capitalise <- function(string) {
capped <- grep("^[A-Z]", string, invert = TRUE)
substr(string[capped], 1, 1) <- toupper(substr(string[capped], 1, 1))
return(string)
}
5 changes: 2 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,11 @@ as_paramhelper(parameters)

## Latest changes

Check out `news(package = "dynparam")` or [NEWS.md](inst/NEWS.md) for a full list of changes.
Check out `news(package = "dynparam")` or [NEWS.md](NEWS.md) for a full list of changes.

<!-- This section gets automatically generated from inst/NEWS.md, and also generates inst/NEWS -->
<!-- This section gets automatically generated from NEWS.md, and also generates inst/NEWS -->

```{r news, echo=FALSE, results="asis"}
dynutils::update_news()
base::cat(dynutils::recent_news())
```

Expand Down
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,12 @@ sip(parameters, n = 2)
```

## # A tibble: 2 x 8
## num_iter delta method inverse dimreds ks quantiles .object_class
## <int> <list> <chr> <lgl> <list> <list> <list> <list>
## 1 90 <dbl [… spearm… TRUE <chr [3 <dbl [ <dbl [2]> <chr [1]>
## 2 332 <dbl [… spearm… TRUE <chr [4… <dbl [ <dbl [2]> <chr [1]>
## num_iter delta method inverse dimreds ks quantiles .object_class
## <int> <list> <chr> <lgl> <list> <list> <list> <list>
## 1 1823 <dbl [3]> kendall FALSE <chr [3]> <dbl [2]> <dbl [2]> <chr [1]>
## 2 125 <dbl [3]> pearson TRUE <chr [2]> <dbl [2]> <dbl [2]> <chr [1]>

Convert paramhelper
object:
Convert paramhelper object:

``` r
as_paramhelper(parameters)
Expand All @@ -268,16 +267,21 @@ as_paramhelper(parameters)

## Latest changes

Check out `news(package = "dynparam")` or [NEWS.md](inst/NEWS.md) for a
full list of
changes.
Check out `news(package = "dynparam")` or [NEWS.md](NEWS.md) for a full
list of changes.

<!-- This section gets automatically generated from inst/NEWS.md, and also generates inst/NEWS -->
<!-- This section gets automatically generated from NEWS.md, and also generates inst/NEWS -->

### Recent changes in dynparam 1.0.0 (02-04-2019)
### Recent changes in dynparam 1.0.2 (04-01-2021)

- INITIAL RELEASE: dynparam helps describe method
parameters.
- MINOR CHANGES: Set `check.environment` to `FALSE` in unit tests to
fix breaking changes in R devel.

### Recent changes in dynparam 1.0.1 (24-06-2020)

- MINOR CHANGES: Move testthat to Suggests.
- MINOR CHANGES: Use `expect_equal(., ., tolerance = .)` instead of
`expect_lte(abs(. - .), .)` in tests.

## Dynverse dependencies

Expand Down
19 changes: 12 additions & 7 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
This is a new package for being able to describe parameters in an abstract way.
# dynparam 1.0.2 (04-01-2021)

* MINOR CHANGES: Set `check.environment` to `FALSE` in unit tests to fix breaking changes in R devel.

## Test environments
* local Fedora install, R 3.5.2
* ubuntu 14.04 (on travis-ci), R 3.5.2
* win-builder (release and devel)
* local Fedora install, R 4.0.3
* ubuntu 16.04 (with Github Actions; R 3.6, release, devel)
* Mac OS X (with Github Actions; R release)
* Windows (with Github Actions; R release)
* win-builder (devel)

## R CMD check results

```
── R CMD check results ───────────────────────────────────── dynparam 1.0.0 ────
Duration: 36.9s
── R CMD check results ───────────────────────────────────── dynparam 1.0.2 ────
Duration: 31.4s

0 errors | 0 warnings | 0 notes
0 errors | 0 warnings | 0 notes

R CMD check succeeded

```
3 changes: 0 additions & 3 deletions inst/NEWS

This file was deleted.

3 changes: 0 additions & 3 deletions inst/NEWS.md

This file was deleted.

3 changes: 1 addition & 2 deletions man/character_parameter.Rd

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

Loading
Loading