Skip to content

Commit 97b825c

Browse files
committed
Merge branch 'master' into NA/guides_17
2 parents 4576738 + f9fb7ef commit 97b825c

20 files changed

+7465
-469
lines changed

docker/NotebookImage.Dockerfile

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
ARG python_version="3.11"
2-
FROM quay.io/jupyter/base-notebook:python-${python_version}
2+
FROM quay.io/jupyter/minimal-notebook:python-${python_version}
33

44
ARG python_version
5-
ARG arcgis_version="2.3.1"
5+
ARG arcgis_version="2.4.0"
66
ARG sampleslink="https://github.com/Esri/arcgis-python-api/releases/download/v${arcgis_version}/samples.zip"
77
ARG githubfolder="arcgis-python-api"
8-
ENV DOCKER_STACKS_JUPYTER_CMD="notebook"
8+
ARG env_name=arcgis
99

1010
LABEL org.opencontainers.image.authors="[email protected]"
11-
LABEL org.opencontainers.image.description="Jupyter Notebook with the latest version of the ArcGIS API for Python and its Linux dependencies preinstalled"
11+
LABEL org.opencontainers.image.description="Jupyter environment preconfigured for ArcGIS API for Python"
1212
LABEL org.opencontainers.image.licenses=Apache
1313
LABEL org.opencontainers.image.source=https://github.com/Esri/arcgis-python-api
1414

