Skip to content
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

If .pro contains a stop, figures don't show up until another cell is executed #4

Open
douglase opened this issue Jul 20, 2015 · 1 comment

Comments

@douglase
Copy link

Thanks for putting this together, great idea, install was easy and so far it's working great.

A small thing I've noticed, whenever I hit a stop in a procedure, the code returns without shown the plots up to that point.

For example, if I create a simple procedure based on the demo:

 pro demo_plot
x = 2*!PI*0.01*indgen(100)
y1 = sin(x)
 y2 = cos(x)
loadct,39 
window,xsize=800,ysize=500 
plot,x,y1,title='Trig Functions',xtitle='Radians',ytitle='Amplitude',xrange=   [0,6],charsize=1.5,background=255,color=0
oplot,x,y2,color=50
stop 
end

I run this in a cell, i.e.

demo_plot

then I have to run another cell with something in it (i.e. a print statement) to see the output figures, as seen in this example notebook:
http://nbviewer.ipython.org/gist/douglase/9f02bcb3287ea4131e4f

running .continue as you would in IDL returns an error, not the plots, or the next bit of code, so essential this is just a report that the stop command doesn't work yet.

lstagner pushed a commit that referenced this issue Jul 21, 2015
lstagner pushed a commit that referenced this issue Jul 21, 2015
@lstagner
Copy link
Owner

Ok this was partially fixed in the last two commits. In order to get inline plots this kernel appends a post call to your code in the notebook cell that takes snapshots of open graphics windows and save them as pngs. Since you had a stop it never executed that code. This was partially fixed by having the graphics code run separately so that the graphics code will always run.

The reason this is not full fix is that after the stop it cant resume with .continue presumably because the cell input get printed to a temporary file and run using .run tmpfile. The reason for the tmp file was to allow writing procedures and functions.

A possible way to fix that is to write a parser that strips out the functions and procedures and treats them separately from the rest of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants