-
-
Notifications
You must be signed in to change notification settings - Fork 481
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
Graphics3d.show abuses graphics_filename #16640
Comments
Branch: u/gagern/ticket/16640 |
comment:2
Note that only the last two commits are new for this ticket; the rest comes from #16645 and its dependencies. I tested things both in notebook and interactively. java3d failed in both cases, for which I just filed #16647. Apart from that, everything looks fine. In particular it seems as if I got all the file name interdependencies for jmol right. New commits:
|
Author: Martin von Gagern |
Dependencies: #16645 |
Commit: |
comment:3
These are the changes that need reviewing in this ticket here. |
Changed dependencies from #16645 to none |
Changed branch from u/gagern/ticket/16640 to u/jdemeyer/ticket/16640 |
Reviewer: Jeroen Demeyer |
comment:10
Merged with 6.4.beta4 and added some fixes. Please review. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:13
Hi Jeroen: Your first two commits are fine, as is the first commit of Martin's. (Currently looking at his main, second one.) How much slower did the doctests become without your last commit? (Martin, if you see this, what was your thinking on changing the doctest mode?) |
comment:14
Hi, sorry I didn't respond to the commits by Jeroen any sooner. Replying to @kcrisman:
I agree. Thanks a lot!
My main reason for modifying that line at all was the fact that canvas3d only works in embedded mode, so having it available otherwise might confuse users. My reson for including it in doctests is simply because all the other possible viewers are active in doctest mode as well. There is a doctest specifically for the canvas3d case, but if I restrict canvas3d to embedded mode only, that one would fail. So staying in line with all the other tests seemed the reasonable thing to do. If things really are too slow, I'd change that to |
comment:15
Always doing |
comment:53
Replying to @kcrisman:
I'm too confused, what are you (plural) trying to say here? |
comment:54
Here is the short version:
raises an error in the command line but not during doctesting because of the way you wrote the code (creates the file). Perhaps the warning should also be doctested. |
comment:55
Replying to @kcrisman:
That's possible but requires some messing around with PS: I assume you mean "error", not "warning". |
comment:56
Yes.
Ok.
Yes, though I recall writing both of those a few times and then accidentally closing the browser/getting timed out! |
comment:57
Conflicts with 6.4, please merge. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:59
Done, the conflict was the removal of a redundant import of |
comment:60
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed branch from u/jdemeyer/ticket/16640 to |
Code in sage/plot/plot3d/base.pyx in the method
Graphics3d.show()
makes invalid use ofgraphics_filename
: it generates a name (likesage0.png
), then strips the extension and appends various other extensions during the course of the method. Butgraphics_filename
makes no guarantees that these other file names will be unused. In fact chances are pretty good that these files already exist from a different run of that method inside the same cell. So we get clashes there. Perhaps if things change in other places we might even get a security issue due to a race condition here.I can think of two possible approaches: either call
graphics_filename
in several places, once for every file name we need to generate. Or create a temporary directory and write all files inside that with fixed names. The former will likely be easier to handle for notebook, but may make the code harder to read. Particularly those cases where some tool will use one file name to derive another file name might be a real pain, like when the applet size is encoded in the file name, or the magic aroud thearchive_name
for jmol. Will need some good interactive testing to make sure that everything still works after these changes.Component: graphics
Author: Martin von Gagern, Jeroen Demeyer
Branch/Commit:
034fa58
Reviewer: Jeroen Demeyer, Karl-Dieter Crisman
Issue created by migration from https://trac.sagemath.org/ticket/16640
The text was updated successfully, but these errors were encountered: