Skip to content

Commit

Permalink
fcwt(): change argument name: remove_coi -> rm_coi
Browse files Browse the repository at this point in the history
  • Loading branch information
lschneiderbauer committed Jan 5, 2025
1 parent df55bda commit 846c9aa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions R/fcwt.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@
#' sigma, it depends on the use case. So the default choice can very well be
#' quite a bad choice (it probably is for audio data).
#'
#' @param remove_coi ( [TRUE] | [FALSE] )
#' Boundary effects can result in nonphysical artifacts. If `remove_coi = TRUE`,
#' @param rm_coi ( [TRUE] | [FALSE] )
#' Boundary effects can result in nonphysical artifacts. If `rm_coi = TRUE`,
#' those are effectively removed by setting corresponding values to [NA].
#' We define the essential support of the
#' (Gaussian) wavelet to be four times its standard deviation,
#' \eqn{\Delta t = \frac{\sigma}{f}}, and so a wavelet touches
#' the boundary if the distance of the center of the wavelet to the boundary
#' is less then \eqn{\Delta t /2}. Values that fall into that range are removed
#' if `remove_coi = TRUE`.
#' if `rm_coi = TRUE`.
#'
#' @param n_threads
#' Number of threads used by the computation, if supported by your platform.
Expand Down Expand Up @@ -138,7 +138,7 @@ fcwt <- function(x,
),
freq_scale = c("log", "linear"),
# abs = FALSE,
remove_coi = TRUE,
rm_coi = TRUE,
n_threads = 2L) {
stopifnot(is.numeric(x))
stopifnot(is.numeric(n_freqs), n_freqs > 0)
Expand Down Expand Up @@ -193,7 +193,7 @@ fcwt <- function(x,
freq_scale, sigma
)

if (remove_coi) {
if (rm_coi) {
sc_set_coi_na(sc)
} else {
sc
Expand Down
2 changes: 1 addition & 1 deletion R/fcwt_batch.R
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ fcwt_batch <- function(x,
n_freqs = n_freqs,
freq_scale = freq_scale,
sigma = sigma,
remove_coi = FALSE,
rm_coi = FALSE,
n_threads = n_threads
) |>
# we fully remove COI infected time slices
Expand Down
8 changes: 4 additions & 4 deletions man/fcwt.Rd

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

2 changes: 1 addition & 1 deletion tests/testthat/test-fcwt.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ test_that("fcwt() removing coi works", {
freq_end = 1000,
n_freqs = 10,
sigma = 1,
remove_coi = TRUE
rm_coi = TRUE
)

# we have a time series that is 1000 / 44100 s long
Expand Down

0 comments on commit 846c9aa

Please sign in to comment.