mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-01-18 20:11:20 +00:00
Use notebook format 3 for ipynb_exporter
The file assumes format 3 throughout the code, so explicitly import that format instead of the generic "current" format.
This commit is contained in:
parent
d31a5c3c48
commit
f41be396fa
@ -30,15 +30,15 @@ except ImportError as import_error:
|
||||
|
||||
if IPython and (IPython.version_info[0] == 2):
|
||||
import IPython.kernel
|
||||
import IPython.nbformat.current
|
||||
import IPython.nbformat.v3
|
||||
|
||||
def read_notebook(notebook_in):
|
||||
return IPython.nbformat.current.reads_json(notebook_in)
|
||||
return IPython.nbformat.v3.reads_json(notebook_in)
|
||||
|
||||
def write_notebook(notebook, fout):
|
||||
IPython.nbformat.current.write(notebook, fout, 'json')
|
||||
IPython.nbformat.v3.nbjson.JSONWriter().write(notebook, fout)
|
||||
|
||||
NotebookNode = IPython.nbformat.current.NotebookNode
|
||||
NotebookNode = IPython.nbformat.v3.NotebookNode
|
||||
|
||||
elif IPython:
|
||||
# Unsupported IPython version
|
||||
|
Loading…
x
Reference in New Issue
Block a user