Skip to content
Open
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
4 changes: 2 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
^src/framework/.git$
# Files from the `framework` submodule

^inc/.editorconfig$
^inc/.git$
^src/inc/.editorconfig$
^src/inc/.git$
# Files from the `inc` submodule

^vignettes/[^/]*\.pdf$
Expand Down
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
path = src/framework
url = https://github.com/biocro/framework
branch = main
[submodule "inc"]
path = inc
[submodule "src/inc"]
path = src/inc
url = https://github.com/biocro/inc
branch = main
9 changes: 5 additions & 4 deletions R/input_checking_functions.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Checks whether `args_to_check` has names. The other checking functions require
# names to give useful error messages.
check_names <- function(args_to_check) {
if(is.null(names(args_to_check))) {
if (is.null(names(args_to_check))) {
stop(paste0("`", substitute(args_to_check), "` must have names"))
}
}

# Sends the error messages to the user in the proper format
send_error_messages <- function(error_messages) {
# Sends the error messages to the user in the proper format. Don't include the
# call to `stop_and_send_error_messages` in the message itself.
stop_and_send_error_messages <- function(error_messages) {
if (length(error_messages) > 0) {
stop(paste(error_messages, collapse=' '))
stop(paste(error_messages, collapse=' '), call. = FALSE)
}
}

Expand Down
2 changes: 1 addition & 1 deletion R/module_creators.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module_creators <- function(module_names)
check_element_length(list(module_names = module_names))
)

send_error_messages(error_messages)
stop_and_send_error_messages(error_messages)

# Make sure the module names are a vector
module_names <- unlist(module_names)
Expand Down
33 changes: 19 additions & 14 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ package:
`Rscript module_library_setup.R`.

In either case, you will be prompted for a module library name, which should
be 16 or fewer characters long and not contain any underscores; ideally this
be 12 or fewer characters long and not contain any underscores; ideally this
would match the name of the newly-created repository. (If you might ever want
to submit your package to CRAN, make sure your name is unique on CRAN and
BioConductor; one way to help ensure this is to include `BML` in the name.)
Expand Down Expand Up @@ -117,23 +117,29 @@ skeleton module library in the future; every effort will be made to limit the
frequency of these updates, but they will nevertheless occur. When there is an
update to this repository, you can update your module library from it by taking
the following steps:
1. Make a new "development" branch for your repository (based on the main
branch) and make sure this branch is checked out in your working copy.
2. Make sure you have a remote named `upstream` that points to the
1. Check the
[skelBML news](https://github.com/biocro/skelBML/blob/main/skelBML_news.md)
for any version-specific notes about updating.
2. Make a new branch for your repository and make sure this branch is checked
out in your working copy.
3. Make sure you have a remote named `upstream` that points to the
`biocro/skelBML` repository (_this_ repository). This can be done with the
following command:
```
git remote add upstream https://github.com/biocro/skelBML.git
```
If the remote already exists, you will get an error, but there is no harm in
running the command.
3. Update from the remote using the commands
4. Update from the remote using the commands
```
git fetch upstream
git merge upstream/main
```
You may need to address one or more merge conflicts at this point.
4. Complete the update as follows:
You may need to address one or more merge conflicts at this point. One merge
conflict will be related to `skelBML_news.md`; this file will be deleted when
running the script in Step 5 below, so it does not matter how this conflict
is resolved.
5. Complete the update as follows:
1. Rerun the setup script, running it as described above.
2. Any files that would be changed by the script will be backed up; for
example, if the script would modify
Expand All @@ -145,15 +151,14 @@ the following steps:
customizations that should be retained in the new version of those files,
such as the table of modules, the package title, etc. Delete backups as
you see fit.
5. To confirm that everything worked, try building and checking the package on
the development branch with `R CMD build` and `R CMD check`.
6. When everything is working, commit the changed files to the development
branch, and then merge the branch into the main branch of your repository
6. To confirm that everything worked, try building and checking the package with
`R CMD build` and `R CMD check`.
7. When everything is working, commit the changed files to the new branch, and
then merge the branch into the main or development branch of your repository
(possibly by first creating a pull request if you are working with a team).

Updating your repository on a development branch as described in these steps
will allow you to test out the changes before committing them to your main
branch.
Updating your repository on a separate branch as described in these steps
will allow you to safely test out the changes before finalizing them.

### Making contributions

Expand Down
1 change: 0 additions & 1 deletion inc
Submodule inc deleted from 119fde
2 changes: 1 addition & 1 deletion script/module_library_setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## function definitions

name_length_limit <- 16
name_length_limit <- 12

stop_quietly <- function() {
opt <- options(show.error.messages = FALSE)
Expand Down
11 changes: 11 additions & 0 deletions script/templates/CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
citHeader(
'When referencing the %1$s R package in a scientific publication, ',
'please cite the package itself or otherwise specify its version number.'
)

citation(auto = meta)

citFooter(
'Because %1$s is a BioCro module library, please also reference the ',
'BioCro framework. Type citation("BioCro") for more details.'
)
14 changes: 10 additions & 4 deletions script/templates/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@ Title: YOUR TITLE HERE
Description: YOUR DESCRIPTION HERE.
Authors@R: c(
person('Example', 'McAuthor', role = c('cre', 'aut'),
email = 'example@illinois.edu')
email = 'example@illinois.edu'),
person('%1$s authors', role = 'cph'),
person('BioCro authors', role = 'cph',
comment = 'Copyright holder of included BioCro C++ framework'),
person('Boost Organization', role = 'cph',
comment = 'Copyright holder of included Boost library')
)
Depends: R (>= 3.5.0)
Depends: R (>= 4.1.0)
Imports:
stats
Suggests:
BioCro (>= 3.0.0),
testthat,
testthat (>= 3.2.0),
knitr,
lattice
VignetteBuilder: knitr
SystemRequirements: C++11, GNU make
SystemRequirements: C++17, GNU make
License: MIT + file LICENSE
LazyData: true
ByteCompile: TRUE
Config/testthat/edition: 3
2 changes: 1 addition & 1 deletion script/templates/LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
YEAR: 2023
YEAR: 2026
COPYRIGHT HOLDER: %1$s authors
2 changes: 1 addition & 1 deletion script/templates/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 %1$s authors
Copyright (c) 2026 %1$s authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion script/templates/skeleton_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace %1$s
{
static const std::string skeleton_version = "2.1.3";
static const std::string skeleton_version = "2.2.0";
}

#endif
1 change: 1 addition & 0 deletions script/templates/template_table
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
template_file destination_path
CITATION inst/CITATION
DESCRIPTION DESCRIPTION
example_module.h src/module_library/example_module.h
init.cpp src/init.cpp
Expand Down
2 changes: 1 addition & 1 deletion skelBML_description
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## WARNING: This file was included in this package by the BioCro skeleton module
## library and should not be manually edited.

skelBML version 2.1.3 (https://github.com/biocro/skelBML)
skelBML version 2.2.0 (https://github.com/biocro/skelBML)

Created by Justin M. McGrath, Edward B. Lochocki, and Scott Rohde.

Expand Down
2 changes: 1 addition & 1 deletion skelBML_license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT License

Copyright (c) 2023 skelBML authors
Copyright (c) 2026 skelBML authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
23 changes: 23 additions & 0 deletions skelBML_news.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,29 @@ Subsequent commits will then include a new "UNRELEASED" section in preparation
for the next release.
-->

# skelBML VERSION 2.2.0

- Several changes were made to better comply with CRAN policies and to better
match the BioCro framework R package:
- The included boost library was moved to `src/inc` from `inc` and updated to
version 1.89
- Copyright holders of included libraries were added to the description
- Citation guidelines were added
- The minimum supported version of R was changed to 4.1.0
- The C++ language specification was changed to C++17
- The character limit for package names was decreased from 16 to 12
- Notes about updating to version 2.2.0:
- When running `git merge upstream/main` to update, you may be asked
`Unlink of file 'inc' failed. Should I try again? (y/n)`. Answer `n` to this
question.
- After completing the merge, you may need to run
`git submodule update --init` to initialize the `inc` submodule in its new
location.
- Any module libraries that were based on earlier versions of `skelBML` should
run `script/module_library_setup.R` when updating to version 2.1.4. In
particular, there are important updates to `DESCRIPTION`, `LICENSE`,
`LICENSE.md`, `inst/CITATION`, and `src/skeleton_version.h`.

# skelBML VERSION 2.1.3

- The boost library is now included as a git submodule, and has been updated to
Expand Down
1 change: 1 addition & 0 deletions src/inc
Submodule inc added at ab1805