Skip to content

Commit 54c7128

Browse files
update
1 parent 4364347 commit 54c7128

1 file changed

Lines changed: 44 additions & 2 deletions

File tree

notebooks/xarray_extracting_time_series_multiple.ipynb

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
{
4747
"cell_type": "code",
48-
"execution_count": 1,
48+
"execution_count": null,
4949
"id": "6058b268-9e94-416c-9698-4888111c9b10",
5050
"metadata": {
5151
"id": "6058b268-9e94-416c-9698-4888111c9b10"
@@ -54,7 +54,7 @@
5454
"source": [
5555
"%%capture\n",
5656
"if 'google.colab' in str(get_ipython()):\n",
57-
" !pip install rioxarray"
57+
" !pip install rioxarray dask[distributed]"
5858
]
5959
},
6060
{
@@ -79,6 +79,48 @@
7979
"import zipfile"
8080
]
8181
},
82+
{
83+
"cell_type": "markdown",
84+
"id": "81bb22c2",
85+
"metadata": {},
86+
"source": [
87+
"Setup a local Dask cluster. This distributes the computation across multiple workers on your computer."
88+
]
89+
},
90+
{
91+
"cell_type": "code",
92+
"execution_count": null,
93+
"id": "c7a705ac",
94+
"metadata": {},
95+
"outputs": [],
96+
"source": [
97+
"from dask.distributed import Client\n",
98+
"client = Client() # set up local cluster on the machine\n",
99+
"client"
100+
]
101+
},
102+
{
103+
"cell_type": "markdown",
104+
"id": "8bc0a693",
105+
"metadata": {},
106+
"source": [
107+
"If you are running this notebook in Colab, you will need to create and use a proxy URL to see the dashboard running on the local server.\n",
108+
"\n"
109+
]
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": null,
114+
"id": "3733a3ec",
115+
"metadata": {},
116+
"outputs": [],
117+
"source": [
118+
"if 'google.colab' in str(get_ipython()):\n",
119+
" from google.colab import output\n",
120+
" port_to_expose = 8787 # This is the default port for Dask dashboard\n",
121+
" print(output.eval_js(f'google.colab.kernel.proxyPort({port_to_expose})'))"
122+
]
123+
},
82124
{
83125
"cell_type": "code",
84126
"execution_count": 3,

0 commit comments

Comments
 (0)