Skip to content

Commit b5d9101

Browse files
authored
Coiled notebook (#47)
1 parent 5fc07c0 commit b5d9101

File tree

4 files changed

+41
-5
lines changed

4 files changed

+41
-5
lines changed

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@
9393
`on Github <https://github.com/gjoseph92/stackstac/blob/main/docs/{{
9494
"../" + docname if docname.startswith("examples") else docname
9595
}}>`_.
96+
97+
Or, `click here <https://cloud.coiled.io/gjoseph92/jobs/stackstac>`_
98+
to run these notebooks on Coiled with access to Dask clusters.
9699
"""
97100

98101
# TODO enable binder once Coiled supports websocket clusters over 443.

examples/gif.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@
108108
],
109109
"source": [
110110
"cluster = coiled.Cluster(\n",
111-
" name=\"gjoseph92/stackstac\",\n",
112-
" software=\"stackstac\",\n",
111+
" name=\"stackstac-eu\",\n",
112+
" software=\"gjoseph92/stackstac\",\n",
113113
" backend_options={\"region\": \"eu-central-1\"},\n",
114114
" # ^ Coiled doesn't yet support Azure's West Europe region, so instead we'll run on a nearby AWS data center in Frankfurt\n",
115115
" n_workers=20,\n",
@@ -3816,4 +3816,4 @@
38163816
},
38173817
"nbformat": 4,
38183818
"nbformat_minor": 5
3819-
}
3819+
}

examples/show.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@
131131
"source": [
132132
"cluster = coiled.Cluster(\n",
133133
" name=\"stackstac\",\n",
134-
" software=\"stackstac-show\",\n",
135-
" n_workers=25,\n",
134+
" software=\"gjoseph92/stackstac\",\n",
135+
" n_workers=22,\n",
136136
" scheduler_cpu=2,\n",
137137
" backend_options={\"region\": \"us-west-1\"},\n",
138138
")\n",

scripts/coiled-notebook.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import subprocess
2+
3+
from pathlib import Path
4+
import coiled
5+
6+
if __name__ == "__main__":
7+
proc = subprocess.run(
8+
"poetry export --without-hashes -E binder -E viz",
9+
shell=True,
10+
check=True,
11+
capture_output=True,
12+
text=True,
13+
)
14+
deps = proc.stdout.splitlines()
15+
16+
# TODO single-source the version! this is annoying
17+
version = subprocess.run(
18+
"poetry version -s", shell=True, check=True, capture_output=True, text=True
19+
).stdout.strip()
20+
deps += [f"stackstac[binder,viz]=={version}"]
21+
22+
examples = Path(__file__).parent.parent / "examples"
23+
docs = Path(__file__).parent.parent / "docs"
24+
notebooks = list(examples.glob("*.ipynb")) + list(docs.glob("*.ipynb"))
25+
print(notebooks)
26+
coiled.create_notebook(
27+
name="stackstac",
28+
pip=deps,
29+
cpu=2,
30+
memory="8 GiB",
31+
files=notebooks,
32+
description="Example notebooks from the stackstac documentation (https://stackstac.readthedocs.io/en/stable/)",
33+
)

0 commit comments

Comments
 (0)