Package: azlogr Check: examples New result: ERROR Running examples in ‘azlogr-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: logger_level > ### Title: Logging related functions > ### Aliases: logger_level logger_info logger_error logger_warn logger_fatal > ### logger_success logger_debug logger_trace > > ### ** Examples > > # Define logging config and then use logger_* functions to log > set_log_config(log_to_azure = FALSE) > logger_level(logger::INFO, "logging message") Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: logger_level ... lapply -> FUN -> structure -> do.call -> Execution halted Package: azlogr Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘how-to-use-azlogr.Rmd’ using rmarkdown Quitting from how-to-use-azlogr.Rmd:63-81 [logging] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error in `layout()`: ! unused argument (.timestamp = .timestamp) --- Backtrace: ▆ 1. └─azlogr::logger_info("log information") 2. └─azlogr::logger_level(logger::INFO, ...) 3. └─logger::log_level(...) 4. └─base::lapply(...) 5. └─logger (local) FUN(X[[i]], ...) 6. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 7. ├─base::do.call(log_fun, log_arg) 8. └─logger (local) ``(...) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: processing vignette 'how-to-use-azlogr.Rmd' failed with diagnostics: unused argument (.timestamp = .timestamp) --- failed re-building ‘how-to-use-azlogr.Rmd’ SUMMARY: processing the following file failed: ‘how-to-use-azlogr.Rmd’ Error: Vignette re-building failed. Execution halted Package: azlogr Check: tests New result: ERROR Running ‘testthat.R’ [2s/2s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(azlogr) > > test_check("azlogr") [ FAIL 12 | WARN 0 | SKIP 0 | PASS 12 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-logger_level.R:4:3'): if incorrect authorization generate warning ── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-logger_level.R:4:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─azlogr::logger_level(logger::INFO, "logging message info", log_to_azure = TRUE) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Failure ('test-logger_level.R:10:3'): posting to AZ log analytics works ───── `logger_level(logger::INFO, "logging message info", log_to_azure = TRUE)` threw an unexpected error. Message: unused argument (.timestamp = .timestamp) Class: simpleError/error/condition Backtrace: ▆ 1. ├─testthat::expect_error(...) at test-logger_level.R:10:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─azlogr::logger_level(logger::INFO, "logging message info", log_to_azure = TRUE) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:15:3'): catch error as warn if POST to AZ unsuccessful, console print ok ── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-logger_level.R:15:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─azlogr::logger_level(...) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:27:3'): logging to console works ──────────────── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_match(...) at test-logger_level.R:27:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─utils::capture.output(...) 5. │ └─base::withVisible(...elt(i)) 6. └─azlogr::logger_info("logging message info", log_to_azure = FALSE) 7. └─azlogr::logger_level(logger::INFO, ...) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:43:3'): additional field works ────────────────── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_match(...) at test-logger_level.R:43:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─utils::capture.output(...) 5. │ └─base::withVisible(...elt(i)) 6. └─azlogr::logger_info("logging message info", log_to_azure = FALSE) 7. └─azlogr::logger_level(logger::INFO, ...) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:56:3'): enforce ascii works ───────────────────── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_match(...) at test-logger_level.R:56:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─utils::capture.output(...) 5. │ └─base::withVisible(...elt(i)) 6. └─azlogr::logger_info(...) 7. └─azlogr::logger_level(logger::INFO, ...) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:93:3'): additional meta vars error catching works ── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_error(...) at test-logger_level.R:93:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─azlogr::logger_info("logging message info", log_to_azure = FALSE) 8. └─azlogr::logger_level(logger::INFO, ...) 9. └─logger::log_level(...) 10. └─base::lapply(...) 11. └─logger (local) FUN(X[[i]], ...) 12. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 13. ├─base::do.call(log_fun, log_arg) 14. └─logger (local) ``(...) ── Error ('test-logger_level.R:114:3'): logging level captured properly ──────── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_match(...) at test-logger_level.R:114:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─utils::capture.output(...) 5. │ └─base::withVisible(...elt(i)) 6. └─azlogr::logger_info("logging message", log_to_azure = FALSE) 7. └─azlogr::logger_level(logger::INFO, ...) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Error ('test-logger_level.R:150:3'): posting to AZ considers log threshold ── Error in `layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), .topcall = substitute(.topcall), .topenv = .topenv, .timestamp = .timestamp)`: unused argument (.timestamp = .timestamp) Backtrace: ▆ 1. ├─testthat::expect_warning(...) at test-logger_level.R:150:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. └─azlogr::logger_level(logger::INFO, "logging message info", log_to_azure = TRUE) 8. └─logger::log_level(...) 9. └─base::lapply(...) 10. └─logger (local) FUN(X[[i]], ...) 11. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 12. ├─base::do.call(log_fun, log_arg) 13. └─logger (local) ``(...) ── Failure ('test-logger_level.R:160:3'): no logging message does not throw error but warning ── `suppressWarnings(logger_level(logger::INFO, log_to_azure = FALSE))` threw an unexpected error. Message: unused argument (.timestamp = .timestamp) Class: simpleError/error/condition Backtrace: ▆ 1. ├─testthat::expect_error(...) at test-logger_level.R:160:3 2. │ └─testthat:::expect_condition_matching(...) 3. │ └─testthat:::quasi_capture(...) 4. │ ├─testthat (local) .capture(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 7. ├─base::suppressWarnings(logger_level(logger::INFO, log_to_azure = FALSE)) 8. │ └─base::withCallingHandlers(...) 9. └─azlogr::logger_level(logger::INFO, log_to_azure = FALSE) 10. └─logger::log_level(...) 11. └─base::lapply(...) 12. └─logger (local) FUN(X[[i]], ...) 13. ├─base::structure(do.call(log_fun, log_arg), class = "logger") 14. ├─base::do.call(log_fun, log_arg) 15. └─logger (local) ``(...) ── Failure ('test-set_log_config.R:2:3'): get config fetches defaults ────────── get_log_config("log_fields") (`actual`) not identical to c("level", "time", "msg") (`expected`). `actual`: "level" "msg" "country" "state" `expected`: "level" "time" "msg" ── Failure ('test-set_log_config.R:3:3'): get config fetches defaults ────────── get_log_config("additional_fields") is not NULL `actual` is a character vector ('in') `expected` is NULL [ FAIL 12 | WARN 0 | SKIP 0 | PASS 12 ] Error: Test failures Execution halted Package: colorSpec Check: examples New result: ERROR Running examples in ‘colorSpec-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: chop > ### Title: chop spectra into low and high parts > ### Aliases: chop chop.colorSpec > ### Keywords: colorSpec > > ### ** Examples > > # chop blue butane flame into diatomic carbon and hydrocarbon parts > path = system.file( "extdata/sources/BlueFlame.txt", package="colorSpec" ) > blueflame = readSpectra( path, seq(375,650,0.5) ) > plot( chop( blueflame, interval=c(432,435), adj=0.8 ) ) > > # chop 'white' LED into blue and yellow parts > path = system.file( "extdata/sources/Gepe-G-2001-LED.sp", package="colorSpec" ) > LED = readSpectra( path ) Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: readSpectra ... lapply -> FUN -> structure -> do.call -> Execution halted Package: colorSpec Check: re-building of vignette outputs New result: ERROR Error(s) in re-building vignettes: ... --- re-building ‘colorSpec-guide.Rmd’ using rmarkdown [WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead. --- finished re-building ‘colorSpec-guide.Rmd’ --- re-building ‘phenolred.Rmd’ using rmarkdown [WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead. --- finished re-building ‘phenolred.Rmd’ --- re-building ‘photoncounting.Rmd’ using rmarkdown [WARNING] Deprecated: --highlight-style. Use --syntax-highlighting instead. --- finished re-building ‘photoncounting.Rmd’ --- re-building ‘blueflame.rnw’ using knitr --- finished re-building ‘blueflame.rnw’ --- re-building ‘convexity.rnw’ using knitr --- finished re-building ‘convexity.rnw’ --- re-building ‘emulation.rnw’ using knitr Quitting from emulation.rnw:281-294 [lee31] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error in `layout()`: ! unused argument (.timestamp = .timestamp) --- Backtrace: x 1. +-colorSpec::product(illum, MacbethCC, plumbicon) 2. \-colorSpec:::product.colorSpec(illum, MacbethCC, plumbicon) 3. \-logger::log_level(WARN, "The returned matrix is ambiguous; because it depends on the splitting. Inspect the matrix carefully.") 4. \-base::lapply(...) 5. \-logger (local) FUN(X[[i]], ...) 6. +-base::structure(do.call(log_fun, log_arg), class = "logger") 7. +-base::do.call(log_fun, log_arg) 8. \-logger (local) ``(...) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Error: processing vignette 'emulation.rnw' failed with diagnostics: unused argument (.timestamp = .timestamp) --- failed re-building ‘emulation.rnw’ --- re-building ‘gallery.rnw’ using knitr --- finished re-building ‘gallery.rnw’ --- re-building ‘inversion.rnw’ using knitr --- finished re-building ‘inversion.rnw’ --- re-building ‘lens-aging.rnw’ using knitr --- finished re-building ‘lens-aging.rnw’ --- re-building ‘optimals.rnw’ using knitr --- finished re-building ‘optimals.rnw’ SUMMARY: processing the following file failed: ‘emulation.rnw’ Error: Vignette re-building failed. Execution halted Package: colorSpec Check: tests New result: ERROR Running ‘test-CGATS.R’ [0s/0s] Running ‘test-atmos.R’ [0s/0s] Running ‘test-bands.R’ [1s/1s] Running ‘test-emulate.R’ [1s/1s] Running ‘test-inventory.R’ [0s/0s] Running ‘test-invert.R’ [3s/3s] Running ‘test-optimals.R’ [2s/2s] Running ‘test-organization.R’ [1s/1s] Running ‘test-product.R’ [2s/2s] Running ‘test-read.R’ [2s/2s] Running ‘test-sink.R’ [0s/0s] Running the tests in ‘tests/test-CGATS.R’ failed. Complete output: > > library( colorSpec ) Attaching colorSpec. Version: 1.8-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:28:20 UTC; unix > > # library( logger ) > > # cs.options( loglevel='TRACE' ) obsolete > > logger::log_threshold( logger::TRACE, namespace="colorSpec" ) > > > > testCGATS <- function() + { + mess = sprintf( "in testCGATS(). getwd() = '%s'", getwd() ) + cat( mess, '\n', file=stderr() ) + + # find the extdata folder + if( grepl( "[..]Rcheck", getwd() ) ) + extdata = "../colorSpec/extdata" + else + extdata = "inst/extdata" + + # extdata = system.file( "extdata", package="colorSpec" ) # override + extdata = '.' + + + if( ! file.exists( extdata ) ) + { + print( getwd() ) + print( extdata ) + cat( "Cannot find the extdata folder !\n", file=stderr() ) + return(FALSE) + } + + + + # test-CGATS-2-2S.txt 2 tables, both are spectral + path = file.path( extdata, "test-CGATS-2-2S.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + + # test-CGATS-2-1S.txt 2 tables, only the 1st one is spectral + path = file.path( extdata, "test-CGATS-2-1S.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 1 table + if( length(junk) != 1 ) + return(FALSE) + + # test-CGATS-2-1S-swap.txt 2 tables, only the 2nd one is spectral + path = file.path( extdata, "test-CGATS-2-1S-swap.txt" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + junk = readSpectraCGATS(path) # should be 1 table + if( length(junk) != 1 ) + return(FALSE) + + + + # A70.ti3 has 2 tables, both non-spectral + path = file.path( extdata, "A70.ti3" ) + junk = readCGATS(path) # should be 2 tables + if( length(junk) != 2 ) + return(FALSE) + + # the readSpectraCGATS() call should generate an ERROR and return NULL, so disable stopping + cs.options( stoponerror=FALSE ) + + # base::options( colorSpec.stoponerror=FALSE ) + # cat( "stop =", .Options$colorSpec.stoponerror, '\n', file=stdout() ) + + junk = readSpectraCGATS(path) + if( ! is.null(junk) ) + return(FALSE) + + cs.options( stoponerror=TRUE ) + + return(TRUE) + } > > > > if( ! testCGATS() ) stop( "testCGATS() failed !" ) in testCGATS(). getwd() = '/home/hornik/tmp/CRAN_recheck/colorSpec.Rcheck/tests' Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testCGATS ... lapply -> FUN -> structure -> do.call -> Execution halted Running the tests in ‘tests/test-product.R’ failed. Complete output: > > require( colorSpec ) Loading required package: colorSpec Attaching colorSpec. Version: 1.8-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:28:20 UTC; unix > > # cs.options( loglevel='D' ) > > > # some of the calls below should fail and return NULL, so disable stopping > cs.options( stoponerror=FALSE ) $colorSpec.stoponerror [1] FALSE > > testProducts <- function() + { + # find the extdata folder + if( grepl( "[..]Rcheck", getwd() ) ) + extdata = "../colorSpec/extdata" + else + extdata = "inst/extdata" + + extdata = system.file( "extdata", package="colorSpec" ) # override + + if( ! file.exists( extdata ) ) + { + print( getwd() ) + print( extdata ) + cat( "Cannot find the extdata folder !\n" ) + return(FALSE) + } + + # read some materials + IR.blocker = readSpectra( file.path( extdata, "objects/Midwest-SP700-2014.txt" ) ) # 1 spectrum + Hematoxylin = readSpectra( file.path( extdata, "stains/Hematoxylin.txt" ) ) # 1 spectrum + Hoya = readSpectra( file.path( extdata, "objects/Hoya.txt" ) ) # 4 spectra + Rosco = readSpectra( file.path( extdata, "objects/Rosco.txt" ) ) # 42 spectra + + # read some sources + Lumencor = readSpectra( file.path( extdata, "sources/Lumencor-SpectraX.txt" ), 380:720 ) # 7 spectra + + print( getwd() ) + + # create an RGB camera from 3 filters and 1 sensor + Zyla = readSpectra( file.path( extdata, "cameras/Zyla_sCMOS.txt" ) ) # 1 spectrum + cameraRGB = product( subset(Hoya,1:3), Zyla, wave='auto' ) # 3 spectra + + # create an RGB scanner + scannerRGB = product( D65.1nm, 'MATERIAL', cameraRGB, wave='auto' ) # 3 spectra + # summary( scanner ) + + # 4 product types return a colorSpec object + + cat( "-------------- M * ... * M ------------------\n" ) + junk = product( IR.blocker, Hoya, Hematoxylin, wave='auto' ) + if( is.null(junk) ) return(FALSE) + + junk = product( Hoya, Rosco, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + cat( "-------------- L * M * ... * M ------------------\n" ) + junk = product( D50.5nm, Hoya, IR.blocker, wave='auto' ) + if( is.null(junk) ) return(FALSE) + + junk = product( Lumencor, Hoya, IR.blocker, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + cat( "-------------- M * ... * M * R_L ------------------\n" ) + junk = product( Hoya, IR.blocker, Zyla, wave='auto' ) + if( is.null(junk) ) return(FALSE) + + junk = product( subset(Hoya,1:3), IR.blocker, cameraRGB, wave='auto' ) + if( is.null(junk) ) return(FALSE) + + junk = product( Hoya, IR.blocker, cameraRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + cat( "-------------- L * M * 'VARMAT' * M * ... * M * R_L ------------------\n" ) + junk = product( Lumencor, IR.blocker, 'VARMAT', Zyla, wave='auto' ) + if( is.null(junk) ) return(FALSE) + + junk = product( Lumencor, IR.blocker, 'VARMAT', cameraRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + + # 2 product types return a matrix + + cat( "-------------- L * M * ... * M * R_L ------------------\n" ) + junk = product( D50.5nm, IR.blocker, Hoya, cameraRGB, wave='auto' ) # junk should be a 4 x 3 matrix + if( is.null(junk) ) return(FALSE) + if( ! all( dim(junk) == c(4,3) ) ) return(FALSE) + + junk = product( Lumencor, IR.blocker, cameraRGB, wave='auto' ) # junk should be a 7 x 3 matrix + if( is.null(junk) ) return(FALSE) + if( ! all( dim(junk) == c(7,3) ) ) return(FALSE) + + junk = product( Lumencor, IR.blocker, Hoya, cameraRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + cat( "-------------- M * ... * M * R_M ------------------\n" ) + junk = product( IR.blocker, Rosco, scannerRGB, wave='auto' ) # junk should be a 42 x 3 matrix + if( is.null(junk) ) return(FALSE) + if( ! all( dim(junk) == c(42,3) ) ) return(FALSE) + + junk = product( IR.blocker, Hoya, IR.blocker, Rosco, scannerRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + + # some invalid sequences + cat( "-------------- M * ... * M * L ------------------\n" ) + junk = product( IR.blocker, Hoya, Hematoxylin, D50.5nm, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + cat( "-------------- M * ... * L * M ------------------\n" ) + junk = product( IR.blocker, Hoya, D50.5nm, Hematoxylin, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + cat( "-------------- L * L * R_L ------------------\n" ) + junk = product( D50.5nm, D65.1nm, cameraRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + cat( "-------------- L * R_M ------------------\n" ) + junk = product( D50.5nm, scannerRGB, wave='auto' ) # this should fail + if( ! is.null(junk) ) return(FALSE) + + + cat( "\nPassed all product tests !\n" ) + + return( TRUE ) + } > > > if( ! testProducts() ) stop( "testProducts() failed !" ) [1] "/home/hornik/tmp/CRAN_recheck/colorSpec.Rcheck/tests" -------------- M * ... * M ------------------ spectra = [1] 4 42 Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testProducts ... lapply -> FUN -> structure -> do.call -> Execution halted Running the tests in ‘tests/test-read.R’ failed. Complete output: > > library( colorSpec ) Attaching colorSpec. Version: 1.8-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:28:20 UTC; unix > > > testAllReads <- function() + { + # find the extdata folder + if( grepl( "[..]Rcheck", getwd() ) ) + extdata = "../colorSpec/extdata" + else + extdata = "inst/extdata" + + extdata = system.file( "extdata", package="colorSpec" ) # override + + if( ! file.exists( extdata ) ) + { + print( getwd() ) + print( extdata ) + cat( "Cannot find the extdata folder !\n" ) + return(FALSE) + } + + print( extdata ) + + pathvec = list.files( extdata, recursive=TRUE, full.names=TRUE ) #; print( pathvec ) + + # ignore some file extensions + pattern1 = "[.](png|jpg|xls|m|htm|html|ti3)$" + mask1 = grepl( pattern1, pathvec, ignore.case=TRUE ) + + pattern2 = "^dataCCT|^illuminant" + mask2 = grepl( pattern2, basename(pathvec), ignore.case=TRUE ) + + pathvec = pathvec[ ! (mask1 | mask2) ] + + mess = sprintf( "Found %d files, reading them all...\n", length(pathvec) ) + cat( mess ) + + cs.options( stoponerror=TRUE ) + + for( i in 1:length(pathvec) ) + { + path = pathvec[i] + + mess = sprintf( "-------------- %s ------------------\n", basename(path) ) + cat(mess) + + junk = readSpectra( path, 400:700 ) + + if( is.null(junk) || ! is.colorSpec(junk) ) + return(FALSE) + } + + return(TRUE) + } > > > > checkQuantity <- function() + { + # find the extdata folder + if( grepl( "[..]Rcheck", getwd() ) ) + extdata = "../colorSpec/extdata" + else + extdata = "inst/extdata" + + extdata = system.file( "extdata", package="colorSpec" ) # override + + if( ! file.exists( extdata ) ) + { + print( getwd() ) + print( extdata ) + cat( "Cannot find the extdata folder !\n" ) + return(FALSE) + } + + testdata = c( + "illuminants/D65.1nm.txt", "energy", + "illuminants/C.txt", "energy", + "illuminants/daylight1964.txt", "energy", + "sources/BlueFlame.txt", "energy", + "sources/pos1-20x.scope", "energy", + + + "eyes/ciexyz31_1.csv", "energy->neural", + "eyes/ciexyz64_1.csv", "energy->neural", + "eyes/xyz2012.csv", "energy->neural", + + # "../inst/extdata/cameras/Flea2-spectral.txt", "power->electrical", + "cameras/orthicon-5820-A.txt", "energy->electrical", + # "cameras/Red-Epic-Dragon.txt", "energy->electrical", cannot bind, unless resampled + "cameras/Zyla_sCMOS.txt", "photons->electrical", + + "action/BeanPhotosynthesis.txt", "photons->action", + "action/moths.txt", "energy->action", + + "objects/Hoya.txt", "transmittance", + "objects/Rosco.txt", "transmittance", + "objects/Midwest-SP700-2014.txt", "transmittance", + + "targets/CC_Avg20_spectrum_XYY.txt", "reflectance", + "targets/N130501.txt", "transmittance", + "stains/Hematoxylin.txt", "absorbance", + + "scanners/SMPTE-ST-2065-2.txt", "material->electrical" + ) + + ok = TRUE + + testdata = matrix( testdata, length(testdata)/2, 2, byrow=T ) + + for( i in 1:nrow(testdata) ) + { + path = file.path( extdata, testdata[i,1] ) + + mess = sprintf( "-------------- %s ------------------\n", basename(path) ) + cat(mess) + + junk = readSpectra( path ) + + if( is.null(junk) ) + { + ok = FALSE + break + } + + quantity = quantity(junk) + mess = sprintf( "quantity='%s'\n", quantity ) + cat(mess) + + if( quantity(junk) != testdata[i,2] ) + { + mess = sprintf( "'%s' != '%s'\n", testdata[i,2], quantity(junk) ) + cat(mess) + ok = FALSE + break + } + } + + if( TRUE ) + { + path = file.path( extdata, "cameras/Flea2-spectral.txt" ) + mess = sprintf( "-------------- %s ------------------\n", basename(path) ) + cat(mess) + junk = readSpectra( path, 400:700, span=0.20 ) + + if( quantity(junk) == "energy->electrical" ) + { + # print( summary(junk) ) + } + else + { + mess = sprintf( "%s. '%s' != '%s'\n", path, "energy->electrical", quantity(junk) ) + cat(mess) + ok = FALSE + } + } + + + # one of next calls should fail and return NULL, so disable stopping + cs.options( stoponerror=FALSE ) + + for( path in c("test-combo1.txt","test-combo2.txt") ) + { + mess = sprintf( "-------------- %s ------------------\n", basename(path) ) + cat(mess) + junk = readSpectra( path ) # this SHOULD FAIL + if( ! is.null(junk) ) return(FALSE) + + junk = readSpectra( path, 400:700 ) # this should succeed + if( is.null(junk) ) return(FALSE) + } + + print( warnings() ) + + cs.options( stoponerror=TRUE ) + + return( ok ) + } > > if( ! testAllReads() ) stop( "testAllReads() failed !" ) [1] "/home/hornik/tmp/CRAN_recheck/colorSpec.Rcheck/colorSpec/extdata" Found 84 files, reading them all... -------------- BeanPhotosynthesis.txt ------------------ -------------- Photosynthesis-DIN5031-10.txt ------------------ -------------- moths.txt ------------------ -------------- Falcon-spectral.txt ------------------ -------------- Flea2-spectral.txt ------------------ -------------- FoveonX3.txt ------------------ -------------- Plumbicon30mm.txt ------------------ -------------- Red-Epic-Dragon.txt ------------------ -------------- Toshiba-TCD2712DG-spectral.txt ------------------ -------------- Zyla_sCMOS.txt ------------------ -------------- camera-EBU2012.txt ------------------ -------------- orthicon-5820-A.txt ------------------ -------------- BeeEye.txt ------------------ -------------- BirdEyes.txt ------------------ -------------- LensAbsorbance1987.txt ------------------ -------------- Osmia-rufa.txt ------------------ -------------- ciexyz31.csv ------------------ -------------- ciexyz31_1.csv ------------------ -------------- ciexyz64.csv ------------------ -------------- ciexyz64_1.csv ------------------ -------------- lms1971.txt ------------------ -------------- lms2000.1nm.csv ------------------ -------------- lms2000.5nm.csv ------------------ -------------- photopic1924.1nm.csv ------------------ -------------- photopic1978.1nm.csv ------------------ -------------- photopic2008.1nm.csv ------------------ -------------- scotopic1951.1nm.csv ------------------ -------------- xyz1931.5nm.txt ------------------ -------------- xyz1964.5nm.txt ------------------ -------------- xyz1978.txt ------------------ -------------- xyz2012.csv ------------------ -------------- A.1nm.txt ------------------ -------------- ACDs.5nm.txt ------------------ -------------- ASTMG173.txt ------------------ -------------- B.txt ------------------ -------------- C.txt ------------------ -------------- D65.1nm.txt ------------------ -------------- D65.5nm.txt ------------------ -------------- Fs.5nm.txt ------------------ -------------- daylight1964.txt ------------------ -------------- daylight2013.txt ------------------ -------------- solar.exposure.txt ------------------ -------------- sunlight.txt ------------------ -------------- Dupont.txt ------------------ -------------- Hoya.txt ------------------ -------------- Krinov.txt ------------------ -------------- Midwest-SP700-2014.txt ------------------ -------------- NCSU.txt ------------------ -------------- Rosco.txt ------------------ -------------- sunglasses.txt ------------------ -------------- SMPTE-ST-2065-2.txt ------------------ -------------- Airam-GR8E.txt ------------------ -------------- BlueFlame.txt ------------------ -------------- Cree-LED.txt ------------------ -------------- F96T12-GR8D.txt ------------------ -------------- Gepe-G-2001-LED.sp ------------------ Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testAllReads ... lapply -> FUN -> structure -> do.call -> Execution halted Running the tests in ‘tests/test-sink.R’ failed. Complete output: > > library( colorSpec ) Attaching colorSpec. Version: 1.8-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:28:20 UTC; unix > > testSink <- function() + { + cs.options( stop=FALSE ) + + path = 'junk.log' + + # start the sink + con = file( path, open = "wt") + sink( file=con, append=FALSE, type="message" ) + + # read 2 non-existent files + readSpectra( "nonexistent.txt" ) + readSpectra( "nonexistent2.txt" ) + + # stop the sink + sink( NULL, type='message' ) + close( con ) + + cs.options( stop=TRUE ) + + # path should have 4 lines in it + line = readLines( path ) #; cat( length(line), '\n' ) + + ok = length(line) == 4 + if( ! ok ) + { + cat( "bad file:\n" ) + cat( line, sep='\n' ) + } + + return( ok ) + } > > > if( ! testSink() ) stop( "testSink() failed !" ) Package: munsellinterpol Check: tests New result: ERROR Running ‘test-ISCC-NBS.R’ [0s/0s] Running ‘test-VandY.R’ [1s/1s] Running ‘test-conversions.R’ [37s/37s] Running ‘test-poly.R’ [1s/1s] Running ‘test-rounding.R’ [0s/0s] Running ‘test-transforms.R’ [58s/58s] Running the tests in ‘tests/test-rounding.R’ failed. Complete output: > > library( munsellinterpol ) > > options( width=144 ) > > # > # checkColorLookup() > # performs lookup with ColorBlockFromMunsell() and verifies that the color block number is correct > # > # return value: TRUE or FALSE > # > testRounding <- function( count=100 ) + { + set.seed(0) + + # make hues that are in the book + countbad = 0 + + # make vector of Hues that actually appear in the soil book + hueseq = c( seq(5,25,by=2.5), seq(30,75,by=5) ) + + for( hue in hueseq ) + { + mess = sprintf( "------------------- Hue %s ---------------------\n", HueStringFromNumber(hue) ) + cat( mess ) + + HVC = cbind( hue, runif(count,min=2,max=8), runif(count,min=1,max=8) ) + + dat = roundHVC( HVC, book='soil' ) + + # hopefully all the rounded hues are hue + HVCrnd = HVCfromMunsellName( dat$MunsellRnd ) + maskbad = HVCrnd[ ,1] != hue + + if( any(maskbad) ) + { + print( dat[maskbad, ] ) + countbad = countbad + sum(maskbad) + + # return(FALSE) + } + } + + # calculate fraction of bad ones + fractionbad = countbad / ( count*length(hueseq) ) + + + cat( "bad count: ", countbad, " of ", count*length(hueseq), " Fraction bad = ", fractionbad, '\n' ) + + return( fractionbad < 0.02 ) + } > > > if( ! testRounding() ) stop( "testRounding() failed !\n" ) ------------------- Hue 5R --------------------- Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testRounding ... lapply -> FUN -> structure -> do.call -> Execution halted Package: spacesRGB Check: examples New result: ERROR Running examples in ‘spacesRGB-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: composition > ### Title: The composition of TransferFunction objects > ### Aliases: composition composition.TransferFunction *.TransferFunction > ### %X%.TransferFunction %;%.TransferFunction %O%.TransferFunction %X% > ### %;% %O% is.identity is.identity.TransferFunction identity.TF > > ### ** Examples > > comp = power.OOTF(2.2) * power.OOTF(1.4) Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: *.TransferFunction ... lapply -> FUN -> structure -> do.call -> Execution halted Package: spacesRGB Check: tests New result: ERROR Running ‘test-ACES.R’ [1s/1s] Running ‘test-conversions.R’ [6s/6s] Running ‘test-installation.R’ [0s/0s] Running ‘test-plots.R’ [0s/0s] Running the tests in ‘tests/test-ACES.R’ failed. Complete output: > > > if( 1 ) + { + library( spacesRGB ) + # ls(2) + } > options( width=128 ) > > cat( 'getwd=', getwd(), '\n' ) getwd= /home/hornik/tmp/CRAN_recheck/spacesRGB.Rcheck/tests > path = "CGATS.RR" # system.file( "CGATS.R", package='spacesRGB' ) > file.info( path ) size isdir mode mtime ctime atime uid gid uname grname CGATS.RR 20696 FALSE 644 2025-09-09 10:29:49 2025-09-09 10:29:49 2025-09-09 10:29:49 1001 100 hornik users > source( path ) > > > options( width=256 ) > > printf <- function( msg, ... ) + { + mess = sprintf( msg[1], ... ) # should this really be msg[1] ? + cat( mess, '\n' ) #, file=stderr() ) + } > > testACES <- function( path="test_values.txt", tol.RGB=1e-5, tol.XYZ=5e-3, tol.RGBsce=5e-5, subset=NULL, redmod='1.1' ) + { + data = readCGATS( path ) + if( is.null(data) ) return(NULL) + + n = length(data) + out = list() #vector(n,mode='list') + # names(out) = names(data) + + invalid = integer(0) + + for( i in 1:n ) + { + theTable = data[[i]] + + m = nrow(theTable) + + theName = names(data)[i] + + theOETF = NULL + theEOTF = NULL + theOOTF = NULL + + if( ! is.null(subset) && ! theName %in% subset ) next # ignore this table + + if( theName == '5.1' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3D60_PRI, Ymax=48 ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3D60_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.2' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3D65_PRI, Ymax=48 ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3D65_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.3' ) + { + # set observerWP to D60 so there is no CAT + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3D65_PRI, Ymax=48, observer=P3D60_PRI[4,] ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3D65_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.4' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3D65_PRI, Ymax=48, limiting_pri=REC709_PRI ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3D65_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.5' ) + { + # set observerWP to D60 so there is no CAT + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3DCI_PRI, Ymax=48, observer=P3D60_PRI['W',] ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3DCI_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.6' ) + { + # set observerWP to D65 so there IS a CAT + theOETF = general.RRT( redmod=redmod ) * general.PODT( P3DCI_PRI, Ymax=48, observer=P3D65_PRI['W',] ) * power.OETF( 2.6 ) + theEOTF = power.EOTF( 2.6 ) + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF( P3DCI_PRI, 48 ) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.7' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( NULL, Ymax=48 ) * DCDM.EOTF^-1 + theEOTF = DCDM.EOTF + #aces2signal = theOETF + #signal2XYZ = theEOTF * affine.TF(0,48) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.8' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( NULL, Ymax=48, limiting_pri=P3D60_PRI ) * DCDM.EOTF^-1 + theEOTF = DCDM.EOTF + #aces2signal = theOETF + #signal2XYZ = theEOTF * affine.TF(0,48) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '5.9' ) + { + theOETF = general.RRT( redmod=redmod ) * general.PODT( NULL, Ymax=48, limiting_pri=P3D65_PRI ) * DCDM.EOTF^-1 + theEOTF = DCDM.EOTF + #aces2signal = theOETF + #signal2XYZ = theEOTF * affine.TF(0,48) + #aces2XYZ = aces2signal * signal2XYZ + } + + else if( theName == '6.1' ) + { + # Rec709 - 100 nit + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC709_PRI, Ymax=100, surround='dim' ) * BT.1886.EOTF()^-1 + theEOTF = BT.1886.EOTF() + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC709_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '6.2' ) + { + # Rec709 D60sim - 100 nit + # set observerWP to D60 so there is NO CAT + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC709_PRI, Ymax=100, observer=P3D60_PRI['W',], surround='dim' ) * BT.1886.EOTF()^-1 + theEOTF = BT.1886.EOTF() + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC709_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '6.3' ) + { + # Rec2020 - 100 nit + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC2020_PRI, Ymax=100, surround='dim' ) * BT.1886.EOTF()^-1 + theEOTF = BT.1886.EOTF() + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '6.4' ) + { + # Rec2020 - (P3-D65 Limited) 100 nit + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC2020_PRI, Ymax=100, limit=P3D65_PRI, surround='dim' ) * BT.1886.EOTF()^-1 + theEOTF = BT.1886.EOTF() + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '6.5' ) + { + # Rec2020 - (Rec709 Limited) 100 nit + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC2020_PRI, Ymax=100, limit=REC709_PRI, surround='dim' ) * BT.1886.EOTF()^-1 + theEOTF = BT.1886.EOTF() + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + + else if( theName == '7.1' ) + { + # sRGB - 100 nit + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC709_PRI, Ymax=100, surround='dim' ) * sRGB.EOTF^-1 #; print( str(theOETF) ) + theEOTF = sRGB.EOTF + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC709_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + else if( theName == '7.2' ) + { + # sRGB D60sim - 100 nit + # set observerWP to D60 so there is NO CAT + theOETF = general.RRT( redmod=redmod ) * general.PODT( REC709_PRI, Ymax=100, observer=P3D60_PRI['W',], surround='dim' ) * sRGB.EOTF^-1 + theEOTF = sRGB.EOTF + #aces2signal = theOETF + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC709_PRI,100) + #aces2XYZ = aces2signal * signal2XYZ + } + + + else if( theName == '8.1' ) + { + theOOTF = general.OOTF( disp=P3D65_PRI, Ymid=7.2, Ymax=108, redmod=redmod ) #* affine.TF(0,108) + theEOTF = PQ.EOTF(10000/108) + #aces2signal = theOOTF * theEOTF^-1 + #aces2XYZ = theOOTF * XYZfromRGB.TF(P3D65_PRI,108) + #signal2XYZ = theEOTF * XYZfromRGB.TF(P3D65_PRI,108) # * affine.TF(0,108)^-1 * XYZfromRGB.TF(P3D65_PRI,108) + } + else if( theName == '9.1' ) + { + theOOTF = general.OOTF( disp=REC2020_PRI, Ymid=15, Ymax=1000, redmod=redmod ) #* affine.TF( 0, 1000 ) + theEOTF = PQ.EOTF(10000/1000) + #aces2signal = theOOTF * theEOTF^-1 + #aces2XYZ = theOOTF * XYZfromRGB.TF(REC2020_PRI,1000) + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,1000) + } + else if( theName == '9.2' ) + { + theOOTF = general.OOTF( disp=REC2020_PRI, Ymid=15, Ymax=2000, redmod=redmod ) #* affine.TF( 0, 2000 ) + theEOTF = PQ.EOTF(10000/2000) + #aces2signal = theOOTF * theEOTF^-1 + #aces2XYZ = theOOTF * XYZfromRGB.TF(REC2020_PRI,2000) + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,2000) + } + else if( theName == '9.3' ) + { + theOOTF = general.OOTF( disp=REC2020_PRI, Ymid=15, Ymax=4000, redmod=redmod ) #* affine.TF( 0, 4000 ) + theEOTF = PQ.EOTF(10000/4000) + #aces2signal = theOOTF * theEOTF^-1 + #aces2XYZ = theOOTF * XYZfromRGB.TF(REC2020_PRI,4000) + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,4000) + } + else if( theName == '9.4' ) + { + theOOTF = general.OOTF( disp=REC2020_PRI, Ymid=15, Ymax=1000, redmod=redmod ) + hlg.OETF = HLG.OETF() + theEOTF = hlg.OETF^-1 * HLG.OOTF(Lw=1000/1000) + #aces2signal = theOOTF * theEOTF^-1 + #aces2XYZ = theOOTF * XYZfromRGB.TF(REC2020_PRI,1000) + #signal2XYZ = theEOTF * XYZfromRGB.TF(REC2020_PRI,1000) + } + else + { + printf( "WARN. Table '%s' unknown.", theName ) + next + } + + # make a space called 'testACES' + # display primaries and whitepoint not necessary because they are in the metadata + spacename = 'testACES' + if( ! is.null(theOETF) && ! is.null(theEOTF) ) + ok = installRGB( spacename, scene=AP0_PRI, OETF=theOETF, EOTF=theEOTF, overwrite=TRUE ) + else if( ! is.null(theOOTF) && ! is.null(theEOTF) ) + ok = installRGB( spacename, scene=AP0_PRI, OOTF=theOOTF, EOTF=theEOTF, overwrite=TRUE ) + else + { + printf( "ERROR. Bad transfer functions." ) + return(NULL) + } + + if( ! ok ) + { + printf( "ERROR. Cannot install RGB space '%s'.", spacename ) + return(NULL) + } + + if( is.null(theOOTF) ) theOOTF = getRGB( spacename )$OOTF + + if( is.null(theOETF) ) theOETF = getRGB( spacename )$OETF + + + df = data.frame( row.names=theTable[ ,1] ) + + aces.ref = as.matrix( theTable[ ,2:4] ) + signal.ref = as.matrix( theTable[ ,5:7] ) + xyY.ref = as.matrix( theTable[ ,8:10] ) + XYZ.ref = as.matrix( spacesXYZ::XYZfromxyY( xyY.ref ) ) + + # for aces.ref, override + #aces.ref[4,1] = 0.4048 # R of patch 'R' + #aces.ref[7,1] = 0.5530 # R of patch 'C' + + + # compare computed signal to reference signal, the OETF + # signal = transfer( aces2signal, aces.ref ) + signal = SignalRGBfromLinearRGB( aces.ref, space=spacename )$RGB + df$delta.OETF = apply( abs(signal - signal.ref), 1, max ) + ok.OETF = df$delta.OETF < tol.RGB # all absolute here + df$status.OETF = ifelse( ok.OETF, 'pass', 'FAILED' ) + + # compare computed EOTF to reference EOTF + # XYZ = transfer( signal2XYZ, signal.ref, domaincheck=TRUE ) #; print( spacesXYZ::xyYfromXYZ(XYZ) ) + XYZ = XYZfromRGB( signal.ref, space=spacename, which='display' )$XYZ + delta.EOTF = abs(XYZ - XYZ.ref) # / XYZ.ref[ ,2] # 'relativize' delta.EOTF, the denominator is replicated + df$delta.EOTF = apply( delta.EOTF, 1, max ) + ok.EOTF = df$delta.EOTF < tol.XYZ + df$status.EOTF = ifelse( ok.EOTF, 'pass', 'FAILED' ) + + # compare computed OOTF to reference OOTF + # XYZ = transfer( aces2XYZ, aces.ref, domaincheck=TRUE ) + XYZ = XYZfromRGB( signal, space=spacename, which='display' )$XYZ + delta.OOTF = abs(XYZ - XYZ.ref) # / XYZ.ref[ ,2] # 'relativize' delta.OOTF, the denominator is replicated + df$delta.OOTF = apply( delta.OOTF, 1, max ) + ok.OOTF = df$delta.OOTF < tol.XYZ + df$status.OOTF = ifelse( ok.OOTF, 'pass', 'FAILED' ) + + + if( is.invertible(theOETF) ) + { + # compare computed aces to reference aces, the OETFinv + # aces = transfer( aces2signal^-1, signal.ref ) #; print( aces ) + aces = LinearRGBfromSignalRGB( signal.ref, space=spacename, which='scene' )$RGB + df$delta.OETFinv = apply( abs(aces - aces.ref), 1, max ) + ok.OETFinv = df$delta.OETFinv < tol.RGBsce # all absolute here + df$status.OETFinv = ifelse( ok.OETFinv, 'pass', 'FAILED' ) + } + else + ok.OETFinv = rep(TRUE,nrow(df)) + + + if( is.invertible(theEOTF) ) + { + # compare computed signal to reference signal, the EOTFinv + # signal = transfer( signal2XYZ^-1, XYZ.ref ) + signal = RGBfromXYZ( XYZ.ref, space=spacename, which='display' )$RGB + df$delta.EOTFinv = apply( abs(signal - signal.ref), 1, max ) + ok.EOTFinv = df$delta.EOTFinv < tol.RGB # all absolute here + df$status.EOTFinv = ifelse( ok.EOTFinv, 'pass', 'FAILED' ) + } + else + ok.EOTFinv = rep(TRUE,nrow(df)) + + + if( is.invertible(theOOTF) ) + { + # compare computed aces to reference aces, the OOTFinv + # aces = transfer( aces2XYZ^-1, XYZ.ref ) #; print( aces ) + # this takes 2 steps + signal = RGBfromXYZ( XYZ.ref, space=spacename, which='display' )$RGB + aces = LinearRGBfromSignalRGB( signal, space=spacename, which='scene' )$RGB + df$delta.OOTFinv = apply( abs(aces - aces.ref), 1, max ) + ok.OOTFinv = df$delta.OOTFinv < tol.RGBsce # all absolute here + df$status.OOTFinv = ifelse( ok.OOTFinv, 'pass', 'FAILED' ) + } + else + ok.OOTFinv = rep(TRUE,nrow(df)) + + + + + # combine into final status + status.final = ok.OETF & ok.EOTF & ok.OOTF & ok.OETFinv & ok.EOTFinv & ok.OOTFinv + df$status.final = ifelse( status.final, 'pass', 'FAILED' ) + + invalid[theName] = sum( ! status.final ) + + out[[ theName ]] = df + } + + # print( as.data.frame(invalid) ) + + return( out ) + } > > > if( 1 ) + { + # bump 2 tolerances from 5 to 6 + res = testACES( tol.XYZ=6e-3, tol.RGBsce=6e-5, redmod="1.1+pinv" ) + + if( is.null(res) ) stop( "testACES() failed ! returned NULL.", call.=FALSE ) + + # res is a list of data.frame's + listbad = list() + + for( theName in names(res) ) + { + df = res[[ theName ]] + ok = all( df$status.final == 'pass' ) + if( ! ok ) + listbad[[ theName ]] = df + } + + if( 0 < length(listbad) ) + { + print( listbad ) + + stop( "testACES() failed !", call.=FALSE ) + } + + printf( "\nPassed all ACES tests !" ) + } Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testACES ... lapply -> FUN -> structure -> do.call -> Execution halted Package: spacesXYZ Check: tests New result: ERROR Running ‘test-CCT.R’ [1s/1s] Running ‘test-DeltaE.R’ [0s/0s] Running ‘test-adaptations.R’ [0s/0s] Running ‘test-conversions.R’ [0s/0s] Running the tests in ‘tests/test-CCT.R’ failed. Complete output: > > > library( spacesXYZ ) Attaching spacesXYZ. Version: 1.6-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:30:29 UTC; unix > > options( width=144 ) > > printf <- function( msg, ... ) + { + mess = sprintf( msg[1], ... ) # should this really be msg[1] ? + cat( mess, '\n' ) #, file=stderr() ) + } > > > # temperature -> uv -> CCT should have a small difference > > testRoundtrips.uv <- function( locus='robertson' ) + { + printf( "\n--------------------- testRoundtrips.uv('%s') -----------------------", locus ) + + # mat = matrix( c('robertson','robertson', 'mccamy','mccamy', 'native','native' ), 3, 2, byrow=TRUE ) + strict = TRUE + + for( iso in c('robertson', 'mccamy','native' ) ) + { + if( iso == 'mccamy' ) + # 1710 is about as low as McCamy can go + temperature = c( 1710, seq(2000,33000,by=1000) ) + else + temperature = c( 1667, seq(2000,33000,by=1000), 75000, Inf ) + + uv = planckLocus( temperature, locus=locus, param=iso ) + if( any( is.na(uv) ) ) + { + printf( "planckLocus() failed for param='%s'. It returned some NAs", iso ) + print( uv ) + return(FALSE) + } + + CCTback = CCTfromuv( uv, isotherm=iso, locus=locus, strict=strict ) + if( any( is.na(CCTback) ) ) + { + printf( "CCTfromuv() failed for isotherm='%s'. It returned some NAs", iso ) + return(FALSE) + } + + delta = CCTback - temperature #; print(delta) + + # NaNs may come from Inf-Inf, so change them to 0s + delta[ is.nan(delta) ] = 0 + + #printf( "testRoundtrips.uv() param='%s' max(abs(delta))=%g", iso, max(abs(delta) ) ) + + tol = ifelse( iso=='native', 5.e-5, 5.e-2 ) + + if( tol < max(abs(delta)) ) + { + printf( "testRoundtrips.uv(). Round-trip failed for param='%s' and isotherm='%s'. max(abs(delta))=%g", + iso, iso, max(abs(delta)) ) + print(delta) + return(FALSE) + } + } + + printf( "testRoundtrips.uv('%s') passed.", locus ) + + return( TRUE ) + } > > > > > # temperature -> xy -> CCT should have a small difference > > testRoundtrips.xy <- function() + { + printf( "\n--------------------- testRoundtrips.xy() -----------------------" ) + + + strict = TRUE + + for( iso in c('robertson', 'mccamy','native' ) ) + { + if( iso == 'mccamy' ) + # 1710 is about as low as McCamy can go + temperature = c( 1710, seq(2000,33000,by=1000) ) + else + temperature = c( 1677, seq(2000,33000,by=1000), 75000, Inf ) + + xy = planckLocus( temperature, param=iso, space=1931 ) + if( any( is.na(xy) ) ) + { + printf( "xyfromTemperature() failed for param='%s'. It returned some NAs", iso ) + return(FALSE) + } + + CCTback = CCTfromxy( xy, isotherm=iso, strict=strict ) + if( any( is.na(CCTback) ) ) + { + printf( "CCTfromxy() failed for isotherm='%s'. It returned some NAs", iso ) + return(FALSE) + } + + delta = CCTback - temperature #; print(delta) + + # NaNs may come from Inf-Inf, so change them to 0s + delta[ is.nan(delta) ] = 0 + + + #printf( "testRoundtrips.xy() param='%s' max(abs(delta))=%g", iso, max(abs(delta) ) ) + + tol = ifelse( iso=='native', 5.e-5, 5.e-2 ) + + if( tol < max(abs(delta)) ) + { + printf( "testRoundtrips.xy(). Round-trip failed for param='%s' and isotherm='%s'. max(abs(delta))=%g", + iso, iso, max(abs(delta)) ) + print(delta) + return(FALSE) + } + } + + printf( "testRoundtrips.xy() passed." ) + + return( TRUE ) + } > > > testStrictness <- function( locus='robertson' ) + { + printf( "\n--------------------- testStrictness('%s') -----------------------", locus ) + + temperaturetest = c( 1800, seq(2000,33000,by=1000) ) + + for( delta in c(-0.051,0.051) ) # above and below + { + # make some uv points just outside the valid band above the locus. Though some will be outside the chromaticity diagram ! + uvoutside = planckLocus( temperaturetest, locus, param='native', Duv=delta ) # Duv + + #printf( "delta=%g", delta ) + #print( uvoutside ) + + for( isotherm in c('mccamy','robertson','native') ) + { + # first test with strict=FALSE, all should succeed. + CCT = CCTfromuv( uvoutside, isotherm=isotherm, locus=locus, strict=FALSE ) + + #print( CCT ) + + count = sum( is.na(CCT) ) + if( 0 < count ) + { + printf( "strict=FALSE test failed for %d of %d points too far from the locus. delta=%g", + count, length(CCT), delta ) + + return(FALSE) + } + + # now test with strict=TRUE, all should fail. + CCT = CCTfromuv( uvoutside, isotherm=isotherm, locus=locus, strict=TRUE ) + + #print( CCT ) + + count = sum( ! is.na(CCT) ) + if( 0 < count ) + { + printf( "strict=TRUE test failed for %d of %d points too far from the '%s' locus. delta=%g", + count, length(CCT), locus, delta ) + return(FALSE) + } + } + + } + + printf( "testStrictness('%s') passed.", locus ) + + return(TRUE) + } > > > > > if( ! testRoundtrips.uv('robertson') ) stop( "testRoundtrips.uv('robertson') failed !", call.=FALSE ) --------------------- testRoundtrips.uv('robertson') ----------------------- testRoundtrips.uv('robertson') passed. > > if( ! testRoundtrips.uv('precision') ) stop( "testRoundtrips.uv('precision') failed !", call.=FALSE ) --------------------- testRoundtrips.uv('precision') ----------------------- testRoundtrips.uv('precision') passed. > > if( ! testRoundtrips.xy() ) stop( "testRoundtrips.xy() failed !", call.=FALSE ) --------------------- testRoundtrips.xy() ----------------------- testRoundtrips.xy() passed. > > > if( ! testStrictness('precision') ) stop( "testStrictness('precision') failed !", call.=FALSE ) --------------------- testStrictness('precision') ----------------------- testStrictness('precision') passed. > > if( ! testStrictness('robertson') ) stop( "testStrictness('robertson') failed !", call.=FALSE ) # this one started to fail in Feb 2025, invest later --------------------- testStrictness('robertson') ----------------------- Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testStrictness ... lapply -> FUN -> structure -> do.call -> Execution halted Running the tests in ‘tests/test-conversions.R’ failed. Complete output: > > > library( spacesXYZ ) Attaching spacesXYZ. Version: 1.6-0. Author: Glenn Davis [aut, cre]. Built: R 4.6.0; ; 2025-09-09 08:30:29 UTC; unix > > options( width=144 ) > > printf <- function( msg, ... ) + { + mess = sprintf( msg[1], ... ) # should this really be msg[1] ? + cat( mess, '\n' ) #, file=stderr() ) + } > > # returns time in seconds, from an arbitrary origin > gettime <- function() + { + if( requireNamespace('microbenchmark') ) + return( microbenchmark::get_nanotime() * 1.e-9 ) + else + return( as.double( base::Sys.time() ) ) + } > > > testXYZ <- function() + { + printf( "--------------------- testXYZ() -----------------------" ) + + + # make random XYZs + set.seed(0) + count = 10000 + + XYZ = matrix( abs(rnorm(3*count)), ncol=3 ) + rownames(XYZ) = sprintf( "%04d", 1:count ) + + #------------------ xyY ---------------------## + time_start = gettime() + xyY = xyYfromXYZ( XYZ ) + XYZ.back = XYZfromxyY( xyY ) + time_elapsed = gettime() - time_start + + delta = rowSums( abs(XYZ - XYZ.back) ) + printf( "\nXYZ -> xyY -> XYZ max(delta)=%g %d round-trip samples at %g sec/sample", + max(delta), count, time_elapsed/count ) + + failures = sum( 5.e-15 < delta ) + + if( 0 < failures ) + { + idx = which.max(delta) + printf( "There were %d XYZ -> xyY -> XYZ failures. Max error = %g", + failures, delta[idx] ) + + df = data.frame( row.names=1 ) + df$XYZ = XYZ[idx, ,drop=FALSE] + df$xyY = xyY[idx, ,drop=FALSE] + df$XYZ.back = XYZ.back[idx, ,drop=FALSE] + print( df ) + + return(FALSE) + } + + # test pure black + black = c(0,0,0) + if( ! identical( black, as.numeric( XYZfromxyY( xyYfromXYZ(black) ) ) ) ) + { + printf( "XYZ -> xyY -> XYZ.back . pure black not preserved." ) + return(FALSE) + } + + # test rownames + if( ! identical( rownames(XYZ), rownames(XYZ.back) ) ) + { + printf( "XYZ -> xyY -> XYZ.back . rownames not preserved." ) + return(FALSE) + } + + + + #------------------ Lab ---------------------## + white = 'D50' + + time_start = gettime() + Lab = LabfromXYZ( XYZ, white ) + XYZ.back = XYZfromLab( Lab, white ) + time_elapsed = gettime() - time_start + + delta = rowSums( abs(XYZ - XYZ.back) ) + printf( "\nXYZ -> Lab -> XYZ max(delta)=%g %d round-trip samples at %g sec/sample", + max(delta), count, time_elapsed/count ) + + failures = sum( 5.e-14 < delta ) + + if( 0 < failures ) + { + idx = which.max(delta) + printf( "There were %d XYZ -> Lab -> XYZ failures. Max error = %g", + failures, delta[idx] ) + + df = data.frame( row.names=1 ) + df$XYZ = XYZ[idx, ,drop=FALSE] + df$Lab = Lab[idx, ,drop=FALSE] + df$XYZ.back = XYZ.back[idx, ,drop=FALSE] + print( df ) + + return(FALSE) + } + + # test pure black + white = 1:3 + black = c(0,0,0) + if( ! identical( black, as.numeric( XYZfromLab( LabfromXYZ(black,white), white ) ) ) ) + { + printf( "XYZ -> Lab -> XYZ.back . pure black not preserved." ) + return(FALSE) + } + + # test rownames + if( ! identical( rownames(XYZ), rownames(XYZ.back) ) ) + { + printf( "XYZ -> Lab -> XYZ.back . rownames not preserved." ) + return(FALSE) + } + + + + #------------------ Luv ---------------------## + white = 'D50' + + time_start = gettime() + Luv = LuvfromXYZ( XYZ, white ) + XYZ.back = XYZfromLuv( Luv, white ) + time_elapsed = gettime() - time_start + + delta = rowSums( abs(XYZ - XYZ.back) ) + printf( "\nXYZ -> Luv -> XYZ max(delta)=%g %d round-trip samples at %g sec/sample", + max(delta), count, time_elapsed/count ) + + failures = sum( 5.e-12 < delta ) + + if( 0 < failures ) + { + idx = which.max(delta) + printf( "There were %d XYZ -> Luv -> XYZ failures. Max error = %g", + failures, delta[idx] ) + + df = data.frame( row.names=1 ) + df$XYZ = XYZ[idx, ,drop=FALSE] + df$Luv = Luv[idx, ,drop=FALSE] + df$XYZ.back = XYZ.back[idx, ,drop=FALSE] + print( df ) + + return(FALSE) + } + + # test pure black + white = 1:3 + black = c(0,0,0) + if( ! identical( black, as.numeric( XYZfromLuv( LuvfromXYZ(black,white), white ) ) ) ) + { + printf( "XYZ -> Luv -> XYZ.back . pure black not preserved." ) + return(FALSE) + } + + # test rownames + if( ! identical( rownames(XYZ), rownames(XYZ.back) ) ) + { + printf( "XYZ -> Luv -> XYZ.back . rownames not preserved." ) + return(FALSE) + } + + return( TRUE ) + } > > > testPolars <- function() + { + printf( "\n--------------------- testPolars() -----------------------" ) + + + # make random XYZs + set.seed(0) + count = 10000 + + XYZ = matrix( abs(rnorm(3*count)), ncol=3 ) + rownames(XYZ) = sprintf( "%04d", 1:count ) + + #------------------ Lab ---------------------## + white = c(95,100,105) + Lab = LabfromXYZ( XYZ, white ) + + time_start = gettime() + LCHab = LCHabfromLab( Lab ) + Lab.back = LabfromLCHab( LCHab ) + time_elapsed = gettime() - time_start + + delta = rowSums( abs(Lab - Lab.back) ) + printf( "\nLab -> LCHab -> Lab max(delta)=%g %d round-trip samples at %g sec/sample", + max(delta), count, time_elapsed/count ) + + failures = sum( 5.e-12 < delta ) + + if( 0 < failures ) + { + idx = which.max(delta) + printf( "There were %d Lab -> LCHab -> Lab failures. Max error = %g", + failures, delta[idx] ) + + df = data.frame( row.names=1 ) + df$Lab = Lab[idx, ,drop=FALSE] + df$LCHab = LCHab[idx, ,drop=FALSE] + df$Lab.back = Lab.back[idx, ,drop=FALSE] + print( df ) + + return(FALSE) + } + + # test rownames + if( ! identical( rownames(Lab), rownames(Lab.back) ) ) + { + printf( "Lab -> LCHab -> Lab.back . rownames not preserved." ) + #print( rownames(Lab)[1:10] ) + #print( rownames(Lab.back)[1:10] ) + return(FALSE) + } + + # test 2 neutrals + for( L in c(0,50) ) + { + Lab = c(L,0,0) + if( ! identical( Lab, as.numeric( LabfromLCHab( LCHabfromLab(Lab) ) ) ) ) + { + printf( "Lab -> LCHab -> Lab.back. neutral L=%g not preserved.", L ) + return(FALSE) + } + } + + #------------------ Luv ---------------------## + white = c(95,100,105) + Luv = LuvfromXYZ( XYZ, white ) + + time_start = gettime() + LCHuv = LCHuvfromLuv( Luv ) + Luv.back = LuvfromLCHuv( LCHuv ) + time_elapsed = gettime() - time_start + + delta = rowSums( abs(Luv - Luv.back) ) + printf( "\nLuv -> LCHuv -> Luv max(delta)=%g %d round-trip samples at %g sec/sample", + max(delta), count, time_elapsed/count ) + + failures = sum( 5.e-12 < delta ) + + if( 0 < failures ) + { + idx = which.max(delta) + printf( "There were %d Luv -> LCHuv -> Luv failures. Max error = %g", + failures, delta[idx] ) + + df = data.frame( row.names=1 ) + df$Luv = Luv[idx, ,drop=FALSE] + df$LCHuv = LCHuv[idx, ,drop=FALSE] + df$Luv.back = Luv.back[idx, ,drop=FALSE] + print( df ) + + return(FALSE) + } + + # test rownames + if( ! identical( rownames(Luv), rownames(Luv.back) ) ) + { + printf( "Luv -> LCHuv -> Luv.back . rownames not preserved." ) + #print( rownames(Luv)[1:10] ) + #print( rownames(Luv.back)[1:10] ) + return(FALSE) + } + + # test 2 neutrals + for( L in c(0,50) ) + { + Luv = c(L,0,0) + if( ! identical( Luv, as.numeric( LuvfromLCHuv( LCHuvfromLuv(Luv) ) ) ) ) + { + printf( "Luv -> LCHuv -> Luv.back. neutral L=%g not preserved.", L ) + return(FALSE) + } + } + + + return(TRUE) + } > > > > x = gettime() # load microbenchmark > > if( ! testXYZ() ) stop( "testXYZ() failed !", call.=FALSE ) --------------------- testXYZ() ----------------------- XYZ -> xyY -> XYZ max(delta)=1.33227e-15 10000 round-trip samples at 2.02026e-07 sec/sample XYZ -> Lab -> XYZ max(delta)=3.7817e-15 10000 round-trip samples at 8.49679e-07 sec/sample XYZ -> Luv -> XYZ max(delta)=9.69336e-13 10000 round-trip samples at 5.86321e-07 sec/sample Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testXYZ ... lapply -> FUN -> structure -> do.call -> Execution halted Package: zonohedra Check: examples New result: ERROR Running examples in ‘zonohedra-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: rank > ### Title: Rank and Independence > ### Aliases: rank is_independent > > ### ** Examples > > # make a matroid with rank 3 > mat = matroid( classics.genlist[['RT']] ) > > > # the ground set itself should have rank 3 > rank( mat, getground(mat) ) [1] 3 > ## [1] 3 > > > # single points should have rank 1 (there are no loops) > rank( mat, as.list(getground(mat)) ) [1] 1 1 1 1 1 1 > ## [1] 1 1 1 1 1 1 > > # all hyperplanes should have rank 2 > rank( mat, gethyperplane(mat) ) [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > ## [1] 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 > > > # a point not in the ground set should have rank NA > # and the emtpy set should have rank 0 > rank( mat, list(100L,integer(0)) ) Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: rank ... lapply -> FUN -> structure -> do.call -> Execution halted Package: zonohedra Check: tests New result: ERROR Running ‘test-2trans.R’ [20s/20s] Running ‘test-duplicated.R’ [1s/1s] Running ‘test-invertcube.R’ [4s/4s] Running ‘test-matroid.R’ [1s/1s] Running ‘test-mesh3d.R’ [4s/4s] Running ‘test-zonogon.R’ [4s/4s] Running ‘test-zonohedron.R’ [24s/24s] Running ‘test-zonoseg.R’ [1s/1s] Running the tests in ‘tests/test-zonoseg.R’ failed. Complete output: > require( zonohedra, quiet=TRUE ) Package: zonohedra. Author: Glenn Davis. Version: 0.6-0. Built: R 4.6.0; x86_64-pc-linux-gnu; 2025-09-09 08:30:47 UTC; unix Attaching package: 'zonohedra' The following object is masked from 'package:base': rank > require( arrangements, quiet=TRUE ) > options( width=144 ) > > testZonosegInterior <- function( nonneg, tol=1.e-12 ) + { + set.seed(0) + + for( k in 1:20 ) + { + # make a random zonoseg + points = 100 + loops = 10 + + gen = rnorm(points) + + if( nonneg ) gen = abs(gen) + + idxloop = arrangements::combinations( points, loops, nsample=1 ) + gen[ idxloop ] = 0 + + zono = zonoseg( gen ) + if( is.null(zono) ) return(FALSE) + + # make random points in the segment + n = 100 + seg = getsegment(zono) + z = runif( n, min=seg[1], max=seg[2] ) + + pcube = invert( zono, z )$pcube + + zback = pcube %*% gen + + delta = zback - z #; cat( "range(delta) = ", range(delta), '\n' ) + + ok = all( abs(delta) <= tol ) + if( ! ok ) + { + cat( "testZonosegInterior(). ERR. range(delta) = ", range(delta), '\n' ) + return(FALSE) + } + } + + return(TRUE) + } > > > testZonosegExterior <- function( ) + { + set.seed(0) + + for( k in 1:20 ) + { + # make a random zonoseg + points = 100 + loops = 10 + + gen = rnorm(points) + + # if( nonneg ) gen = abs(gen) + + idxloop = arrangements::combinations( points, loops, nsample=1 ) + gen[ idxloop ] = 0 + + zono = zonoseg( gen ) + if( is.null(zono) ) return(FALSE) + + # make random points on either side of the segment + n = 50 + seg = getsegment(zono) + z = c( runif( n, min=seg[1]-1, max=seg[1] ) , runif( n, min=seg[2], max=seg[2]+1 ) ) + + pcube = invert( zono, z )$pcube + + ok = all( is.na(pcube) ) + if( ! ok ) + { + cat( "testZonosegExterior(). ERR. some cube values are finite.\n" ) + return(FALSE) + } + } + + return(TRUE) + } > > > testZonosegBoundary <- function( tol=1.e-12 ) + { + set.seed(0) + + for( k in 1:20 ) + { + # make a random zonoseg + points = 100 + loops = 10 + + gen = rnorm(points) + + idxloop = arrangements::combinations( points, loops, nsample=1 ) + gen[ idxloop ] = 0 + + zono = zonoseg( gen ) + if( is.null(zono) ) return(FALSE) + + # test both endpoints + z = getsegment(zono) + + pcube = invert( zono, z )$pcube + + zback = pcube %*% gen + + delta = zback - z #; cat( "range(delta) = ", range(delta), '\n' ) + + ok = all( abs(delta) <= tol ) + if( ! ok ) + { + cat( "testZonosegBoundary(). ERR. range(delta) = ", range(delta), '\n' ) + return(FALSE) + } + } + + return(TRUE) + } > > if( ! testZonosegInterior(TRUE) ) stop( "testZonosegInterior(TRUE) failed !" ) > > if( ! testZonosegInterior(FALSE) ) stop( "testZonosegInterior(FALSE) failed !" ) > > if( ! testZonosegExterior() ) stop( "testZonosegExterior() failed !" ) Error in layout(level, res$message, namespace = namespace, .logcall = substitute(.logcall), : unused argument (.timestamp = .timestamp) Calls: testZonosegExterior ... lapply -> FUN -> structure -> do.call -> Execution halted