Skip to content

Commit

Permalink
#54 Ch7 Visual. - WIP fix requests package being removed - edits in Ch7
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Sep 9, 2021
1 parent 6b2c1bc commit 735a987
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 52 deletions.
10 changes: 5 additions & 5 deletions workshop/jupyter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ARG ADD_PIP_PACKAGES=""
ENV TZ=${TZ} \
LANG=${LANG} \
DEBIAN_FRONTEND="noninteractive" \
DEB_BUILD_DEPS="software-properties-common build-essential python3-pip apt-utils" \
DEB_PACKAGES="locales locales-all python3-setuptools python3-gdal python3-fiona python3-rasterio python3-pyproj ${ADD_DEB_PACKAGES}" \
DEB_BUILD_DEPS="software-properties-common build-essential apt-utils" \
DEB_PACKAGES="locales locales-all python3-setuptools python3-pip python3-gdal python3-fiona python3-rasterio python3-pyproj ${ADD_DEB_PACKAGES}" \
PIP_PACKAGES="jupyter wheel ${ADD_PIP_PACKAGES}"

COPY ./requirements.txt /jupyter/requirements.txt
Expand All @@ -57,11 +57,11 @@ RUN \
&& apt-get --no-install-recommends install -y ${DEB_PACKAGES} \
&& update-locale LANG=${LANG} \
&& echo "For ${TZ} date=$(date)" && echo "Locale=$(locale)" \
&& pip3 install ${PIP_PACKAGES} \
&& pip3 install -r /jupyter/requirements.txt \
&& apt-get remove --purge ${DEB_BUILD_DEPS} -y \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/* \
&& pip3 install ${PIP_PACKAGES} \
&& pip3 install -r /jupyter/requirements.txt

COPY ./entrypoint.sh /jupyter/start.sh

Expand Down
52 changes: 41 additions & 11 deletions workshop/jupyter/content/notebooks/07-visualization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,32 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 21,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9cc6e853951f471381e1448ed719f004",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[44.4, 26.1], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"from ipyleaflet import *\n",
"\n",
"m = Map(center=(44.4, 26.1), zoom=4, basemap=basemaps.Hydda.Full)\n",
"m = Map(center=(44.4, 26.1), zoom=4, basemap=basemaps.OpenStreetMap.Mapnik)\n",
"m"
]
},
Expand All @@ -219,16 +234,31 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"metadata": {
"pycharm": {
"name": "#%%\n"
}
},
"outputs": [],
"source": [
"strata_all = basemap_to_tiles(basemaps.Strava.All)\n",
"m.add_layer(strata_all)\n",
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9cc6e853951f471381e1448ed719f004",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(bottom=1683.0, center=[44.4, 26.1], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_ti…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"strava_all = basemap_to_tiles(basemaps.Strava.All)\n",
"m.add_layer(strava_all)\n",
"m"
]
},
Expand All @@ -250,7 +280,7 @@
},
"outputs": [],
"source": [
"m.remove_layer(strata_all)\n",
"m.remove_layer(strava_all)\n",
"\n",
"from ipywidgets import Label\n",
"\n",
Expand Down Expand Up @@ -794,7 +824,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -808,7 +838,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.8.10"
},
"pycharm": {
"stem_cell": {
Expand Down
22 changes: 11 additions & 11 deletions workshop/jupyter/content/notebooks/test/07-folium-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
L_DISABLE_3D = false;
</script>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/leaflet.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.4.0/dist/leaflet.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet@1.6.0/dist/leaflet.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.2/leaflet.awesome-markers.css"/>
<link rel="stylesheet" href="https://rawcdn.githack.com/python-visualization/folium/master/folium/templates/leaflet.awesome.rotate.css"/>
<style>html, body {width: 100%;height: 100%;margin: 0;padding: 0;}</style>
<style>#map {position:absolute;top:0;bottom:0;right:0;left:0;}</style>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/python-visualization/folium/folium/templates/leaflet.awesome.rotate.min.css"/>

<meta name="viewport" content="width=device-width,
initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
#map_0ee40feee62e4657b29dd3a619f743c5 {
#map_c49ee9af21004f61b4c62a4069f02580 {
position: relative;
width: 100.0%;
height: 100.0%;
Expand All @@ -35,13 +35,13 @@
</head>
<body>

<div class="folium-map" id="map_0ee40feee62e4657b29dd3a619f743c5" ></div>
<div class="folium-map" id="map_c49ee9af21004f61b4c62a4069f02580" ></div>

</body>
<script>

var map_0ee40feee62e4657b29dd3a619f743c5 = L.map(
"map_0ee40feee62e4657b29dd3a619f743c5",
var map_c49ee9af21004f61b4c62a4069f02580 = L.map(
"map_c49ee9af21004f61b4c62a4069f02580",
{
center: [44.43225, 26.10626],
crs: L.CRS.EPSG3857,
Expand All @@ -55,9 +55,9 @@



var tile_layer_1fd55c01a0bb4df1b4caeeeecfe3d741 = L.tileLayer(
var tile_layer_b814d75a7f4c495b87c2f4092787b91e = L.tileLayer(
"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{"attribution": "Data by \u0026copy; \u003ca href=\"http://openstreetmap.org\"\u003eOpenStreetMap\u003c/a\u003e, under \u003ca href=\"http://www.openstreetmap.org/copyright\"\u003eODbL\u003c/a\u003e.", "detectRetina": false, "maxNativeZoom": 18, "maxZoom": 18, "minZoom": 0, "noWrap": false, "opacity": 1, "subdomains": "abc", "tms": false}
).addTo(map_0ee40feee62e4657b29dd3a619f743c5);
).addTo(map_c49ee9af21004f61b4c62a4069f02580);

</script>
55 changes: 30 additions & 25 deletions workshop/jupyter/content/notebooks/test/07-folium-2.html

Large diffs are not rendered by default.

0 comments on commit 735a987

Please sign in to comment.