Re: [R-pkg-devel] IFC package - Solaris error polygon edge not found (zero-width or zero-height?)

2021-09-24 Thread git demont
I had very hard time with this error. But I think I have solved it now.
I made several tests recently trying to identify where it came from.
This cryptic error was not random, I was able to reproduce it.

It only appeared on rhub  Oracle Solaris 10, x86, 32 bit, R-release and not
on rhub  Oracle Solaris 10, x86, 32 bit, R release, Oracle Developer Studio
12.6

It happened when I try to grid.draw a gtable object produced by
gridExtra::arrangeGrob
This gtable object is produced without any errors and consists of a lattice
plot (transformed with grob()) + a tableGrob() of a small matrix.

If I grid.draw the lattice plot (transformed with grob()) alone, I got no
error
If I grid.draw the tableGrob() alone, I got no error
However, when I tried to draw the combination of both, I was getting the
error:
grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y,  :
  polygon edge not found (zero-width or zero-height?)
Calls: [my function name] ...  -> heightDetails ->
heightDetails.text -> grid.Call

This error only occurred with one of the graphs I wanted to produce (number
5).
In my tests, I also included another graph (number 4) which did not lead to
any error.

Luckily, I found a blog by Dana Paige Seidel
https://www.danaseidel.com/2018-09-01-ATidySummer/ with a chapter called
"The bug of grid destiny" that pointed to scales "this particular error is
triggered when special characters are used in axis tick labels". This was
really helpful because the scale was indeed one of the differences between
graph4 and graph5.
graph5 has a log-like scale whereas graph4 has a linear scale. To further
test this I produced graph4 with a log-like scale and graph5 with a linear
scale and this time the error happened with graph4.

All this was a long quest, because each time I had to tweak my code,
reupload it to rhub and wait for the artifacts to look at all the print and
str, ... things I had to introduce to understand were the bug came from. By
the way, many thanks to rhub people for providing us their amazing platform
to test our packages !

Looking deeper at the scales... For log-like, several ticks are drawn but
only main ticks are labelled with values, whereas for linear all ticks that
are displayed are labelled.
In the log-like scale the labels of the non-main ticks were labelled with
"".

My guess was that in some circumstances those "" produced text grobs with
non.finite height that triggered the error. Replacing the "" by " " (with a
whitespace) solved the issue

Though, I still can't explain why this only happened on Solaris nor why the
error is not triggered when the plot is drawn alone without the tableGrob.

FWIW,
Yohann


On Thu, Sep 16, 2021 at 3:14 PM git demont  wrote:

> Replying to myself and with some additional investigations
>
> I just tried once again on rhub - Oracle Solaris 10, x86, 32 bit,
> R-release and got the same error with a conditional font family
> modification where when
> Sys.info()["sysname"] == "SunOS",
> - pdf(), family argument is set to its default value "Helvetica"
> - gridExtra::ttheme_default, base_family argument is se to its default
> value ""
> Otherwise, "serif" is used
>
> In addition, the error in solaris shares "polygon edge not found" lately
> reported by Iñaki Úcar
> Though, I don't have the warning part, and mine is not happening during
> vignette rebuilding
>
> 2021-Aug-10, [R-pkg-devel] "polygon edge not found" on macos-arm64
> >Dear CRAN maintainers,
> >
> >I see there's a new WARN on the recently added macos-arm64 platform
> >for quite a number of packages. Specifically, vignette rebuilding
> >fails with "polygon edge not found" (example in [1]). In addition,
> >there are a number of warnings like this:
> >
> >Warning in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) :
> > no font could be found for family "Arial"
> >
> >Is this something package authors should worry about in submissions?
> >
> >[1] https://cran.r-project.org/web/checks/check_results_simmer.html
>
> On Thu, Sep 16, 2021 at 12:15 PM git demont  wrote:
>
>> Hello community,
>>
>> I plan to submit a new version of IFC package to CRAN.
>>
>> I checked it locally, on win-builder and on rhub. Almost everything looks
>> OK except for:
>> - Debian Linux, R-devel, GCC ASAN/UBSAN
>> - Oracle Solaris 10, x86, 32 bit, R-release
>>
>> On Debian Linux, R-devel, GCC ASAN/UBSAN, I get a PREPERROR, I suspect it
>> is a false pos since it says that xml2 package can not be installed.
>> My main concern is about Oracle Solaris 10, x86, 32 bit, R-release where
>> the function ExportToReport leads to the error reported in the title see:
>> https://artifacts.r-hub.io/IFC_0.1.2.tar.gz-0e84aed564a1488894eb7e34990443af/IFC.Rcheck/IFC-Ex.Rout
>>
>> However I got no error on  Oracle Solaris 10, x86, 32 bit, R release,
>> Oracle Developer Studio 12.6
>>
>> Some googling points to https://github.com/tidyverse/ggplot2/issues/2252.
>> The code of ExportToReport, is here
>> https://github.com/gitdemont/IFC/blob/master/R/Expo

