-
Notifications
You must be signed in to change notification settings - Fork 20
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
Using nbformat instead of json #200
base: master
Are you sure you want to change the base?
Using nbformat instead of json #200
Conversation
Thanks for working on this @AntHoneyLam ! I'm away for the weekend so I can't look closely for a bit but will next week. But preliminarily I think you will need to add nbformat to the docs requirements in setup.cfg to get the docs to build. Also I think it may be possible to do the output modification using nbformat? If that is possible it would be good to do as well. |
The docs failure: looks real with this error: Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/envs/200/lib/python3.7/site-packages/sphinx/config.py", line 323, in eval_config_file
exec(code, namespace)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/checkouts/200/docs/conf.py", line 26, in <module>
gogogo_all("../examples", "examples/")
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/checkouts/200/docs/gifmaker.py", line 17, in gogogo_all
gogogo_gif(nb, to)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/checkouts/200/docs/gifmaker.py", line 50, in gogogo_gif
nbformat.write(nb, f)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/envs/200/lib/python3.7/site-packages/nbformat/__init__.py", line 164, in write
s = writes(nb, version, **kwargs)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/envs/200/lib/python3.7/site-packages/nbformat/__init__.py", line 110, in writes
return versions[version].writes_json(nb, **kwargs)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/envs/200/lib/python3.7/site-packages/nbformat/v4/nbjson.py", line 54, in writes
nb = split_lines(nb)
File "/home/docs/checkouts/readthedocs.org/user_builds/mpl-interactions/envs/200/lib/python3.7/site-packages/nbformat/v4/rwbase.py", line 81, in split_lines
if output.output_type in {'execute_result', 'display_data'}:
AttributeError: 'dict' object has no attribute 'output_type' which is because when this was just a dict it was ok to overwrite the output with a custom made dictionary. but now nbformat expects the output to be some sort of nbformat object. So we need to change this parts: to use https://nbformat.readthedocs.io/en/latest/api.html#nbformat.v4.new_output you can test this locally from the terminal by going to the |
Issue #123