|
176 | 176 | "outputs": [], |
177 | 177 | "source": [ |
178 | 178 | "# One interactive plot below requires Bokeh\n", |
179 | | - "# The rest of the notebook works without this dependency - comment if needed\n", |
180 | | - "import holoviews as hv\n", |
181 | | - "hv.extension('bokeh')\n", |
182 | | - "import geoviews as gv\n", |
183 | | - "import geoviews.tile_sources as gts\n", |
| 179 | + "try:\n", |
| 180 | + " import holoviews as hv\n", |
| 181 | + " hv.extension('bokeh')\n", |
| 182 | + " import geoviews as gv\n", |
| 183 | + " import geoviews.tile_sources as gts\n", |
184 | 184 | "\n", |
185 | | - "sh = salem.transform_geopandas(gdir.read_shapefile('outlines'))\n", |
186 | | - "(gv.Polygons(sh).opts(fill_color=None, color_index=None) *\n", |
187 | | - " gts.tile_sources['EsriImagery'] * gts.tile_sources['StamenLabels']).opts(width=800, height=500, active_tools=['pan', 'wheel_zoom'])" |
| 185 | + " sh = salem.transform_geopandas(gdir.read_shapefile('outlines'))\n", |
| 186 | + " out = (gv.Polygons(sh).opts(fill_color=None, color_index=None) * \n", |
| 187 | + " gts.tile_sources['EsriImagery'] * \n", |
| 188 | + " gts.tile_sources['StamenLabels']).opts(width=800, height=500, active_tools=['pan', 'wheel_zoom'])\n", |
| 189 | + "except:\n", |
| 190 | + " # The rest of the notebook works without this dependency\n", |
| 191 | + " out = None\n", |
| 192 | + "out" |
| 193 | + ] |
| 194 | + }, |
| 195 | + { |
| 196 | + "cell_type": "code", |
| 197 | + "execution_count": null, |
| 198 | + "metadata": { |
| 199 | + "tags": [] |
| 200 | + }, |
| 201 | + "outputs": [], |
| 202 | + "source": [ |
| 203 | + "type(out)" |
188 | 204 | ] |
189 | 205 | }, |
190 | 206 | { |
|
557 | 573 | "metadata": {}, |
558 | 574 | "outputs": [], |
559 | 575 | "source": [ |
560 | | - "sh = salem.transform_geopandas(gdirs[1].read_shapefile('outlines'))\n", |
561 | | - "(gv.Polygons(sh).opts(fill_color=None, color_index=None) *\n", |
562 | | - " gts.tile_sources['EsriImagery'] * gts.tile_sources['StamenLabels']).opts(width=800, height=500, active_tools=['pan', 'wheel_zoom'])" |
| 576 | + "# One interactive plot below requires Bokeh\n", |
| 577 | + "try:\n", |
| 578 | + " sh = salem.transform_geopandas(gdirs[1].read_shapefile('outlines'))\n", |
| 579 | + " out = (gv.Polygons(sh).opts(fill_color=None, color_index=None) * \n", |
| 580 | + " gts.tile_sources['EsriImagery'] *\n", |
| 581 | + " gts.tile_sources['StamenLabels']).opts(width=800, height=500, active_tools=['pan', 'wheel_zoom'])\n", |
| 582 | + "except:\n", |
| 583 | + " # The rest of the notebook works without this dependency\n", |
| 584 | + " out = None\n", |
| 585 | + "out" |
563 | 586 | ] |
564 | 587 | }, |
565 | 588 | { |
|
785 | 808 | "name": "python", |
786 | 809 | "nbconvert_exporter": "python", |
787 | 810 | "pygments_lexer": "ipython3", |
788 | | - "version": "3.10.8" |
| 811 | + "version": "3.10.9" |
789 | 812 | }, |
790 | 813 | "toc": { |
791 | 814 | "base_numbering": 1, |
|
0 commit comments