Skip to content

Commit 77b55d0

Browse files
authored
Merge pull request #7 from mwakaba2/fix-julia-kernel
Fix: Use execution input for cell execution start time
2 parents 3a19bc5 + 16df949 commit 77b55d0

File tree

3 files changed

+86
-13
lines changed

3 files changed

+86
-13
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import { checkBrowserNotificationSettings } from './settings';
1414
function extractExecutionMetadata(metadata: IObservableJSON): [Date, Date] {
1515
const executionMetadata = Object.assign({}, metadata.get('execution') as any);
1616
const cellStartTime = new Date(
17-
executionMetadata['shell.execute_reply.started']
17+
executionMetadata['shell.execute_reply.started'] ||
18+
executionMetadata['iopub.execute_input']
1819
);
1920
const cellEndTime = new Date(executionMetadata['shell.execute_reply']);
2021
return [cellStartTime, cellEndTime];

tutorial/julia_demo.ipynb

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 7,
6+
"id": "e80893c2-fa00-440a-baf9-ac49aad29be5",
7+
"metadata": {
8+
"execution": {
9+
"iopub.execute_input": "2021-04-19T20:53:28.895000-06:00",
10+
"iopub.status.busy": "2021-04-19T20:53:28.895000-06:00",
11+
"iopub.status.idle": "2021-04-19T20:53:32.912000-06:00",
12+
"shell.execute_reply": "2021-04-19T20:53:32.911000-06:00"
13+
},
14+
"tags": []
15+
},
16+
"outputs": [
17+
{
18+
"name": "stdout",
19+
"output_type": "stream",
20+
"text": [
21+
"hello world!"
22+
]
23+
}
24+
],
25+
"source": [
26+
"sleep(4)\n",
27+
"print(\"hello world!\")"
28+
]
29+
},
30+
{
31+
"cell_type": "code",
32+
"execution_count": null,
33+
"id": "90628a40-aae7-4b1d-a17a-5f03bea0aebf",
34+
"metadata": {},
35+
"outputs": [],
36+
"source": []
37+
}
38+
],
39+
"metadata": {
40+
"kernelspec": {
41+
"display_name": "Julia 1.6.0",
42+
"language": "julia",
43+
"name": "julia-1.6"
44+
},
45+
"language_info": {
46+
"file_extension": ".jl",
47+
"mimetype": "application/julia",
48+
"name": "julia",
49+
"version": "1.6.0"
50+
}
51+
},
52+
"nbformat": 4,
53+
"nbformat_minor": 5
54+
}

tutorial/demo.ipynb renamed to tutorial/py3_demo.ipynb

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 13,
5+
"execution_count": 3,
66
"metadata": {
77
"execution": {
8-
"iopub.execute_input": "2021-03-27T03:06:18.533459Z",
9-
"iopub.status.busy": "2021-03-27T03:06:18.533220Z",
10-
"iopub.status.idle": "2021-03-27T03:06:18.537331Z",
11-
"shell.execute_reply": "2021-03-27T03:06:18.536387Z",
12-
"shell.execute_reply.started": "2021-03-27T03:06:18.533425Z"
8+
"iopub.execute_input": "2021-04-20T02:52:00.612541Z",
9+
"iopub.status.busy": "2021-04-20T02:52:00.612207Z",
10+
"iopub.status.idle": "2021-04-20T02:52:00.616928Z",
11+
"shell.execute_reply": "2021-04-20T02:52:00.615808Z",
12+
"shell.execute_reply.started": "2021-04-20T02:52:00.612490Z"
1313
},
1414
"tags": []
1515
},
@@ -28,14 +28,14 @@
2828
},
2929
{
3030
"cell_type": "code",
31-
"execution_count": 14,
31+
"execution_count": 4,
3232
"metadata": {
3333
"execution": {
34-
"iopub.execute_input": "2021-03-27T03:06:19.213426Z",
35-
"iopub.status.busy": "2021-03-27T03:06:19.213237Z",
36-
"iopub.status.idle": "2021-03-27T03:06:22.337638Z",
37-
"shell.execute_reply": "2021-03-27T03:06:22.336868Z",
38-
"shell.execute_reply.started": "2021-03-27T03:06:19.213404Z"
34+
"iopub.execute_input": "2021-04-20T02:52:00.619017Z",
35+
"iopub.status.busy": "2021-04-20T02:52:00.618717Z",
36+
"iopub.status.idle": "2021-04-20T02:52:03.748053Z",
37+
"shell.execute_reply": "2021-04-20T02:52:03.746867Z",
38+
"shell.execute_reply.started": "2021-04-20T02:52:00.618964Z"
3939
},
4040
"tags": []
4141
},
@@ -53,6 +53,24 @@
5353
"print(\"hello world!\")"
5454
]
5555
},
56+
{
57+
"cell_type": "code",
58+
"execution_count": 5,
59+
"metadata": {
60+
"execution": {
61+
"iopub.execute_input": "2021-04-20T02:52:03.751413Z",
62+
"iopub.status.busy": "2021-04-20T02:52:03.751066Z",
63+
"iopub.status.idle": "2021-04-20T02:52:07.882434Z",
64+
"shell.execute_reply": "2021-04-20T02:52:07.881588Z",
65+
"shell.execute_reply.started": "2021-04-20T02:52:03.751375Z"
66+
},
67+
"tags": []
68+
},
69+
"outputs": [],
70+
"source": [
71+
"!sleep 4"
72+
]
73+
},
5674
{
5775
"cell_type": "markdown",
5876
"metadata": {},

0 commit comments

Comments
 (0)