Skip to content

Commit

Permalink
[DOCS] Move the binder notebooks to docs and enable notebook renderin…
Browse files Browse the repository at this point in the history
…g in Sedona website (#1336)

* Move the binder file location and enable notebook visualization

* Fix linter
  • Loading branch information
jiayuasu authored Apr 14, 2024
1 parent 8324e2c commit dc7e5c9
Show file tree
Hide file tree
Showing 58 changed files with 2,707 additions and 38 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: pip install mkdocs-jupyter
- run: pip install mkdocs-material
- run: pip install mkdocs-macros-plugin
- run: pip install mkdocs-git-revision-date-localized-plugin
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
name: Run codespell
description: Check spelling with codespell
args: [--ignore-words=.github/linters/codespell.txt]
exclude: ^docs/image|^spark/common/src/test/resources
exclude: ^docs/image|^spark/common/src/test/resources|^docs/usecases
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Some of the key features of Apache Sedona include:

These are some of the key features of Apache Sedona, but it may offer additional capabilities depending on the specific version and configuration.

Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder) and play the interactive Sedona Python Jupyter Notebook immediately!
Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) and play the interactive Sedona Python Jupyter Notebook immediately!

## When to use Sedona?

Expand Down
6 changes: 3 additions & 3 deletions docker/sedona-spark-jupyterlab/sedona-jupyterlab.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ RUN ${SEDONA_HOME}/docker/sedona.sh ${sedona_version} ${geotools_wrapper_version
COPY docker/sedona-spark-jupyterlab/requirements.txt /opt/requirements.txt
RUN pip3 install -r /opt/requirements.txt

COPY binder/*.ipynb /opt/workspace/examples/
COPY binder/*.py /opt/workspace/examples/
COPY binder/data /opt/workspace/examples/data
COPY docs/usecases/*.ipynb /opt/workspace/examples/
COPY docs/usecases/*.py /opt/workspace/examples/
COPY docs/usecases/data /opt/workspace/examples/data

# Add the master IP address to all notebooks
RUN find /opt/workspace/examples/ -type f -name "*.ipynb" -exec sed -i 's/config = SedonaContext.builder()/config = SedonaContext.builder().master(\\"spark:\/\/localhost:7077\\")/' {} +
Expand Down
1 change: 1 addition & 0 deletions docs/api/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/rdocs/
/javadoc/
/scaladoc/
2 changes: 1 addition & 1 deletion docs/setup/compile.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Compile Sedona source code

[![Scala and Java build](https://github.com/apache/sedona/actions/workflows/java.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/java.yml) [![Python build](https://github.com/apache/sedona/actions/workflows/python.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/python.yml) [![R build](https://github.com/apache/sedona/actions/workflows/r.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/r.yml) [![Example project build](https://github.com/apache/sedona/actions/workflows/example.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/example.yml) [![Docs build](https://github.com/apache/sedona/actions/workflows/docs.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/docs.yml) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder)
[![Scala and Java build](https://github.com/apache/sedona/actions/workflows/java.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/java.yml) [![Python build](https://github.com/apache/sedona/actions/workflows/python.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/python.yml) [![R build](https://github.com/apache/sedona/actions/workflows/r.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/r.yml) [![Example project build](https://github.com/apache/sedona/actions/workflows/example.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/example.yml) [![Docs build](https://github.com/apache/sedona/actions/workflows/docs.yml/badge.svg)](https://github.com/apache/sedona/actions/workflows/docs.yml) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases)

## Compile Scala / Java source code

Expand Down
2 changes: 1 addition & 1 deletion docs/setup/install-python.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder) and play the interactive Sedona Python Jupyter Notebook immediately!
Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) and play the interactive Sedona Python Jupyter Notebook immediately!

Apache Sedona extends pyspark functions which depends on libraries:

Expand Down
8 changes: 4 additions & 4 deletions docs/tutorial/jupyter-notebook.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Python Jupyter Notebook Examples

Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder) and play the interactive Sedona Python Jupyter Notebook immediately!
Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) and play the interactive Sedona Python Jupyter Notebook immediately!

Sedona Python provides a number of [Jupyter Notebook examples](https://github.com/apache/sedona/blob/master/binder/).
Sedona Python provides a number of [Jupyter Notebook examples](https://github.com/apache/sedona/blob/master/docs/usecases/).

Please use the following steps to run Jupyter notebook with Pipenv on your machine

Expand All @@ -12,14 +12,14 @@ Please use the following steps to run Jupyter notebook with Pipenv on your machi
4. Setup pipenv python version. Please use your desired Python version.

```bash
cd binder
cd docs/usecases
pipenv --python 3.8
```

5. Install dependencies

```bash
cd binder
cd docs/usecases
pipenv install
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/raster.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Detailed SedonaSQL APIs are available here: [SedonaSQL API](../api/sql/Overview.
=== "Python"

1. Please read [Quick start](../setup/install-python.md) to install Sedona Python.
2. This tutorial is based on [Sedona SQL Jupyter Notebook example](jupyter-notebook.md). You can interact with Sedona Python Jupyter Notebook immediately on Binder. Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder) to interact with Sedona Python Jupyter notebook immediately on Binder.
2. This tutorial is based on [Sedona SQL Jupyter Notebook example](jupyter-notebook.md). You can interact with Sedona Python Jupyter Notebook immediately on Binder. Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) to interact with Sedona Python Jupyter notebook immediately on Binder.

## Create Sedona config

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/sql.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Detailed SedonaSQL APIs are available here: [SedonaSQL API](../api/sql/Overview.
=== "Python"

1. Please read [Quick start](../setup/install-python.md) to install Sedona Python.
2. This tutorial is based on [Sedona SQL Jupyter Notebook example](jupyter-notebook.md). You can interact with Sedona Python Jupyter notebook immediately on Binder. Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=binder) to interact with Sedona Python Jupyter notebook immediately on Binder.
2. This tutorial is based on [Sedona SQL Jupyter Notebook example](jupyter-notebook.md). You can interact with Sedona Python Jupyter notebook immediately on Binder. Click [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/apache/sedona/HEAD?filepath=docs/usecases) to interact with Sedona Python Jupyter notebook immediately on Binder.

## Create Sedona config

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "66a56fcb-27a5-4b37-a913-05a8f887d22f",
"metadata": {
"tags": []
},
"source": [
"# Understand Overture Map data"
]
},
{
"cell_type": "code",
"execution_count": 1,
Expand All @@ -16,22 +26,12 @@
"import geopandas as gpd"
]
},
{
"cell_type": "markdown",
"id": "66a56fcb-27a5-4b37-a913-05a8f887d22f",
"metadata": {
"tags": []
},
"source": [
"# Overture Map data"
]
},
{
"cell_type": "markdown",
"id": "3cfd484a-e6ac-4cdb-a8ac-2ed77fbd23db",
"metadata": {},
"source": [
"## Wherobots version\n",
"### Wherobots version\n",
"\n",
"Wherobots only releases a version for overturemaps-us-west-2/release/2023-07-26-alpha.0/.\n",
"\n",
Expand All @@ -55,7 +55,7 @@
"id": "b5fcf043-a97d-4321-ac16-fafcdbbcf3aa",
"metadata": {},
"source": [
"## OMF versions\n",
"### OMF versions\n",
"\n",
"The following files are official OMF releases. They are GeoParquet files generated by Apache Sedona.\n",
"\n",
Expand Down Expand Up @@ -83,7 +83,7 @@
"tags": []
},
"source": [
"# Create Sedona Context"
"## Create Sedona Context"
]
},
{
Expand Down Expand Up @@ -207,16 +207,17 @@
"id": "8f3340ee",
"metadata": {},
"source": [
"# Spatial filter by boundary"
"## Spatial filter by boundary"
]
},
{
"cell_type": "markdown",
"id": "8b1b506c",
"metadata": {},
"source": [
"### Pick a boundary.\n",
"#### Bellevue city is selected\n",
"### Pick a boundary\n",
"\n",
"Bellevue city is selected\n",
"\n",
"[Click here for boundaries of other states](https://gist.github.com/JoshuaCarroll/49630cbeeb254a49986e939a26672e9c)"
]
Expand Down Expand Up @@ -275,7 +276,7 @@
"id": "9d2cd7e5",
"metadata": {},
"source": [
"# Place Dataset "
"## Place Dataset "
]
},
{
Expand Down Expand Up @@ -836,7 +837,7 @@
"tags": []
},
"source": [
"# Building Dataset "
"## Building Dataset "
]
},
{
Expand Down Expand Up @@ -940,7 +941,7 @@
"id": "c0809afb",
"metadata": {},
"source": [
"# Admins Theme Datasets"
"## Admins Theme Datasets"
]
},
{
Expand Down Expand Up @@ -1140,7 +1141,7 @@
"id": "328ffd56",
"metadata": {},
"source": [
"# Transportation Theme Datasets"
"## Transportation Theme Datasets"
]
},
{
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit dc7e5c9

Please sign in to comment.