Open jlperla opened 6 years ago
Thanks for the report! I also noticed the same thing and I'm trying to investigate. The same thing happens with Plots.jl.
Also the same thing happens if you create a notebook using Jupyter and run nbconvert
from bash so this not really a bug in Weave as such. Still It would be useful to find and fix the bug. I think it could be a problem with how display
is implemented in Gadfly and Plots, but I'm not sure.
The following does work: (but not if I leave out the last call to display):
using Plots
gr(fmt=:png)
p = plot(1:10)
display(p)
Thanks, works great! It doesn't look like it has anything to do with your package, but I do get errors at the end of the run that look like the following. The file itself is generated fine, so it is very likely my messed up JuliaPro configuration, which I need to redo regardless.
julia> notebook("test_plotting.jmd")
INFO: Running nbconvert
[NbConvertApp] Converting notebook C:\working\libraries\computing_and_datascience\weave_sandbox/test_plotting.ipynb to notebook
[NbConvertApp] Executing notebook with kernel: julia-0.6
[NbConvertApp] Writing 14580 bytes to C:\working\libraries\computing_and_datascience\weave_sandbox/test_plotting.ipynb
[NbConvertApp] Writing 14580 bytes to C:\working\libraries\computing_and_datascience\weave_sandbox/test_plotting.ipynb
--- Logging error ---
Traceback (most recent call last):
File "logging\__init__.py", line 983, in emit
OSError: raw write() returned invalid length 240 (should have been between 0 and 120)
Call stack:
File "runpy.py", line 184, in _run_module_as_main
File "runpy.py", line 85, in _run_code
File "C:\bin\JuliaPro-0.6.1.1\Python\Scripts\jupyter-nbconvert.EXE\__main__.py", line 9, in <module>
sys.exit(main())
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\nbconvert\nbconvertapp.py", line 325, in start
self.convert_notebooks()
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\nbconvert\nbconvertapp.py", line 493, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\nbconvert\nbconvertapp.py", line 465, in convert_single_notebook
write_results = self.write_single_notebook(output, resources)
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\nbconvert\nbconvertapp.py", line 426, in write_single_notebook
output, resources, notebook_name=notebook_name)
File "c:\bin\juliapro-0.6.1.1\python\lib\site-packages\nbconvert\writers\files.py", line 124, in write
self.log.info("Writing %i bytes to %s", len(output), dest)
File "logging\__init__.py", line 1279, in info
File "logging\__init__.py", line 1415, in _log
File "logging\__init__.py", line 1425, in handle
File "logging\__init__.py", line 1487, in callHandlers
File "logging\__init__.py", line 855, in handle
File "logging\__init__.py", line 986, in emit
Message: 'Writing %i bytes to %s'
Arguments: (14580, 'C:\\working\\libraries\\computing_and_datascience\\weave_sandbox/test_plotting.ipynb')
"Starting kernel event loops.\n"
This is low priority for me (as I can live without graphics in the notebook), but wanted to post it
Using the new
notebook
function, I tested it on thehttps://github.com/mpastell/Weave.jl/blob/master/examples/FIR_design.jl
example.Calling the
FIR_design.jl
on its own works correctly on my computer.When called
notebook("FIR_design.jl")
on it, everything seems to work, except the Gadfly plot output. If you look at the.ipynb
, the output of that cell has a huge amount of xml, starting withSee the full notebook here: FIR_design.ipynb.txt
If you open the notebook, it shows some text instead of the image, but if you
<Control-Enter>
, it correctly plots the image (so this hasn't broken the underlying code).As I said, no rush fixing this sort of stuff for me, but when the feature is more formally tested I hope this issue is useful.