Re: [R-pkg-devel] \donttest{} and writing outputs to tempdir()
Make examples shorter so they can run faster. Wrapping everything in donttest means that running examples() does nothing, which is counterproductive. Techinically, vignettes are not tests or examples... but they do have the advantage that they don't have to run quickly. But that doesn't make a vignette a substitute for either examples or tests. As for writing to the wrong place, you should probably just double check. On June 1, 2021 9:39:43 PM PDT, Danielle Maeser wrote: >Hello, > >I received the following comments from a CRAN maintainer, and I don't >understand why they were an issue. I'd appreciate any insight you can >provide. > >Danielle > > > > > > > >*All your examples are wrapped in \donttest{} and therefore do not >gettested.Please unwrap the examples if that is feasible and if they >can >beexecuted in < 5 sec for each Rd file or create additionally small >toyexamples to allow automatic testing.* > >I don't think I can unwrap the examples in \donttest{} because they >cannot >be executed in <5 seconds for each Rd file, and the automatic testing >of >toy data is satisfied in the vignettes I provide for each function. >Therefore, I am not sure what change to make here. > > > > >*Please ensure that your functions do not write by default or in >yourexamples/vignettes/tests in the user's home filespace (including >thepackage directory and getwd()). This is not allowed by CRAN >policies.In >your examples/vignettes/tests you can write to tempdir().* > >Additionally, all of my vignettes write the output of each function to >tempdir(). Therefore, I am not sure why this is a problem. -- Sent from my phone. Please excuse my brevity. __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
Re: [R-pkg-devel] \donttest{} and writing outputs to tempdir()
Are you able to provide a link to your package? It's a bit hard to guess what's causing your examples etc to have these problems. On Wed, 2 Jun 2021 at 14:40, Danielle Maeser wrote: > > Hello, > > I received the following comments from a CRAN maintainer, and I don't > understand why they were an issue. I'd appreciate any insight you can > provide. > > Danielle > > > > > > > > *All your examples are wrapped in \donttest{} and therefore do not > gettested.Please unwrap the examples if that is feasible and if they can > beexecuted in < 5 sec for each Rd file or create additionally small > toyexamples to allow automatic testing.* > > I don't think I can unwrap the examples in \donttest{} because they cannot > be executed in <5 seconds for each Rd file, and the automatic testing of > toy data is satisfied in the vignettes I provide for each function. > Therefore, I am not sure what change to make here. > > > > > *Please ensure that your functions do not write by default or in > yourexamples/vignettes/tests in the user's home filespace (including > thepackage directory and getwd()). This is not allowed by CRAN policies.In > your examples/vignettes/tests you can write to tempdir().* > > Additionally, all of my vignettes write the output of each function to > tempdir(). Therefore, I am not sure why this is a problem. > -- > Ph.D. Student > Bioinformatics and Computational Biology > University of Minnesota > > [[alternative HTML version deleted]] > > __ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] \donttest{} and writing outputs to tempdir()
Hello, I received the following comments from a CRAN maintainer, and I don't understand why they were an issue. I'd appreciate any insight you can provide. Danielle *All your examples are wrapped in \donttest{} and therefore do not gettested.Please unwrap the examples if that is feasible and if they can beexecuted in < 5 sec for each Rd file or create additionally small toyexamples to allow automatic testing.* I don't think I can unwrap the examples in \donttest{} because they cannot be executed in <5 seconds for each Rd file, and the automatic testing of toy data is satisfied in the vignettes I provide for each function. Therefore, I am not sure what change to make here. *Please ensure that your functions do not write by default or in yourexamples/vignettes/tests in the user's home filespace (including thepackage directory and getwd()). This is not allowed by CRAN policies.In your examples/vignettes/tests you can write to tempdir().* Additionally, all of my vignettes write the output of each function to tempdir(). Therefore, I am not sure why this is a problem. -- Ph.D. Student Bioinformatics and Computational Biology University of Minnesota [[alternative HTML version deleted]] __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
[R-pkg-devel] Valgrind warning: invalid size of 4, is it due to a simple overrun?
Hello, I received a valgrind warning about my package, hutilscpp, from CRAN (thank you). I believe I've tracked down and fixed the problem, but I wasn't able to reproduce the error on rhub (including with --leak-check=full etc) so I'd like to know if I'm missing something. The valgrind warning is "Invalid write of size 4" and refers to this line https://github.com/HughParsonage/hutilscpp/blob/508f134b3f388653985eca372ed5f4f8b8eb3471/src/Cwhich_even.c#L43 the context for this line is: const double * xp = REAL(xx); for (R_xlen_t i = 0, j = 0; i < N; ++i) { int is_even = R_finite(xp[i]) && (fmod(xp[i], 2) == 0); ansp[j] = (int)(i + 1);// # < line 43 j += is_even; } where ansp is a pointer to an integer vector whose length is the number of "even" doubles in xx. I can see that the problem arises when the last even number occurs before the end of the vector xx, at which point j == length(ansp), yet the loop continues. I've amended the i < N in the for loop to (i < N && j < n_even) which I believe is sufficient, but obviously I thought it was ok before. I'd rather not resubmit only to discover that I've overlooked something else. As a supplementary question, does the valgrind check depend on the runtime values in the test suite or does it perform fuzz testing? In other words, do I need to add tests to reproduce? Best, Hugh. __ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel