Skip to content

Commit 79ded56

Browse files
authoredJun 24, 2020
Add Binder (#7)
1 parent 87fc126 commit 79ded56

File tree

5 files changed

+108
-2
lines changed

5 files changed

+108
-2
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ node_modules/
55
.ipynb_checkpoints
66
*.tsbuildinfo
77
.idea/
8+
.DS_Store

‎README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# jupyterlab-execute-time
2-
[![NPM version][npm-image]][npm-url] [![NPM DM][npm-dm-image]][npm-url] [![Build Status][travis-image]][travis-url]
32

3+
[![Binder][badge-binder]][binder]
4+
[![NPM version][npm-image]][npm-url] [![NPM DM][npm-dm-image]][npm-url] [![Build Status][travis-image]][travis-url]
45

56
Display cell timings.
67

@@ -11,6 +12,7 @@ This is inspired by the notebook version [here](https://github.com/ipython-contr
1112
Note: for this to show anything, you need to enable cell timing in the notebook via Settings->Advanced Settings Editor->Notebook: `{"recordTiming": true}`
1213

1314
"Jupyter" is a trademark of the NumFOCUS foundation, of which Project Jupyter is a part."
15+
1416
## Requirements
1517

1618
- JupyterLab >= 2.0.2
@@ -51,7 +53,7 @@ jupyter lab --watch
5153

5254
To test:
5355

54-
```
56+
```bash
5557
yarn run test
5658
```
5759

@@ -72,6 +74,7 @@ This plugin was contributed back to the community by the [D. E. Shaw group](http
7274
</p>
7375

7476
## License
77+
7578
This project is released under a [BSD-3-Clause license](https://github.com/deshaw/jupyterlab-execute-time/blob/master/LICENSE.txt).
7679

7780
"Jupyter" is a trademark of the NumFOCUS foundation, of which Project Jupyter is a part.
@@ -83,3 +86,5 @@ This project is released under a [BSD-3-Clause license](https://github.com/desha
8386
[travis-url]: http://travis-ci.org/deshaw/jupyterlab-execute-time
8487
[travis-image]: https://secure.travis-ci.org/deshaw/jupyterlab-execute-time.png?branch=master
8588

89+
[badge-binder]: https://mybinder.org/badge_logo.svg
90+
[binder]: https://mybinder.org/v2/gh/deshaw/jupyterlab-execute-time/master?urlpath=lab%2Ftree%2Fnotebooks%2Findex.ipynb

‎binder/environment.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
channels:
2+
- conda-forge
3+
dependencies:
4+
- jupyterlab>=2
5+
- nodejs=12

‎binder/postBuild

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright 2020 D. E. Shaw & Co., L.P.
4+
# All rights reserved.
5+
#
6+
# This project is released under a BSD-3-Clause license.
7+
#
8+
9+
set -o errexit
10+
set -o xtrace
11+
12+
node -v
13+
jupyter lab --version
14+
15+
# Install the latest version, building from source currently has issues
16+
jupyter labextension install jupyterlab-execute-time --debug --minimize=False
17+
18+
mkdir -p ~/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/
19+
echo '{"recordTiming": true}' > ~/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings

‎notebooks/index.ipynb

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Jupyterlab Execute Time"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Use Run->Run All Cells to see various states all at once in this notebook (use me in lab!)"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": null,
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
23+
"from time import sleep"
24+
]
25+
},
26+
{
27+
"cell_type": "code",
28+
"execution_count": null,
29+
"metadata": {},
30+
"outputs": [],
31+
"source": [
32+
"sleep(3)"
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"metadata": {},
39+
"outputs": [],
40+
"source": [
41+
"sleep(2)"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": null,
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"# Note: for this to show anything, you need to enable cell timing in the notebook via Settings->Advanced Settings Editor->Notebook: `{\"recordTiming\": true}`\n",
51+
"!cat ~/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings"
52+
]
53+
}
54+
],
55+
"metadata": {
56+
"kernelspec": {
57+
"display_name": "Python 3",
58+
"language": "python",
59+
"name": "python3"
60+
},
61+
"language_info": {
62+
"codemirror_mode": {
63+
"name": "ipython",
64+
"version": 3
65+
},
66+
"file_extension": ".py",
67+
"mimetype": "text/x-python",
68+
"name": "python",
69+
"nbconvert_exporter": "python",
70+
"pygments_lexer": "ipython3",
71+
"version": "3.7.4"
72+
}
73+
},
74+
"nbformat": 4,
75+
"nbformat_minor": 4
76+
}

0 commit comments

Comments
 (0)
Please sign in to comment.