New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix R restart in interface #7771
Comments
comment:1
As of Sage 4.3.2.alpha1, ticket #6532 upgrades R to version 2.10.1. From what I gather, after installing an R package, one needs to restart Sage:
It didn't say to use the command
Perhaps you want the command |
comment:2
Replying to @sagetrac-mvngu:
Yes, that is a change I made since r.restart() didn't work, but in the source it is commented that this should work.
Maybe; I am not familiar with the reset command. Maybe that is what restart was supposed to do all along? We should ask an R expert.
Oh, that is bad. I wonder why? One can install optional spkgs in a binary install, correct? |
comment:3
Replying to @kcrisman:
Yikes! Turns out that...
Note that R is now at version 2.10.1! So this is the problem here. The restart() thing must be very old - and odd, since the function that replaced it was try (for exception handling. Anyway, if reset() is good enough, that is fine - no need to do r.foo() if a normal Sage command does it well enough. I'll work on a patch for this. |
comment:4
In fact, it's not even clear whether one needs to reset().
And this on an install which definitely hadn't had this package installed before. The same happened with package 'aaMI'. Which leads me to believe one doesn't even have to reset() - the package is just automatically available. I'm going to put up a patch to that effect, with the covering statement to use reset() or restart Sage if you encounter problems. |
Attachment: trac_7771-r-restart.patch.gz Based on Sage 4.3.5 |
Author: Karl-Dieter Crisman |
comment:5
This may need slight rebasing after #7665. |
Attachment: trac_7771-reviewer.patch.gz |
This comment has been minimized.
This comment has been minimized.
Reviewer: Minh Van Nguyen |
comment:7
With the patch trac_7771-r-restart.patch, I got the following failure when doctesting with "-t -long -optional":
It might be simpler to just test for the output:
I have attached a reviewer patch that does only that. With both patches, I now get the following failure: [mvngu@sage sage-4.4.1]$ ./sage -t -long -optional devel/sage-main/sage/interfaces/r.py
sage -t -long -optional "devel/sage-main/sage/interfaces/r.py"
<output-trancated>
File "/dev/shm/mvngu/sandbox/sage-4.4.1/devel/sage-main/sage/interfaces/r.py", line 1755:
sage: latex(r(2)) #optional requires the Hmisc R package
Expected:
2
Got:
% latex.default(sage12, file = "")
%
\begin{table}[!tbp]
\begin{center}
\begin{tabular}{r}\hline\hline
\multicolumn{1}{c}{}\tabularnewline
\hline
$2$\tabularnewline
\hline
\end{tabular}
<BLANKLINE>
\end{center}
<BLANKLINE>
\end{table}
<BLANKLINE>
**********************************************************************
1 items had failures:
1 of 3 in __main__.example_67
***Test Failed*** 1 failures.
For whitespace errors, see the file /dev/shm/mvngu/dot_sage/tmp/.doctest_r.py
[11.5 s] But that is for another ticket. So only my patch needs reviewing by anyone but me. |
comment:8
The above isn't really a problem; it says explicitly that it requires the Hmisc R package, and should be expected to fail unless you have it, which is why it's optional. The change in the reviewer patch is not okay, though. If R does not start or causes an error, it is silent, but the two print statements will still happen (I just checked this by introducing a typo in the R command). Can you try that again - I assume you were connected to the internet when you tested it, as the optional flag says? |
comment:9
I see now - you already had loaded Hmisc, and apparently it changed its default Latexing. I can change the patch to fix this. However, as I said, I still disagree with the reviewer patch. I don't know what to do, though, because apparently doctesting changed and now all things like that loading and downloading happen "before" the actual doctest, at least in how it turns out. I'm not sure what to do about that, because I get the same thing whether I'm connected to the internet or not, which clearly should not be the case for an optional internet doctest! Suggestions? |
Changed keywords from none to r-project, R |
This nearly always happens after installing an R package and then following the directions Sage gives:
This seems to be unrelated to whether R has recommended packages installed or not, so I am making a new ticket for this. Making it minor since just restarting Sage takes care of things as well.
Apply in this order:
Component: interfaces
Keywords: r-project, R
Author: Karl-Dieter Crisman
Reviewer: Minh Van Nguyen
Issue created by migration from https://trac.sagemath.org/ticket/7771
The text was updated successfully, but these errors were encountered: