File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 3636 with open(file, 'r') as f:
3737 nb = nbformat.read(f, as_version=4)
3838 nbformat.validate(nb)
39- if 'application/vnd.jupyter.widget-state+json' not in nb.metadata.get('widgets', {}):
40- nb.metadata['widgets'] = {'application/vnd.jupyter.widget-state+json': {'version': '1.0'}}
39+ if 'widgets' in nb.metadata:
40+ if 'application/vnd.jupyter.widget-state+json' not in nb.metadata['widgets']:
41+ nb.metadata['widgets']['application/vnd.jupyter.widget-state+json'] = {'version': '1.0', 'state': {}}
42+ elif 'state' not in nb.metadata['widgets']['application/vnd.jupyter.widget-state+json']:
43+ nb.metadata['widgets']['application/vnd.jupyter.widget-state+json']['state'] = {}
4144 with open(file, 'w') as f:
4245 nbformat.write(nb, f)
4346 "
You can’t perform that action at this time.
0 commit comments