Re: [R-pkg-devel] LaTeX issues on r-devel-windows-x86_64-gcc10-UCRT?

2021-09-24 Thread Stephan Struckmann
Dear Tomas,

> thanks. The new results are now available and the patches issue was resolved.

geat work, thank you!

> 
> These results are still with MiKTeX 21.8, with some crashes (e.g. when 
> building the documentation for R), but it seems dataquieR is not affected. I 
> will downgrade to 21.6, which should resolve these - I've tested that in the 
> automated VM setup at
> https://svn.r-project.org/R-dev-web/trunk/WindowsBuilds/winutf8/ucrt3/vm.html

Indeed, dataquieR now doesn’t show any errors any more. If I find the time, 
I’ll try MikTeX 21.8 later today, maybe, I can examine the issues a bit deeper 
then.

Have a great day,

Stephan



signature.asc
Description: Message signed with OpenPGP
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Namespace is imported from in YAML header, but attracts Note that is is not imported from

2021-09-24 Thread John Maindonald
That is very helpful --- thank you
John

On Fri, 24 Sept 2021 at 17:42, Maëlle SALMON  wrote:

> Hello,
>
> It's better to get rid of this NOTE, by listing bookdown in
> VignetteBuilder and Suggests, not Imports see
> https://blog.r-hub.io/2020/06/03/vignettes/#infrastructure--dependencies-for-vignettes
> That's actually what you did in another package
> https://github.com/cran/gamclass/blob/master/DESCRIPTION (it's a
> coincidence I found a package of yours via code search in CRAN GitHub
> mirror :-) ).
>
> Maëlle.
>
>
> Den fredag 24 september 2021 03:00:57 CEST, John H Maindonald <
> jhmaindon...@gmail.com> skrev:
>
>
>
>
>
> On the Atlas and Linux builds of my package `qra` that has just been
> posted
> on CRAN, I am getting the message:
>
> > Namespace in Imports field not imported from: ‘bookdown’
> >  All declared Imports should be used.
>
> This, in spite of the fct that the YAML header in two of the Rmd files for
> the vignettes has:
>
> > output:
> >  bookdown::html_document2:
> >theme: cayman
>
> Do I need to worry about this?
>
> John Maindonald
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Roy Mendelssohn - NOAA Federal via R-package-devel
Hi All:

I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
problem is how to exit if there is a failure of accessing the resource,  I know 
it has been discussed here before,  but I just am not understanding what is 
desired to end properly. As I have been reminded:

'Packages which use Internet resources should fail gracefully with an 
informative message
if the resource is not available or has changed (and not give a check warning 
nor error).'

All internet calls are wrapped in 'try()'.  If that shows an error,  I  write a 
message to the screen about the error,  and call stop(), perhaps with a further 
message in that call.   Somehow this does not appear to meet the standard.
Can someone then please tell me what I should do instead.  The point is I have 
checked that the access to the internet resources has worked,  i have seen that 
it hasn't,  now what should be the steps to take to exit gracefully.

I also want to add to what others have said about the frustrations of dealing 
with Solaris.  I have spent a fair amount of time getting things to  work with 
Solaris which no one uses.  In this instance the package test is only failing 
on Solaris.   Not a good use of limited time IMO.

Thanks for any advice.

-Roy



**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Ben Bolker

  I think you're not supposed to stop().

  You should just proceed with the other tests (skipping any 
tests/examples that depend on access to the inaccessible internet 
resources, or values derived from the failing call, to work)


  Does that help?

On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel 
wrote:

Hi All:

I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
problem is how to exit if there is a failure of accessing the resource,  I know 
it has been discussed here before,  but I just am not understanding what is 
desired to end properly. As I have been reminded:

'Packages which use Internet resources should fail gracefully with an 
informative message
if the resource is not available or has changed (and not give a check warning 
nor error).'

All internet calls are wrapped in 'try()'.  If that shows an error,  I  write a 
message to the screen about the error,  and call stop(), perhaps with a further 
message in that call.   Somehow this does not appear to meet the standard.
Can someone then please tell me what I should do instead.  The point is I have 
checked that the access to the internet resources has worked,  i have seen that 
it hasn't,  now what should be the steps to take to exit gracefully.

