Skip to content

[R-pkg-devel] cran check about examples time

5 messages · Emanuele Cordano, Ivan Krylov, Tobias Fellinger +1 more

#
Dear list,

I'm submitting the following package. 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. The examples are useful to
understand the functions, as they are, should I include all examples lines
in \donttest{} or \dontrun{} ?
Do you have any suggestion or reference on this? CRAN message attached
below.

Thank you
Best
Emanuele Cordano

CRAN message:

Dear maintainer,

package geotopbricks_1.5.9.1.tar.gz does not pass the incoming checks
automatically, please see the following pre-tests (additional issue checks):
Windows: <
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/Windows/00check.log
Status: OK
Debian: <
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/Debian/00check.log
Status: 1 NOTE

Last released version's CRAN status: OK: 9, NOTE: 5
See: <https://CRAN.R-project.org/web/checks/check_results_geotopbricks.html>

CRAN Web: <https://cran.r-project.org/package=geotopbricks>

Please fix all problems and resubmit a fixed version via the webform.
If you are not sure how to fix the problems shown, please ask for help on
the R-package-devel mailing list:
<https://stat.ethz.ch/mailman/listinfo/r-package-devel>
If you are fairly certain the rejection is a false positive, please
reply-all to this message and explain.

More details are given in the directory:
<
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/
The files will be removed after roughly 7 days.

No strong reverse dependencies to be checked.

Best regards,
CRAN teams' auto-check service
Flavor: r-devel-windows-x86_64
Check: *, Result: OK


Flavor: r-devel-linux-x86_64-debian-gcc
Check: examples, Result: NOTE
  Examples with CPU (user + system) or elapsed time > 5s
                                  user system elapsed
  get.geotop.inpts.keyword.value 1.406  0.027   5.326
#
? Mon, 14 Apr 2025 08:53:38 +0200
Emanuele Cordano <emanuele.cordano at gmail.com> ?????:
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.)
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.
1 day later
#
Thanks
I  checked  system.time(example(get.geotop.inpts.keyword.value)) .  Elapsed
time varies on my machines between 6 and 3 seconds (see below) , mostly
lesser than 5 seconds. It extracts information from a set-up directory of
the GEOtop model. I cannot put an  GEOtop simulation folder within
"geotopbricks" package for obvious reasons and function example refers to
example GEOtop simulation folder available on an external ad hoc Github
repository.   I'm looking for a solution. Thanks for suggestions.

Best
Emanuele

 user  system elapsed
  2.991   0.024   5.532 > > >
system.time(example(get.geotop.inpts.keyword.value))

 user  system elapsed
  2.846   0.001   3.796
Il giorno lun 14 apr 2025 alle ore 13:34 Ivan Krylov <ikrylov at disroot.org>
ha scritto:

  
    
#
Dear Emanuele,

I checked one of the Notes. One of the examples of get.geotop.inpts.keyword.value that throws a NOTE has parts outside of donttest that seem to load data from an url which can lead to varying execution times depending on the server. Moreover the url seems not to work. (https://raw.githubusercontent.com/ecor/geotopbricks_doc/master/simulations/panola13_run2xC_test3)

If you want to load the data from the web, I'd also put this in a donttest section.

An alternative would be (if this makes sense for the example) to include the file in the package and load it with system.file in the examples. This should run faster and more reliable and be independent of changes to URLs outside of the repository. Beware of maximum package sizes though.

(I checked this with the current default branch on github.)

Hope this helps, best regards, Tobias

-----Urspr?ngliche Nachricht-----
Von: R-package-devel <r-package-devel-bounces at r-project.org> Im Auftrag von Emanuele Cordano
Gesendet: Montag, 14. April 2025 08:54
An: r-package-devel at r-project.org
Betreff: [EXTERN] [R-pkg-devel] cran check about examples time

[You don't often get email from emanuele.cordano at gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Dear list,

I'm submitting the following package. 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. The examples are useful to understand the functions, as they are, should I include all examples lines in \donttest{} or \dontrun{} ?
Do you have any suggestion or reference on this? CRAN message attached below.

Thank you
Best
Emanuele Cordano

CRAN message:

Dear maintainer,

package geotopbricks_1.5.9.1.tar.gz does not pass the incoming checks automatically, please see the following pre-tests (additional issue checks):
Windows: <
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/Windows/00check.log
Status: OK
Debian: <
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/Debian/00check.log
Status: 1 NOTE

Last released version's CRAN status: OK: 9, NOTE: 5
See: <https://cran.r-project.org/web/checks/check_results_geotopbricks.html>

CRAN Web: <https://cran.r-project.org/package=geotopbricks>

Please fix all problems and resubmit a fixed version via the webform.
If you are not sure how to fix the problems shown, please ask for help on the R-package-devel mailing list:
<https://stat.ethz.ch/mailman/listinfo/r-package-devel>
If you are fairly certain the rejection is a false positive, please reply-all to this message and explain.

More details are given in the directory:
<
https://win-builder.r-project.org/incoming_pretest/geotopbricks_1.5.9.1_20250413_174815/
The files will be removed after roughly 7 days.

No strong reverse dependencies to be checked.

Best regards,
CRAN teams' auto-check service
Flavor: r-devel-windows-x86_64
Check: *, Result: OK


Flavor: r-devel-linux-x86_64-debian-gcc
Check: examples, Result: NOTE
  Examples with CPU (user + system) or elapsed time > 5s
                                  user system elapsed
  get.geotop.inpts.keyword.value 1.406  0.027   5.326


______________________________________________
R-package-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel
[https://www.ages.at/fileadmin/Signatur/03_AGES_Mailsignatur2025_Zeichenflaeche_1-04.png]<https://www.ages.at/ages/one-health/one-health>

________________________________



Firma & Rechtsform: ?sterreichische Agentur f?r Gesundheit und Ern?hrungssicherheit GmbH

Sitz: Spargelfeldstra?e 191, 1220 Wien

Firmenbuchnummer: FN 223056z

Firmenbuchgericht: Handelsgericht Wien

Diese Nachricht und allf?llige angeh?ngte Dokumente sind vertraulich und nur f?r den/die Adressaten bestimmt. Sollten Sie nicht der beabsichtigte Adressat sein, ist jede Offenlegung, Weiterleitung oder sonstige Verwendung dieser Information nicht gestattet. In diesem Fall bitten wir, den Absender zu verst?ndigen und die Information zu vernichten. F?r ?bermittlungsfehler oder sonstige Irrt?mer bei ?bermittlung besteht keine Haftung.

Unsere Datenschutzerkl?rung finden Sie unter: Datenschutzerkl?rung<https://www.ages.at/datenschutzerklaerung>

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the material. The sender does not accept liability for any errors or omissions as a result of the transmission.

You can find our privacy policy at: privacy policy<https://www.ages.at/en/privacy>
#
Or set a web timeout and if not downloaded succesfully not run the code 
(i.e. condiationalize).

Best,
Uwe Ligges
On 17.04.2025 09:27, Fellinger Tobias wrote: