codepod
codepod copied to clipboard
Codepod-exported ipynb not compliant to NBFormat 4.0
The attachment of this issue is an ipynb exported from this Codepod repo. It has some format issues incompatible with NBFormat 4.0:
-
#/metadata
has no property calledname
-
id
is a mandatory field for each cell under#/cells
But it's missing for all cells exported.id
is not a field inmetadata
of a cell. - All cells'
output_type
isdisplay_data
. This is not right. There are four types:execute_result
,display_data
,error
(see below), andstream
.display_data
has no property calledexecute_count
butexecute_result
has. In many cases in the attached example ipynb, the output should besteam
? For example, this cell{ "cell_type": "code", "execution_count": 1, "metadata": { "id": "w1o7rfvk37nkk2p8105s", "geoScore": 0.0021 }, "source": [ "'''\n", "CodePod Scope structure: \n", "'''\n", "1+1\n" ], "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "2\n" ] } } ] },
- Erroneous cells are handled completely wrong. One of the pods contains error and traceback info. But the corresponding json is incorrectly as
{ "cell_type": "code", "execution_count": 3, "metadata": { "id": "xs1x514pd2o089p0uzub", "geoScore": 0.0012 }, "source": [ "'''\n", "CodePod Scope structure: \n", "'''\n", "foo(4)\n" ], "outputs": [ { "output_type": "display_data", "data": { "text/plain": [ "error\n" ] } } ] },
where the outputs/output_type
should have been error
, and data
is NOT an allowed field for an error. Required fields, expect output_type
are all missing. See specs here.
5. What is the geoScore
property for each cell?
6. Why is a scope and the first pod under it mixed together? Like this:
json { "cell_type": "code", "execution_count": 0, "metadata": { "id": "yla4ktyffvgxenaivved", "geoScore": 0.0011 }, "source": [ "'''\n", "CodePod Scope structure: Another test scope\n", "'''\n", "def foo(x):\n", " return x * x\n" ], "outputs": [] },
The scope should have become one separate cell of raw
or even markdown
type. In Markdown, the header level (#
, ##
, ###
, ...) should be proportional to the scope level.
7. And, can we beautify the JSON output?