I am trying to add a new notebook to my fastpages repo to be rendered to a blog post. But it is failing to render throwing this error.
Traceback (most recent call last):
File "/fastpages/nb2post.py", line 36, in <module>
export2html.notebook2html(fname='_notebooks/*.ipynb', dest='_posts/', template_file='/fastpages/fastpages.tpl')
File "/usr/local/lib/python3.7/site-packages/nbdev/export2html.py", line 436, in notebook2html
raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
Exception: Conversion failed on the following:
2019-03-03-EDA_edelwiess.ipynb
Failed validating 'oneOf' in display_data['properties']['data']['patternProperties']['^(?!application/json$)[a-zA-Z0-9]+/[a-zA-Z0-9\\-\\+\\.]+$']:
I am using Plotly here so this notebook will be big.
Is the choice of the library the problem or something else.
Can someone help?
The altair code in the notebook links to a json file which altair saves automagically. The process is a bit buggy working with jupyter lab becuase of how files are stored, but the upcoming 4.1 release of altair has an option to specify the path:
The issue is that localhost filepaths are unpredictable between different flavors of Jupyter notebook.
With standard jupyter notebook with default settings it just saves a json file to the notebook folder.
So with fastpages I’m not sure of the best way to use this, but I assume you just point to a data path relative to the notebook, or just in the same directory. The fastpages script would have to copy those json files over to gh-pages. I assume right now it would just ignore those files.
It does make things a lot faster (at least on my dual core laptop). Which I don’t understand why, since the data is being loaded anyways, but it seems large notebooks makes the jupyter server slow down.
I wonder if it would make the web page load faster too ( which might not correlate with the notebook loading faster? ). I suppose we could try it out and see once the new release is out
I am having trouble with the 'front matter" markdown cell. Even though I am following the conventions, my notebook’s first cell is not rendering normally.
I’m sorry Hamel, but I’m still not able to see the mistake. I put the double quotes around my title and summary and same thing happened with just double quotes around it. Could you point out the mistake for me?
Hey @a_bhimany_u! Were you able to solve the issue for plotly? I noticed @khalido shared a solution, but it is for altair viz. I am having the same problem here. It was working normally with static plots, but not anymore with plotly. I got the very same error of yours.
So especially for a blog, if you have many data things to plot, mpl is a good alternative as it makes a static image and sometimes a picture is good enough.
fastpages recommended altair so I’m trying to stick with it, I don’t know if they have optimized how it displays charts on gh-pages or something.
It’s not optimized, its just the one that we have tested most extensively. We are able to override the limit for Altair (see example), however when you embed that much data into a web page it will load very slowly, and may not load at all, especially on slower internet connections