Skip to content
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

JEP #: First class support for inline execution results #351

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 85 additions & 6 deletions nbformat/v4/nbformat.v4.5.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Jupyter Notebook v4.5 JSON schema.",
"description": "Jupyter Notebook v4.6 JSON schema.",
"type": "object",
"additionalProperties": false,
"required": ["metadata", "nbformat_minor", "nbformat", "cells"],
Expand Down Expand Up @@ -146,7 +146,17 @@
}
},
"attachments": { "$ref": "#/definitions/misc/attachments" },
"source": { "$ref": "#/definitions/misc/source" }
"source": { "$ref": "#/definitions/misc/source" },
"execution_count": {
"$ref": "$/definitions/misc/execution_count"
},
"user_expressions": {
"description": "User expressions evaluated along side the cell.",
"type": "array",
"items": {
"$ref": "#definitions/user_expression"
}
}
}
},

Expand Down Expand Up @@ -180,7 +190,17 @@
"additionalProperties": true
},
"attachments": { "$ref": "#/definitions/misc/attachments" },
"source": { "$ref": "#/definitions/misc/source" }
"source": { "$ref": "#/definitions/misc/source" },
"execution_count": {
"$ref": "$/definitions/misc/execution_count"
},
"user_expressions": {
"description": "User expressions evaluated along side the cell.",
"type": "array",
"items": {
"$ref": "#definitions/user_expression"
}
}
}
},

Expand Down Expand Up @@ -267,9 +287,14 @@
"items": { "$ref": "#/definitions/output" }
},
"execution_count": {
"description": "The code cell's prompt number. Will be null if the cell has not been run.",
"type": ["integer", "null"],
"minimum": 0
"$ref": "$/definitions/misc/execution_count"
},
"user_expressions": {
"description": "User expressions evaluated along side the cell.",
"type": "array",
"items": {
"$ref": "#definitions/user_expression"
}
}
}
},
Expand Down Expand Up @@ -405,6 +430,60 @@
}
},

"user_expression": {
"type": "object",
"properties": {
"expression": {
"description": "Code snippet evaluated by the kernel",
"type": "string"
},
"result": {
"oneOf": [
{
"description": "Successful result of the expression evaluation.",
"type": "object",
"properties": {
"status": {
"description": "Expression evaluation status",
"type": "string",
"enum": ["ok"]
},
"data": { "$ref": "#/definitions/misc/mimebundle" },
"metadata": { "$ref": "#/definitions/misc/output_metadata" }
},
"additionalProperties": false
},
{
"description": "Failed result of the expression evaluation.",
"type": "object",
"properties": {
"status": {
"description": "Expression evaluation status",
"type": "string",
"enum": ["error"]
},
"ename": {
"description": "The name of the error.",
"type": "string"
},
"evalue": {
"description": "The value, or message, of the error.",
"type": "string"
},
"traceback": {
"description": "The error's traceback, represented as an array of strings.",
"type": "array",
"items": { "type": "string" }
}
},
"additionalProperties": false
}
]
}
},
"additionalProperties": false
},

"misc": {
"metadata_name": {
"description": "The cell's name. If present, must be a non-empty string. Cell names are expected to be unique across all the cells in a given notebook. This criterion cannot be checked by the json schema and must be established by an additional check.",
Expand Down