? Mon, 14 Apr 2025 08:53:38 +0200
Emanuele Cordano <emanuele.cordano at gmail.com> ?????:
CRAN check were OK (frorr Windows) whereas in Debian a function
example elapses 5.326 seconds. I need to fix this. Most lines in
the examples are within \donttest{} brackets, so they should not be
executed by CRAN checks.
Nowadays, R CMD check --as-cran does run \donttest{} examples. (But not
without --as-cran or --run-donttest, and no automatic checks enable
--run-dontrun.)
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
get.geotop.inpts.keyword.value 1.406 0.027 5.326
It looks like most of the time was spent waiting to establish a new
connection (closer to 8 seconds on my computer). What does
system.time(example(get.geotop.inpts.keyword.value)) return for you? Is
it an option to download less files in the example?
Having examples that download data from the internet is somewhat
precarious for a CRAN package. One way to prevent intermittent
connectivity problems from failing your package checks is to make sure
that any time your package fails to download something from the Web, it
calls stop() with a classed error object (e.g. simpleError(...) with an
additional class "geotop_internet_error" attached). This makes it
possible to wrap your examples in tryCatch(..., geotop_internet_error =
function(e) { ... }), so that any connection errors do not cause your
examples to fail, but other errors are not swallowed.
--
Best regards,
Ivan