Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b741d03

Browse files
committed
updated demo to v4 client
1 parent 3e81387 commit b741d03

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

demo/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ demo-docker: # make the python client demo docker image; needs VERSION
1616
cp ../environment.yml $(DEMO_STAGE_DIR)
1717
cp voila_demo.ipynb $(DEMO_STAGE_DIR)
1818
cp docker/demo/* $(DEMO_STAGE_DIR)
19+
# cp -R ../../sliderule $(DEMO_STAGE_DIR) # used to install local copy of client (only if necessary during development, see dockerfile for additional steps)
1920
chmod +x $(DEMO_STAGE_DIR)/docker-entrypoint.sh
2021
cd $(DEMO_STAGE_DIR) && docker build $(DOCKEROPTS) -t $(REPO)/demo-client:latest .
2122
docker tag $(REPO)/demo-client:latest $(REPO)/demo-client:$(VERSION)

demo/docker/demo/Dockerfile

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@ RUN conda env create -f environment.yml
1212
SHELL ["conda", "run", "-n", "sliderule_env", "/bin/bash", "-c"]
1313
RUN conda install -c conda-forge voila
1414

15-
# Install latest ipyleaflet
16-
RUN apt-get update && \
17-
apt-get install -y --no-install-recommends \
18-
build-essential \
19-
&& rm -rf /var/lib/apt/lists/*
20-
RUN conda install -c conda-forge -y yarn jupyter_packaging geopandas
21-
RUN cd /tmp && git clone https://github.com/jupyter-widgets/ipyleaflet.git
22-
RUN cd /tmp/ipyleaflet && \
23-
pip install -e . && \
24-
jupyter labextension develop . --overwrite
25-
RUN cd /tmp/ipyleaflet/js && \
26-
yarn add webpack webpack-dev-server svg-url-loader --dev && \
27-
yarn run build
28-
2915
# Install Voila Demo
3016
COPY voila_demo.ipynb /voila_demo.ipynb
3117

18+
# Local install of client (only if necessary)
19+
# COPY sliderule /sliderule
20+
# RUN cd /sliderule/clients/python && pip install .
21+
3222
# Entry point
3323
COPY docker-entrypoint.sh /usr/local/etc/
3424
ENTRYPOINT ["/bin/bash"]

demo/voila_demo.ipynb

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,6 @@
252252
" # set the url for the sliderule service\n",
253253
" icesat2.init(url_textbox.value, loglevel=logging.ERROR, max_resources=1000)\n",
254254
"\n",
255-
" # sliderule asset and data release\n",
256-
" asset = SRwidgets.asset.value\n",
257-
"\n",
258255
" # build sliderule parameters using latest values from widget\n",
259256
" atl06_parms = {\n",
260257
" # surface type: 0-land, 1-ocean, 2-sea ice, 3-land ice, 4-inland water\n",
@@ -288,7 +285,7 @@
288285
" atl06_parms[\"poly\"] = poly \n",
289286
" # make the request to the SlideRule (ATL06-SR) endpoint\n",
290287
" # and pass it the request parameters to request ATL06 Data\n",
291-
" elevations.append(icesat2.atl06p(atl06_parms, asset, callbacks={'eventrec': demo_logeventrec, 'exceptrec': demo_exceptrec}))\n",
288+
" elevations.append(icesat2.atl06p(atl06_parms, callbacks={'eventrec': demo_logeventrec, 'exceptrec': demo_exceptrec}))\n",
292289
"\n",
293290
" # return concatenated set of results\n",
294291
" gdf = geopandas.pd.concat(elevations)\n",
@@ -519,7 +516,7 @@
519516
" }\n",
520517
"\n",
521518
" # make call to sliderule\n",
522-
" rsps = icesat2.atl03sp(atl03_parms, asset)\n",
519+
" rsps = icesat2.atl03sp(atl03_parms)\n",
523520
" \n",
524521
" # return geodataframe\n",
525522
" return rsps\n",
@@ -622,6 +619,13 @@
622619
"display.display(pc_output)\n",
623620
"display.display(show_code03_button, show_code03_output)"
624621
]
622+
},
623+
{
624+
"cell_type": "code",
625+
"execution_count": null,
626+
"metadata": {},
627+
"outputs": [],
628+
"source": []
625629
}
626630
],
627631
"metadata": {
@@ -658,7 +662,7 @@
658662
"name": "python",
659663
"nbconvert_exporter": "python",
660664
"pygments_lexer": "ipython3",
661-
"version": "3.10.6"
665+
"version": "3.11.5"
662666
},
663667
"toc-showtags": false
664668
},

0 commit comments

Comments
 (0)