Skip to content

Commit

Permalink
make the call to factory cleaner using symbol to prefix targets names
Browse files Browse the repository at this point in the history
  • Loading branch information
cpauvert committed May 6, 2024
1 parent 7f43051 commit bfb1623
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions R/tar_import_and_process_spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#' quality-checked processed spectra. See [targets::tar_target] for more
#' information about what are target objects.
#'
#' @param name A character indicating the prefix of all targets created by the factory.
#' For instance, `name = anaerobe` will create the target `anaerobe_spectra_raw` among others.
#' @param name A symbol indicating the prefix of all targets created by the factory.
#' For instance, calling `tar_import_and_process_spectra(anaerobe, ...)` will create the target `anaerobe_spectra_raw` among others (see the Value section).
#' @param raw_spectra_directories A vector of paths to directories containing MALDI Biotyper spectra files. This is similar to the `biotyper_directory` parameter from [import_biotyper_spectra], but as a character vector.
#' @inheritParams check_spectra
#' @inheritParams targets::tar_target_raw # TODO: add others parameters to inherit, maybe with ... to targets::tar_target()?
Expand Down Expand Up @@ -52,7 +52,7 @@ tar_import_and_process_spectra <- function(
rlang::check_installed(c("targets", "tarchetypes"),
reason = "to facilitate {maldipickr} workflow development"

Check warning on line 53 in R/tar_import_and_process_spectra.R

View check run for this annotation

Codecov / codecov/patch

R/tar_import_and_process_spectra.R#L52-L53

Added lines #L52 - L53 were not covered by tests
)
targets::tar_assert_chr(name)
name <- targets::tar_deparse_language(substitute(name))
targets::tar_assert_path(raw_spectra_directories)
targets::tar_assert_dbl(tolerance)

Check warning on line 57 in R/tar_import_and_process_spectra.R

View check run for this annotation

Codecov / codecov/patch

R/tar_import_and_process_spectra.R#L55-L57

Added lines #L55 - L57 were not covered by tests

Expand Down
6 changes: 3 additions & 3 deletions dev/maldipickr-workflow-with-targets.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ These helpers in `{maldipickr}` are called {targets} factories, which means they
#' quality-checked processed spectra. See [targets::tar_target] for more
#' information about what are target objects.
#'
#' @param name A character indicating the prefix of all targets created by the factory.
#' For instance, `name = anaerobe` will create the target `anaerobe_spectra_raw` among others.
#' @param name A symbol indicating the prefix of all targets created by the factory.
#' For instance, calling `tar_import_and_process_spectra(anaerobe, ...)` will create the target `anaerobe_spectra_raw` among others (see the Value section).
#' @param raw_spectra_directories A vector of paths to directories containing MALDI Biotyper spectra files. This is similar to the `biotyper_directory` parameter from [import_biotyper_spectra], but as a character vector.
#' @inheritParams check_spectra
#' @inheritParams targets::tar_target_raw # TODO: add others parameters to inherit, maybe with ... to targets::tar_target()?
Expand All @@ -67,7 +67,7 @@ tar_import_and_process_spectra <- function(
rlang::check_installed(c("targets", "tarchetypes"),
reason = "to facilitate {maldipickr} workflow development"
)
targets::tar_assert_chr(name)
name <- targets::tar_deparse_language(substitute(name))
targets::tar_assert_path(raw_spectra_directories)
targets::tar_assert_dbl(tolerance)
Expand Down
4 changes: 2 additions & 2 deletions man/tar_import_and_process_spectra.Rd

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

0 comments on commit bfb1623

Please sign in to comment.