Skip to content

Commit

Permalink
add expect warn, remove complex requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
wincowgerDEV committed Aug 25, 2023
1 parent be48968 commit b1addac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/as_OpenSpecy.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ as_OpenSpecy.default <- function(x, spectra,
coords = "gen_grid",
session_id = FALSE,
...) {
if (!is.numeric(x) || !is.complex(x) || !is.vector(x))
if (!is.numeric(x) || !is.vector(x))
stop("'x' must be numeric vector", call. = F)
if (!inherits(spectra, c("data.frame", "matrix")))
stop("'spectra' must inherit from data.frame or matrix", call. = F)
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-match_spec.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ test_that("cor_spec returns a data.table with correct columns", {
matches <- cor_spec(unknown,library = test_lib)
unknown2 <- unknown
unknown2$wavenumber[1:3] <- unknown2$wavenumber[1:3] +1
matches2 <- cor_spec(unknown2,library = test_lib)

expect_warning(matches2 <- cor_spec(unknown2,library = test_lib))
expect_true(inherits(matches, "matrix"))
expect_identical(dim(matches), c(ncol(test_lib$spectra), ncol(unknown$spectra)))
top_matches <- max_cor_named(cor_matrix = matches, na.rm = T)
Expand Down

0 comments on commit b1addac

Please sign in to comment.