15-
USER root
16-
17-
RUN apt-get update --yes && \
18-
apt-get install --yes --no-install-recommends unzip && \
19-
apt-get clean && rm -rf /var/lib/apt/lists/*
20-
2115
USER ${NB_UID}
2216

2317
# Install Python API from Conda
24-
RUN conda install -c esri arcgis=${arcgis_version} -y \
18+
RUN conda create -n ${env_name} -c esri -c defaults arcgis=${arcgis_version} python=${python_version} -y --quiet --override-channels \
2519
&& conda clean --all -f -y \
2620
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +
2721

22+
# Install arcgis-mapping if arcgis_version >= 2.4.0
23+
RUN (dpkg --compare-versions $arcgis_version ge 2.4.0 \
24+
&& conda install -n ${env_name} -c esri -c defaults arcgis-mapping -y --quiet --override-channels \
25+
&& conda clean --all -f -y \
26+
&& find /opt/conda -name __pycache__ -type d -exec rm -rf {} +;) \
27+
|| echo "[INFO] Skipped installing arcgis-mapping for version $arcgis_version (>= 2.4.0 required for arcgis-mapping)"
28+
2829
# Fetch and extract samples from GitHub
2930
RUN mkdir /home/${NB_USER}/$githubfolder && \
3031
wget -O samples.zip $sampleslink \
@@ -36,7 +37,34 @@ RUN mkdir /home/${NB_USER}/$githubfolder && \
3637
work/ \
3738
talks/ \
3839
environment.yml\
40+
# remove .DS_Store and __MACOSX from home directory:
41+
&& find /home/${NB_USER} -name ".DS_Store" -delete \
42+
&& rm -rf /home/${NB_USER}/__MACOSX \
3943
&& fix-permissions /home/${NB_USER}
4044

41-
RUN rm /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
42-
COPY --chown=${NB_USER}:users jupyter_esri_logo.png /opt/conda/lib/python${python_version}/site-packages/notebook/static/base/images/logo.png
45+
# See https://jupyter-docker-stacks.readthedocs.io/en/latest/using/recipes.html#add-a-custom-conda-environment-and-jupyter-kernel
46+
# Create Python kernel and link it to jupyter
47+
RUN "${CONDA_DIR}/envs/${env_name}/bin/python" -m ipykernel install --user --name="${env_name}" && \
48+
fix-permissions "${CONDA_DIR}" && \
49+
fix-permissions "/home/${NB_USER}"
50+
51+
52+
# More information here: https://github.com/jupyter/docker-stacks/pull/2047
53+
USER root
54+
55+
# Set DOCKER_STACKS_JUPYTER_CMD to "notebook" for versions less than 2.4.0
56+
RUN \
57+
(dpkg --compare-versions $arcgis_version lt 2.4.0 \
58+
&& echo 'DOCKER_STACKS_JUPYTER_CMD="notebook"' >> /etc/environment \
59+
&& echo "[INFO] Set DOCKER_STACKS_JUPYTER_CMD to notebook for arcgis < 2.4.0") \
60+
|| echo "[INFO] Using default DOCKER_STACKS_JUPYTER_CMD (lab) for arcgis >= 2.4.0"
61+
62+
RUN \
63+
# This changes a startup hook, which will activate the custom environment for the process
64+
echo conda activate "${env_name}" >> /usr/local/bin/before-notebook.d/10activate-conda-env.sh && \
65+
# This makes the custom environment default in Jupyter Terminals for all users which might be created later
66+
echo conda activate "${env_name}" >> /etc/skel/.bashrc && \
67+
# This makes the custom environment default in Jupyter Terminals for already existing NB_USER
68+
echo conda activate "${env_name}" >> "/home/${NB_USER}/.bashrc"
69+
70+
USER ${NB_UID}

guide/02-api-overview/deprecation-notices.ipynb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"- `Swipe.edit` - deprecated in **2.4.0** removed in future major release. Use the `content` property setter instead.\n",
2929
"- `MapAction` - deprecated in **2.4.0** removed in future major release. Use the `MediaAction` class instead.\n",
3030
"- `JournalStoryMap` - deprecated in **2.0.0** removed in **2.4.0**. Template was removed from the ArcGIS platform.\n",
31+
"- `Hub.initiatives` - deprecated in **2.4.0** removed in a future release. Use `Hub.sites` instead.\n",
3132
"\n",
3233
"\n",
3334
"### `arcgis.learn` Module\n",
@@ -189,7 +190,7 @@
189190
"name": "python",
190191
"nbconvert_exporter": "python",
191192
"pygments_lexer": "ipython3",
192-
"version": "3.10.14"
193+
"version": "3.11.5"
193194
}
194195
},
195196
"nbformat": 4,

guide/02-api-overview/overview24.ipynb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
"Primary Python Support is for version 3.11. Secondary support is provided for Python 3.10 and 3.12. We have dropped Support for Python 3.9."
2121
]
2222
},
23+
{
24+
"cell_type": "markdown",
25+
"id": "ff163308-2526-4b3a-965b-5b430738c5f8",
26+
"metadata": {},
27+
"source": [
28+
"> **Note:** The ArcGIS API for Python 2.4.0 release is supported with:\n",
29+
"* ArcGIS Pro 3.4 and later cloned environments\n",
30+
"* ArcGIS Enterprise 11.4 and later\n",
31+
"* Stand-alone _conda_ and Python environments"
32+
]
33+
},
2334
{
2435
"cell_type": "markdown",
2536
"id": "3da4c48b-3c82-490f-9b76-d2063307b56c",
@@ -481,7 +492,7 @@
481492
"name": "python",
482493
"nbconvert_exporter": "python",
483494
"pygments_lexer": "ipython3",
484-
"version": "3.11.0"
495+
"version": "3.11.10"
485496
}
486497
},
487498
"nbformat": 4,

guide/02-api-overview/release_notes_240.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
"source": [
88
"# What's new in version 2.4.0\n",
99
"\n",
10+
"> **Note:** The ArcGIS API for Python 2.4.0 release is supported with ArcGIS Pro 3.4 and later cloned environments for use with _arcpy_. The 2.4.0 _arcgis_ and _arcgis-mapping_ packages are incompatible with ArcGIS Pro 3.3.x and earlier cloned environments. The default ArcGIS Pro 3.3.x environment can be cloned and upgraded to _arcgis_ packages of 2.3.x.\n",
11+
"\n",
1012
"## New\n",
1113
"Reorganized modules and refactored functionality into new classes to incorporate the new Jupyter Lab and Notebook 7 architectures.\n",
1214
"* Deprecated modules:\n",
@@ -492,7 +494,7 @@
492494
"name": "python",
493495
"nbconvert_exporter": "python",
494496
"pygments_lexer": "ipython3",
495-
"version": "3.11.0"
497+
"version": "3.11.10"
496498
},
497499
"toc": {
498500
"base_numbering": 1,

guide/03-the-gis/accessing-and-creating-content.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@
14251425
"source": [
14261426
"## Creating new content\n",
14271427
"\n",
1428-
"To create new items on your GIS, use the [`add()`](/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folder.add) method on a [`Folder`](/python/api-reference/arcgis.gis.toc.html#folder) instance. You can get an individual _folder_ using the [`Folders.get()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folders.get) method.\n",
1428+
"To create new items on your GIS, use the [`add()`](https://developers.arcgis.com/python/latest/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folder.add) method on a [`Folder`](/python/api-reference/arcgis.gis.toc.html#folder) instance. You can get an individual _folder_ using the [`Folders.get()`](/python/api-reference/arcgis.gis.toc.html#arcgis.gis._impl._content_manager.Folders.get) method.\n",
14291429
"\n",
14301430
"The `add()` method accepts a dictionary containing the properties of the item to be created. The optional `file`, `text`, `url`, and `data_url` parameters accept input to add the actual content. \n",
14311431
"\n",

guide/03-the-gis/managing-your-gis-servers.ipynb

Lines changed: 2126 additions & 1 deletion
Large diffs are not rendered by default.

guide/10-mapping-and-visualization/part2_navigating_the_map_widget.ipynb

Lines changed: 1742 additions & 1 deletion
Large diffs are not rendered by default.

guide/17-working-with-knowledge-graphs/part3_edit_knowledge_graph.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@
311311
"- esriFieldTypeOID\n",
312312
"- esriFieldTypeGeometry\n",
313313
" - with this type, you also need to [define geometryType](https://github.com/Esri/knowledge-pbf/blob/master/proto/esriPBuffer/EsriTypes.proto):\n",
314-
" - esriGeometryTypePoint\n",
315-
" - esriGeometryTypePolyline\n",
316-
" - esriGeometryTypePolygon\n",
317-
" - esriGeometryTypeMultipoint\n",
314+
" - esriGeometryPoint\n",
315+
" - esriGeometryPolyline\n",
316+
" - esriGeometryPolygon\n",
317+
" - esriGeometryMultipoint\n",
318318
"- esriFieldTypeGUID\n",
319319
"- esriFieldTypeGlobalID\n"
320320
]
@@ -337,7 +337,7 @@
337337
" },{\n",
338338
" \"name\": \"shape\",\n",
339339
" \"fieldtype\": \"esriFieldTypeGeometry\",\n",
340-
" \"geometryType\": \"esriGeometryTypePoint\"\n",
340+
" \"geometryType\": \"esriGeometryPoint\"\n",
341341
" }]\n",
342342
")"
343343
]

0 commit comments

Comments
 (0)