I also want to add to what others have said about the frustrations of dealing 
with Solaris.  I have spent a fair amount of time getting things to  work with 
Solaris which no one uses.  In this instance the package test is only failing 
on Solaris.   Not a good use of limited time IMO.

Thanks for any advice.

-Roy



**
"The contents of this message do not reflect any position of the U.S. Government or 
NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel



--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
Graduate chair, Mathematics & Statistics

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Re :Re: Internet resources and Errors

2021-09-24 Thread Maëlle SALMON via R-package-devel
We've summarized some advice around graceful packages in this chapter of the 
HTTP testing in R book: https://books.ropensci.org/http-testing/graceful.html I 
hope this can help too! 
 
 
  Le ven., sept. 24, 2021 à 17:03, Ben Bolker a écrit:     I 
think you're not supposed to stop().

  You should just proceed with the other tests (skipping any 
tests/examples that depend on access to the inaccessible internet 
resources, or values derived from the failing call, to work)

  Does that help?

On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel 
wrote:
> Hi All:
> 
> I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
> problem is how to exit if there is a failure of accessing the resource,  I 
> know it has been discussed here before,  but I just am not understanding what 
> is desired to end properly. As I have been reminded:
> 
> 'Packages which use Internet resources should fail gracefully with an 
> informative message
> if the resource is not available or has changed (and not give a check warning 
> nor error).'
> 
> All internet calls are wrapped in 'try()'.  If that shows an error,  I  write 
> a message to the screen about the error,  and call stop(), perhaps with a 
> further message in that call.  Somehow this does not appear to meet the 
> standard.    Can someone then please tell me what I should do instead.  The 
> point is I have checked that the access to the internet resources has worked, 
>  i have seen that it hasn't,  now what should be the steps to take to exit 
> gracefully.
> 
> I also want to add to what others have said about the frustrations of dealing 
> with Solaris.  I have spent a fair amount of time getting things to  work 
> with Solaris which no one uses.  In this instance the package test is only 
> failing on Solaris.  Not a good use of limited time IMO.
> 
> Thanks for any advice.
> 
> -Roy
> 
> 
> 
> **
> "The contents of this message do not reflect any position of the U.S. 
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
> 
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 

-- 
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
Graduate chair, Mathematics & Statistics

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel
  

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Roy Mendelssohn - NOAA Federal via R-package-devel
Just so I am clear,  I should not call stop(),  but instead call a return() and 
return something or other  (there is nothing to skip to - it is doing a data 
download and either it works or it failed).  Is there a preferred something to 
return?  And it is okay to write a message to the screen?  

I should add that when I first ran into this awhile back I asked what "failed 
gracefully" means,  and never received a response.  To me,  writing out a 
message to the user and stopping is graceful exit, but obviously it is not.  
What would help then, since this problem has been cited by others, is more 
explicit guidelines as to what constitutes a graceful exit with examples.  My 
$0.02

-Roy



> On Sep 24, 2021, at 8:03 AM, Ben Bolker  wrote:
> 
>  I think you're not supposed to stop().
> 
>  You should just proceed with the other tests (skipping any tests/examples 
> that depend on access to the inaccessible internet resources, or values 
> derived from the failing call, to work)
> 
>  Does that help?
> 
> On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel wrote:
>> Hi All:
>> I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
>> problem is how to exit if there is a failure of accessing the resource,  I 
>> know it has been discussed here before,  but I just am not understanding 
>> what is desired to end properly. As I have been reminded:
>> 'Packages which use Internet resources should fail gracefully with an 
>> informative message
>> if the resource is not available or has changed (and not give a check 
>> warning nor error).'
>> All internet calls are wrapped in 'try()'.  If that shows an error,  I  
>> write a message to the screen about the error,  and call stop(), perhaps 
>> with a further message in that call.   Somehow this does not appear to meet 
>> the standard.Can someone then please tell me what I should do instead.  
>> The point is I have checked that the access to the internet resources has 
>> worked,  i have seen that it hasn't,  now what should be the steps to take 
>> to exit gracefully.
>> I also want to add to what others have said about the frustrations of 
>> dealing with Solaris.  I have spent a fair amount of time getting things to  
>> work with Solaris which no one uses.  In this instance the package test is 
>> only failing on Solaris.   Not a good use of limited time IMO.
>> Thanks for any advice.
>> -Roy
>> **
>> "The contents of this message do not reflect any position of the U.S. 
>> Government or NOAA."
>> **
>> Roy Mendelssohn
>> Supervisory Operations Research Analyst
>> NOAA/NMFS
>> Environmental Research Division
>> Southwest Fisheries Science Center
>> ***Note new street address***
>> 110 McAllister Way
>> Santa Cruz, CA 95060
>> Phone: (831)-420-3666
>> Fax: (831) 420-3980
>> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>> "Old age and treachery will overcome youth and skill."
>> "From those who have been given much, much will be expected"
>> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 
> -- 
> Dr. Benjamin Bolker
> Professor, Mathematics & Statistics and Biology, McMaster University
> Director, School of Computational Science and Engineering
> Graduate chair, Mathematics & Statistics
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Hiroaki Yutani
Hi,

Regarding Solaris, while the criteria is unknown, it seems Solaris can
be excluded from the CRAN check targets when there's a good reason not
to support Solaris. My package got a failure on Solaris check and I
resubmitted with the following comment, then Solaris disappeared from
the check results [1].

> I would like to request to exclude Solaris from the build targets because 
> Solaris is not a supported platform by Rust. This should be in line with the 
> treatments of other CRAN packages that use Rust; gifski, baseflow, and salso 
> are not built on Solaris. I'm sorry that I didn't write this in the first 
> submission.

Again, I'm not sure on what criteria they decided to accept my
suggestion. It's unclear if your package is the case. Some months ago,
I asked "How can I avoid Solaris build on CRAN?" on this mailing list
[2], but I got no reply. So, probably no one knows the right answer...

Best,
Hiroaki Yutani

[1]: https://cran.r-project.org/web/checks/check_results_string2path.html
[2]: https://stat.ethz.ch/pipermail/r-package-devel/2021q3/007262.html

2021年9月24日(金) 23:50 Roy Mendelssohn - NOAA Federal via R-package-devel
:


>
> Hi All:
>
> I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
> problem is how to exit if there is a failure of accessing the resource,  I 
> know it has been discussed here before,  but I just am not understanding what 
> is desired to end properly. As I have been reminded:
>
> 'Packages which use Internet resources should fail gracefully with an 
> informative message
> if the resource is not available or has changed (and not give a check warning 
> nor error).'
>
> All internet calls are wrapped in 'try()'.  If that shows an error,  I  write 
> a message to the screen about the error,  and call stop(), perhaps with a 
> further message in that call.   Somehow this does not appear to meet the 
> standard.Can someone then please tell me what I should do instead.  The 
> point is I have checked that the access to the internet resources has worked, 
>  i have seen that it hasn't,  now what should be the steps to take to exit 
> gracefully.
>
> I also want to add to what others have said about the frustrations of dealing 
> with Solaris.  I have spent a fair amount of time getting things to  work 
> with Solaris which no one uses.  In this instance the package test is only 
> failing on Solaris.   Not a good use of limited time IMO.
>
> Thanks for any advice.
>
> -Roy
>
>
>
> **
> "The contents of this message do not reflect any position of the U.S. 
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
>
> __
> 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


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Jeff Newmiller
Grace is in the eyes of the beholder.

Using stop in your functions can be perfectly valid. But within the context of 
examples or tests you need to catch those errors because one key definition of 
success in normal building of a package is that no uncaught errors occur. So 
either don't call those functions during package check, or catch the errors and 
move on. The former is probably best (no point in wasting time if you are going 
to ignore the failure anyway)... only run them interactively or when running 
full tests during development.


On September 24, 2021 8:27:32 AM PDT, Roy Mendelssohn - NOAA Federal via 
R-package-devel  wrote:
>Just so I am clear,  I should not call stop(),  but instead call a return() 
>and return something or other  (there is nothing to skip to - it is doing a 
>data download and either it works or it failed).  Is there a preferred 
>something to return?  And it is okay to write a message to the screen?  
>
>I should add that when I first ran into this awhile back I asked what "failed 
>gracefully" means,  and never received a response.  To me,  writing out a 
>message to the user and stopping is graceful exit, but obviously it is not.  
>What would help then, since this problem has been cited by others, is more 
>explicit guidelines as to what constitutes a graceful exit with examples.  My 
>$0.02
>
>-Roy
>
>
>
>> On Sep 24, 2021, at 8:03 AM, Ben Bolker  wrote:
>> 
>>  I think you're not supposed to stop().
>> 
>>  You should just proceed with the other tests (skipping any tests/examples 
>> that depend on access to the inaccessible internet resources, or values 
>> derived from the failing call, to work)
>> 
>>  Does that help?
>> 
>> On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel 
>> wrote:
>>> Hi All:
>>> I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
>>> problem is how to exit if there is a failure of accessing the resource,  I 
>>> know it has been discussed here before,  but I just am not understanding 
>>> what is desired to end properly. As I have been reminded:
>>> 'Packages which use Internet resources should fail gracefully with an 
>>> informative message
>>> if the resource is not available or has changed (and not give a check 
>>> warning nor error).'
>>> All internet calls are wrapped in 'try()'.  If that shows an error,  I  
>>> write a message to the screen about the error,  and call stop(), perhaps 
>>> with a further message in that call.   Somehow this does not appear to meet 
>>> the standard.Can someone then please tell me what I should do instead.  
>>> The point is I have checked that the access to the internet resources has 
>>> worked,  i have seen that it hasn't,  now what should be the steps to take 
>>> to exit gracefully.
>>> I also want to add to what others have said about the frustrations of 
>>> dealing with Solaris.  I have spent a fair amount of time getting things to 
>>>  work with Solaris which no one uses.  In this instance the package test is 
>>> only failing on Solaris.   Not a good use of limited time IMO.
>>> Thanks for any advice.
>>> -Roy
>>> **
>>> "The contents of this message do not reflect any position of the U.S. 
>>> Government or NOAA."
>>> **
>>> Roy Mendelssohn
>>> Supervisory Operations Research Analyst
>>> NOAA/NMFS
>>> Environmental Research Division
>>> Southwest Fisheries Science Center
>>> ***Note new street address***
>>> 110 McAllister Way
>>> Santa Cruz, CA 95060
>>> Phone: (831)-420-3666
>>> Fax: (831) 420-3980
>>> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>>> "Old age and treachery will overcome youth and skill."
>>> "From those who have been given much, much will be expected"
>>> "the arc of the moral universe is long, but it bends toward justice" -MLK 
>>> Jr.
>>> __
>>> R-package-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>> 
>> -- 
>> Dr. Benjamin Bolker
>> Professor, Mathematics & Statistics and Biology, McMaster University
>> Director, School of Computational Science and Engineering
>> Graduate chair, Mathematics & Statistics
>> 
>> __
>> R-package-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>
>**
>"The contents of this message do not reflect any position of the U.S. 
>Government or NOAA."
>**
>Roy Mendelssohn
>Supervisory Operations Research Analyst
>NOAA/NMFS
>Environmental Research Division
>Southwest Fisheries Science Center
>***Note new street address***
>110 McAllister Way
>Santa Cruz, CA 95060
>Phone: (831)-420-3666
>Fax: (831) 420-3980
>e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>
>"Old age and treachery will overcome youth and skill."
>"From those who have been given much, much will be expected" 
>"the arc of the moral universe is lon

Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Duncan Murdoch
On 24/09/2021 11:27 a.m., Roy Mendelssohn - NOAA Federal via 
R-package-devel wrote:

Just so I am clear,  I should not call stop(),  but instead call a return() and 
return something or other  (there is nothing to skip to - it is doing a data 
download and either it works or it failed).  Is there a preferred something to 
return?  And it is okay to write a message to the screen?


I don't think it matters what you return, as long as the caller 
understands that it didn't get any data.  If this is a function you 
export, make sure to describe that possibility in its help page.


As far as I know it's okay to use message() (or cat() or print(), but 
message() is preferred) to give your message, just not stop() or 
warning() -- those will signal a problem to CRAN that you should fix.


Duncan Murdoch



I should add that when I first ran into this awhile back I asked what "failed 
gracefully" means,  and never received a response.  To me,  writing out a message to 
the user and stopping is graceful exit, but obviously it is not.  What would help then, 
since this problem has been cited by others, is more explicit guidelines as to what 
constitutes a graceful exit with examples.  My $0.02

-Roy




On Sep 24, 2021, at 8:03 AM, Ben Bolker  wrote:

  I think you're not supposed to stop().

  You should just proceed with the other tests (skipping any tests/examples 
that depend on access to the inaccessible internet resources, or values derived 
from the failing call, to work)

  Does that help?

On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel wrote:

Hi All:
I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
problem is how to exit if there is a failure of accessing the resource,  I know 
it has been discussed here before,  but I just am not understanding what is 
desired to end properly. As I have been reminded:
'Packages which use Internet resources should fail gracefully with an 
informative message
if the resource is not available or has changed (and not give a check warning 
nor error).'
All internet calls are wrapped in 'try()'.  If that shows an error,  I  write a 
message to the screen about the error,  and call stop(), perhaps with a further 
message in that call.   Somehow this does not appear to meet the standard.
Can someone then please tell me what I should do instead.  The point is I have 
checked that the access to the internet resources has worked,  i have seen that 
it hasn't,  now what should be the steps to take to exit gracefully.
I also want to add to what others have said about the frustrations of dealing 
with Solaris.  I have spent a fair amount of time getting things to  work with 
Solaris which no one uses.  In this instance the package test is only failing 
on Solaris.   Not a good use of limited time IMO.
Thanks for any advice.
-Roy
**
"The contents of this message do not reflect any position of the U.S. Government or 
NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
Graduate chair, Mathematics & Statistics

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


**
"The contents of this message do not reflect any position of the U.S. Government or 
NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected"
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
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


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Roy Mendelssohn - NOAA Federal via R-package-devel
Thanks to all who replied.  I want to especially point out Maelle's response 
because as I said I am not the first person to raise this question in terms of 
accessing internet resources.  Yes,  graceful is in the eye of the beholder,  
which i why such guidelines are really helpful.

-Roy

> On Sep 24, 2021, at 8:59 AM, Duncan Murdoch  wrote:
> 
> On 24/09/2021 11:27 a.m., Roy Mendelssohn - NOAA Federal via R-package-devel 
> wrote:
>> Just so I am clear,  I should not call stop(),  but instead call a return() 
>> and return something or other  (there is nothing to skip to - it is doing a 
>> data download and either it works or it failed).  Is there a preferred 
>> something to return?  And it is okay to write a message to the screen?
> 
> I don't think it matters what you return, as long as the caller understands 
> that it didn't get any data.  If this is a function you export, make sure to 
> describe that possibility in its help page.
> 
> As far as I know it's okay to use message() (or cat() or print(), but 
> message() is preferred) to give your message, just not stop() or warning() -- 
> those will signal a problem to CRAN that you should fix.
> 
> Duncan Murdoch
> 
>> I should add that when I first ran into this awhile back I asked what 
>> "failed gracefully" means,  and never received a response.  To me,  writing 
>> out a message to the user and stopping is graceful exit, but obviously it is 
>> not.  What would help then, since this problem has been cited by others, is 
>> more explicit guidelines as to what constitutes a graceful exit with 
>> examples.  My $0.02
>> -Roy
>>> On Sep 24, 2021, at 8:03 AM, Ben Bolker  wrote:
>>> 
>>>  I think you're not supposed to stop().
>>> 
>>>  You should just proceed with the other tests (skipping any tests/examples 
>>> that depend on access to the inaccessible internet resources, or values 
>>> derived from the failing call, to work)
>>> 
>>>  Does that help?
>>> 
>>> On 9/24/21 10:49 AM, Roy Mendelssohn - NOAA Federal via R-package-devel 
>>> wrote:
 Hi All:
 I am getting dinged again on CRAN  (just Solaris for some reason),  and 
 the problem is how to exit if there is a failure of accessing the 
 resource,  I know it has been discussed here before,  but I just am not 
 understanding what is desired to end properly. As I have been reminded:
 'Packages which use Internet resources should fail gracefully with an 
 informative message
 if the resource is not available or has changed (and not give a check 
 warning nor error).'
 All internet calls are wrapped in 'try()'.  If that shows an error,  I  
 write a message to the screen about the error,  and call stop(), perhaps 
 with a further message in that call.   Somehow this does not appear to 
 meet the standard.Can someone then please tell me what I should do 
 instead.  The point is I have checked that the access to the internet 
 resources has worked,  i have seen that it hasn't,  now what should be the 
 steps to take to exit gracefully.
 I also want to add to what others have said about the frustrations of 
 dealing with Solaris.  I have spent a fair amount of time getting things 
 to  work with Solaris which no one uses.  In this instance the package 
 test is only failing on Solaris.   Not a good use of limited time IMO.
 Thanks for any advice.
 -Roy
 **
 "The contents of this message do not reflect any position of the U.S. 
 Government or NOAA."
 **
 Roy Mendelssohn
 Supervisory Operations Research Analyst
 NOAA/NMFS
 Environmental Research Division
 Southwest Fisheries Science Center
 ***Note new street address***
 110 McAllister Way
 Santa Cruz, CA 95060
 Phone: (831)-420-3666
 Fax: (831) 420-3980
 e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
 "Old age and treachery will overcome youth and skill."
 "From those who have been given much, much will be expected"
 "the arc of the moral universe is long, but it bends toward justice" -MLK 
 Jr.
 __
 R-package-devel@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-package-devel
>>> 
>>> -- 
>>> Dr. Benjamin Bolker
>>> Professor, Mathematics & Statistics and Biology, McMaster University
>>> Director, School of Computational Science and Engineering
>>> Graduate chair, Mathematics & Statistics
>>> 
>>> __
>>> R-package-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>> **
>> "The contents of this message do not reflect any position of the U.S. 
>> Government or NOAA."
>> **
>> Roy Mendelssohn
>> Supervisory Operations Research Analyst
>> NOAA/NMFS
>> Environmental Research Division
>> Southwest Fisheries Science Center
>> ***Note ne

Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Bill Dunlap
Can you tell if the failure to download was due to a Solaris-specific issue
or due to the Solaris test machine not being fully connected to the
internet?

-Bill

On Fri, Sep 24, 2021 at 7:50 AM Roy Mendelssohn - NOAA Federal via
R-package-devel  wrote:

> Hi All:
>
> I am getting dinged again on CRAN  (just Solaris for some reason),  and
> the problem is how to exit if there is a failure of accessing the
> resource,  I know it has been discussed here before,  but I just am not
> understanding what is desired to end properly. As I have been reminded:
>
> 'Packages which use Internet resources should fail gracefully with an
> informative message
> if the resource is not available or has changed (and not give a check
> warning nor error).'
>
> All internet calls are wrapped in 'try()'.  If that shows an error,  I
> write a message to the screen about the error,  and call stop(), perhaps
> with a further message in that call.   Somehow this does not appear to meet
> the standard.Can someone then please tell me what I should do instead.
> The point is I have checked that the access to the internet resources has
> worked,  i have seen that it hasn't,  now what should be the steps to take
> to exit gracefully.
>
> I also want to add to what others have said about the frustrations of
> dealing with Solaris.  I have spent a fair amount of time getting things
> to  work with Solaris which no one uses.  In this instance the package test
> is only failing on Solaris.   Not a good use of limited time IMO.
>
> Thanks for any advice.
>
> -Roy
>
>
>
> **
> "The contents of this message do not reflect any position of the U.S.
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
>
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected"
> "the arc of the moral universe is long, but it bends toward justice" -MLK
> Jr.
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Roy Mendelssohn - NOAA Federal via R-package-devel
Not off-hand.  it is weird that the only error is on Solaris.  I do test on the 
r-hub Solaris before submission.  But at the same time,  given some of the 
responses that I have received (which I thank) I probably don't meet the CRAN 
idea of "graceful".  Easy enough for me to change as I am catching these so 
just need to change what I do.

I have seen other posts where people comment that the Solaris test machine 
appears to have an internet connection a good bit slower or less reliable than 
other test machines,  so timeouts occur,  but I can't discern that with what I 
have.

-Roy



> On Sep 24, 2021, at 9:29 AM, Bill Dunlap  wrote:
> 
> Can you tell if the failure to download was due to a Solaris-specific issue 
> or due to the Solaris test machine not being fully connected to the internet?
> 
> -Bill
> 
> On Fri, Sep 24, 2021 at 7:50 AM Roy Mendelssohn - NOAA Federal via 
> R-package-devel  wrote:
> Hi All:
> 
> I am getting dinged again on CRAN  (just Solaris for some reason),  and the 
> problem is how to exit if there is a failure of accessing the resource,  I 
> know it has been discussed here before,  but I just am not understanding what 
> is desired to end properly. As I have been reminded:
> 
> 'Packages which use Internet resources should fail gracefully with an 
> informative message
> if the resource is not available or has changed (and not give a check warning 
> nor error).'
> 
> All internet calls are wrapped in 'try()'.  If that shows an error,  I  write 
> a message to the screen about the error,  and call stop(), perhaps with a 
> further message in that call.   Somehow this does not appear to meet the 
> standard.Can someone then please tell me what I should do instead.  The 
> point is I have checked that the access to the internet resources has worked, 
>  i have seen that it hasn't,  now what should be the steps to take to exit 
> gracefully.
> 
> I also want to add to what others have said about the frustrations of dealing 
> with Solaris.  I have spent a fair amount of time getting things to  work 
> with Solaris which no one uses.  In this instance the package test is only 
> failing on Solaris.   Not a good use of limited time IMO.
> 
> Thanks for any advice.
> 
> -Roy
> 
> 
> 
> **
> "The contents of this message do not reflect any position of the U.S. 
> Government or NOAA."
> **
> Roy Mendelssohn
> Supervisory Operations Research Analyst
> NOAA/NMFS
> Environmental Research Division
> Southwest Fisheries Science Center
> ***Note new street address***
> 110 McAllister Way
> Santa Cruz, CA 95060
> Phone: (831)-420-3666
> Fax: (831) 420-3980
> e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/
> 
> "Old age and treachery will overcome youth and skill."
> "From those who have been given much, much will be expected" 
> "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
> 
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel

**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Greg Minshall
Roy,

> All internet calls are wrapped in 'try()'.  If that shows an error, I
> write a message to the screen about the error, and call stop(),
> perhaps with a further message in that call.

out of ignorance, i ask ...

in your package's operational code ("its API", or whatever), when a
required internet access fails, i would think a message and a stop(),
might be the reasonable thing to do.

in examples or tests, either doing the access itself, or calling your
operational code, one might try() and not stop(), but, rather, go on to
the next example/test.

in your comment above, is the try()/stop() in your operational code or
in your tests/examples?

cheers, Greg

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] Tests run without --as-cran and not with

2021-09-24 Thread Jan van der Laan



I am trying solve an issue where my tests run fine when run with R CMD 
check, but not with R CMD check --as-cran. In the tests pandoc is called 
using system; pandoc then calls R again with a script which is part of 
the package. The last part seems to fail, see error message below:


  Running ‘test_mdweave.R’
 ERROR
Running the tests in ‘tests/test_mdweave.R’ failed.
Last 13 lines of output:
  > message("Weave file")
  Weave file
  > fn <- system.file(file.path("examples", md), package = "tinymarkdown")
  > mdweave(fn)
  Error running filter 
/home/eoos/git/tinymarkdown/work/tinymarkdown.Rcheck/tinymarkdown/scripts/filter.R:

  Filter returned error status 1
  >


As I mentioned, this only happend when testing with --as-cran. Without 
--as-cran the output is:


* checking tests ...
  Running ‘test_file_subs_ext.R’
  Running ‘test_mdtangle.R’
  Running ‘test_mdweave.R’
 OK
* checking for unstated dependencies in vignettes ... OK


Note that I already set the environment variable R_TEST to "" 
(https://github.com/r-lib/testthat/issues/144; I am not using testthat). 
This was also needed to get the check without --as-cran running.


One thing that I notice it that R_LIBS and R_LIBS_SITE between the two 
ways of running R CMD check. However, I can't think why this would lead 
to the tests failing.


Suggestions are welcome.

In case someone wants to look, the code is here:
https://github.com/djvanderlaan/tinymarkdown

Thanks,

Jan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Roy Mendelssohn - NOAA Federal via R-package-devel
try/stop is in the operational code.  But it is easy enough to make it so that 
the code always returns something, even when there is an internet access 
problem.

As I said,  if  "failing gracefully" and ever actually been defined with 
examples life would have been much easier for a number of packages developers.

-Roy


> On Sep 24, 2021, at 10:55 AM, Greg Minshall  wrote:
> 
> Roy,
> 
>> All internet calls are wrapped in 'try()'.  If that shows an error, I
>> write a message to the screen about the error, and call stop(),
>> perhaps with a further message in that call.
> 
> out of ignorance, i ask ...
> 
> in your package's operational code ("its API", or whatever), when a
> required internet access fails, i would think a message and a stop(),
> might be the reasonable thing to do.
> 
> in examples or tests, either doing the access itself, or calling your
> operational code, one might try() and not stop(), but, rather, go on to
> the next example/test.
> 
> in your comment above, is the try()/stop() in your operational code or
> in your tests/examples?
> 
> cheers, Greg

**
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new street address***
110 McAllister Way
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: roy.mendelss...@noaa.gov www: https://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] Internet resources and Errors

2021-09-24 Thread Ivan Krylov
On Fri, 24 Sep 2021 07:49:44 -0700
Roy Mendelssohn - NOAA Federal via R-package-devel
 wrote:

> All internet calls are wrapped in 'try()'.  If that shows an error,
> I  write a message to the screen about the error,  and call stop(),
> perhaps with a further message in that call.   Somehow this does not
> appear to meet the standard.Can someone then please tell me what
> I should do instead.

I think that the important part is to catch that stop() in your _tests
or examples_, so that a stop() raised by a connection error
inside the code of your package wouldn't fail your \example{} block or a
test in tests/*.R.

Good:
R/myfunction.R: if (connection_failed) stop(informative_message)

Bad:
man/myfunction.Rd:
\example{ myfunction(foo) }

(During CRAN testing, connection fails, the exception reaches the R CMD
check process and fails the test.)

Good:
man/myfunction.Rd
\example{ try(myfunction(foo)) # may fail because of connection errors }

Here, the exception is raised but handled. Bonus points if you use
tryCatch(...) and only catch the "connection failed" conditions,
allowing all other errors to propagate and still fail the tests. It's
possible if you construct a condition object (x <- simpleError(...))
and append to its class(): class(x) <- c(class(x),
'connection_failed'). The resulting error can still be raised with
stop(x). tryCatch() will then be able to call your handler only for
connection_failed errors.

Raising an exception is a valid way of dealing with connection errors
for functions that rely on outside world to fulfil their promise.

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel