Skip to content

Commit

Permalink
Merge pull request #43 from pfmc-assessments/style-doc-code
Browse files Browse the repository at this point in the history
Style code and document
  • Loading branch information
chantelwetzel-noaa authored Oct 3, 2024
2 parents 5fb2b91 + ef0b32d commit a820f6c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions R/check_profile_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ check_profile_range <- function(mydir, model_settings) {
}
step_size <- profile_details[["step_size"]]

if((max(range) - min(range)) < step_size) {
if ((max(range) - min(range)) < step_size) {
cli::cli_abort(
"The step size of {step_size} appears to be set too large to
profile over {para} from value of {range[1]} to {range[2]}."
Expand Down Expand Up @@ -81,7 +81,7 @@ check_profile_range <- function(mydir, model_settings) {
if (est %in% vec) {
vec <- vec[!vec == est]
}
if(model_settings[["verbose"]]) {
if (model_settings[["verbose"]]) {
cli::cli_inform(
"Profiling over {para} across values of {sort(vec)}."
)
Expand Down
7 changes: 4 additions & 3 deletions R/get_settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
#'
#' @examples
#' \dontrun{
#' get_settings(
#' mydir = "directory",
#' settings = list("Njitter" = 10))
#' get_settings(
#' mydir = "directory",
#' settings = list("Njitter" = 10)
#' )
#' }
#'
get_settings <- function(mydir = NULL, settings = NULL) {
Expand Down
3 changes: 2 additions & 1 deletion R/get_settings_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ get_settings_profile <- function(parameters = c("NatM_uniform_Fem_GP_1", "SR_BH_
cli::cli_abort(
"Input vectors do match in length. There were {length(parameters)} parameters,
{length(low)} lower bounds, {length(high)} high bounds, {length(step_size)}
step sizes, and {length(param_space)} parameter spaces specified.")
step sizes, and {length(param_space)} parameter spaces specified."
)
}

if (lifecycle::is_present(use_prior_like)) {
Expand Down
4 changes: 2 additions & 2 deletions R/run_profile.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ run_profile <- function(mydir, model_settings, para) {
}
step_size <- model_settings[["profile_details"]][["step_size"]]

if((max(range) - min(range)) < step_size) {
if ((max(range) - min(range)) < step_size) {
cli::cli_abort(
"The step size of {step_size} appears to be set too large to
profile over {para} from value of {range[1]} to {range[2]}."
Expand Down Expand Up @@ -161,7 +161,7 @@ run_profile <- function(mydir, model_settings, para) {
}
num <- sort(vec, index.return = TRUE)[["ix"]]

if(model_settings[["verbose"]]) {
if (model_settings[["verbose"]]) {
cli::cli_inform(
"Profiling over {para} across values of {sort(vec)}."
)
Expand Down
7 changes: 4 additions & 3 deletions man/get_settings.Rd

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

0 comments on commit a820f6c

Please sign in to comment.