Skip to content

Commit

Permalink
Merge pull request #677 from astroidex/jupyter-reactivate-overview-qu…
Browse files Browse the repository at this point in the history
…ickstart

Jupyter reactivate overview quickstart
  • Loading branch information
astroidex committed Jan 26, 2021
2 parents e99be24 + d6f3a8b commit 4bc7836
Show file tree
Hide file tree
Showing 25 changed files with 725 additions and 147 deletions.
Binary file removed doc/images/projects/jupyter/jupyter-screenshot.png
Binary file not shown.
Binary file modified doc/images/projects/jupyter/jupyter1-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/projects/jupyter/jupyter1-2.png
Binary file not shown.
Binary file removed doc/images/projects/jupyter/jupyter1-3.png
Binary file not shown.
Binary file added doc/images/projects/jupyter/jupyter2-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/projects/jupyter/jupyter2-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/projects/jupyter/jupyter2-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/projects/jupyter/jupyter2.png
Binary file not shown.
Binary file added doc/images/projects/jupyter/jupyter3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/projects/jupyter/jupyter3-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/images/projects/jupyter/jupyter3.png
Binary file not shown.
Binary file removed doc/images/projects/jupyter/jupyter4.png
Binary file not shown.
Binary file removed doc/images/projects/jupyter/jupyter5.png
Binary file not shown.
Binary file removed doc/images/projects/jupyter/jupyter6.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 14 additions & 24 deletions doc/overview/jupyter_overview.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
:Author: jupyter developers team
:Author: Massimo Di Stefano
:Reviewer: Cameron Shorter, Jirotech
:Version: osgeolive9.5
:Reviewer: Astrid Emde, OSGeo
:Version: osgeolive14
:License: Creative Commons Attribution 3.0 Unported (CC BY 3.0)

@LOGO_jupyter@
Expand All @@ -18,57 +19,46 @@ The Jupyter Notebook is a web application that allows you to create and share do

It combines two components:

@SCREENSHOT_jupyter@


.. image:: /images/projects/jupyter/jupyter-screenshot.png
:scale: 70 %
:alt: screenshot
:align: center

.. Cameron Comment: Reverted to prior screenshot
New image was: .. image:: /images/projects/jupyter/jupyter6.png
The new image is too big, and has too much white space. Either it will need to be one snapshot, or layered over each other. The GeoServer image might provide some good inspiration: http://adhoc.osgeo.osuosl.org/livedvd/docs/_images/geoserver3.png
.. TBD: The image should show use of iPython Notebook with maps, possibly as
collage. Show an [In] cell with code. Show a heading or 2 and text
demonstrating how it is easy to build an publish powerful web pages.
* A web application providing browser-based, interactive authoring of notebook documents.

* Notebook documents which store a representation of all content visible in the web application, including inputs and outputs of computations, explanatory text, mathematics, code, images, videos, graphs, maps, and other rich media representations of objects.

@SCREENSHOT_jupyter@

Notebooks can be shared with others on GitHub, Dropbox, and the `Jupyter Notebook Viewer <https://nbviewer.jupyter.org/>`_.

Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.
Uses include: data cleaning and transformation, numerical simulation, statistical modeling, machine learning and much more.


Core Features
================================================================================

Create Jupyter notebooks which can contain:
Create Jupyter Notebooks which can contain:

* Marked up text (with headings, styles, paragraphs, etc)
* Formulas, mathematics, plots, maps, ...
* Imported external libraries to add functionality.
* Code from multiple programming languages, including python, R, Julia, Bash and many more.
* Imported external libraries to add functionality
* Code from multiple programming languages, including Python, R, Julia, Bash and many more.

Jupyter notebooks on OSGeoLive can use geospatial functions from:
Jupyter Notebooks on OSGeoLive can use geospatial functions from:

* Numpy, SciPy Matplotlib, IRIS, Cartopy, gdal, Geopandas, pyshp, Fiona, netCDF4, PostgreSQL, psycopg2, R, rpy2, and more.


Details
--------------------------------------------------------------------------------

**Website:** http://jupyter.org/
**Website:** @WEB_jupyter@

**Licence:** revised BSD license
**Licence:** The 3-Clause BSD License

**Software Version:** |version-jupyter|

**Supported Platforms:** Linux, Mac, Windows

**API Interfaces:** Python

**Support:** http://jupyter.org/community.html
**Support:** http://jupyter.org/community.html


@VMDK_jupyter@
Expand Down
116 changes: 54 additions & 62 deletions doc/quickstart/jupyter_quickstart.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
:Author: Massimo Di Stefano
:Author: Astrid Emde, OSGeo
:Contact: epiesasha at me dot com
:Version: osgeolive9.5
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
:Reviewer: Cameron Shorter, Jirotech
:Reviewer: Astrid Emde, OSGeo
:Version: osgeolive14
:License: Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)

@LOGO_jupyter@
@OSGEO_KIND_jupyter@
Expand All @@ -19,111 +21,101 @@ The Jupyter Notebook is a web application that allows you to create and share do

This Quick Start describes how to:

* start a jupyter notebook server
* load a jupyter notebook
* interact with python code and javascript widgets
* Start a Jupyter Notebook server
* Load a jupyter notebook
* Interact with python code

.. contents:: Contents

Start the jupyter server
Start the Jupyter server
================================================================================

From the application launch menu in the lower left corner.

* Choose *Geospatial* -> *Spatial Tools* -> *Start Jupyter Notebook*

.. image:: /images/projects/jupyter/jupyter1-1.png
:scale: 60 %

A terminal window will open and a startup log will begin to scroll.
* Choose *Geospatial* -> *Spatial Tools* -> *Jupyter Notebook*

* Choose *Geospatial* -> *Spatial Tools* -> *Jupyter Notebook*
A terminal window will open and a startup log will begin to scroll. Afterwards a web browser is launched showing the Jupyter Notebook dashboard.
From the Jupyter Notebook dashboard you can navigate the directory tree, start new notebooks, create files and directories, as well as rename, delete and upload files.

.. image:: /images/projects/jupyter/jupyter1-2.png
:scale: 60 %

A web browser is launched showing the notebook dashboard.

.. image:: /images/projects/jupyter/jupyter1-3.png
.. image:: /images/projects/jupyter/jupyter1-1.png
:scale: 60 %


From the notebook dashboard you can navigate the directory tree, start new notebooks, create files and directories, as well as rename, delete and upload files.

.. Cameron Comment. I suggest the first step should be to create a simple
"Hello World" notebook from scratch.
Probably then extend to simple calculations. Like "print 10 + 5 = 15".

Open and execute an existing notebook
================================================================================

Let's open an existing notebook. From the main page click on the directory GSOC.

.. Cameron Comment: We are going through too many steps here to find the
Cesium example. We should be able to select Cesium from the first TOC.
Let's open an existing notebook. From the main page click on the directory geopandas-tutorial and choose the Introduction notebook (01-introduction-geospatial-data.ipynb).
This is an introduction with many examples on how to use geospatial vector data in Python with geopandas using the Natural Earth2 data.

.. image:: /images/projects/jupyter/jupyter2.png
.. image:: /images/projects/jupyter/jupyter2-1.png
:scale: 80 %

The tutorial is made up with explaining text and cells. The cells contain in this case python code, that can be run.

Choose the Introduction notebook.

.. image:: /images/projects/jupyter/jupyter3.png
:scale: 60 %
From the toolbar on top of the notebook you can choose different options:

This is a simple notebook, which contains text and links, like a HTML web page.
* Cell-> Run Cells: will run the code in the cell with the focus and will move to the next cell.
* Cell-> Run All: will run all the cells and show the results If everything worked as planned you should be able to see the results at the bottom of the page.

Then under "Simple-web-gis-products" select "CESIUM".
Have a look at the results after running all the cells.

.. image:: /images/projects/jupyter/jupyter4.png
.. image:: /images/projects/jupyter/jupyter2-2.png
:scale: 60 %

You will see additional Out[] section with different output for example tables, maps or calculations.

In Out[3] you can see the country information as a table.

.. Cameron Comments:
* Suggest rename Interact to Interactive
.. image:: /images/projects/jupyter/jupyter2-2.png
:scale: 60 %

Here there is a series of examples using the cesium javascript library.
Let's click on "CesiumWidget Interact-Example", which uses the widget extension, some python libraries and cesium-js.

From the toolbar on top of the notebook choose: cell->run all. If everything worked as planned you should be able to see the results at the bottom of the page.
In Out[4] a plot was generated from all the countries.

.. image:: /images/projects/jupyter/jupyter5.png
.. image:: /images/projects/jupyter/jupyter2-3.png
:scale: 60 %




Change code
================================================================================

Now let's change some of the code:

In the code cell ``in [8]`` we generated a python dictionary based on some keywords (location names) with empty values:
Now let's change some of the code.

.. code-block:: python

in [8]: myplace = {'Eboli, IT':'', 'Woods Hole, MA':'', 'Durham, NH':''}
In In [10] a filter was defined for the countries. Only the continent ``Africa`` is selected from the countries:

and at the code input cell ``in [9]``, we loop over the dictionary keys and making use of a geocoding library ``geocoder``, we add the location information inside the previously created python dictionary ``my place``:
.. code-block:: python
In [10]: africa = countries[countries['continent'] == 'Africa']
Therefore in the plot there is only the continent ``Africa``.

.. image:: /images/projects/jupyter/jupyter3-1.png
:scale: 80 %

Change the selection to ``Asia`` and rund the two cells again.

.. code-block:: python
in [9]: import geocoder
import time
for i in myplace.keys():
g = geocoder.google(i)
print(g.latlng)
myplace[i]=g.latlng
In [10]: africa = countries[countries['continent'] == 'Asia']
As result you will see that instead of ``Africa`` there will be ``Asia`` in the plot.

Try to add or replace new keywords like we did in ``In [8]``
.. image:: /images/projects/jupyter/jupyter3-2.png
:scale: 80 %

.. code-block:: python

in []: mynewplace = {'Cairns, AU':'', 'Cooktown, AU':'', 'Darvin, AU':''}

and re run ``In [9] [10] [11]`` you will see the newly created dictionary is now used in the drop down menu to select the new location and zoom-to within the Cesium globe.

What Next?
================================================================================

For more information about the jupyter notebook, please refer to the `jupyter official documentation`_.
More notebook examples are available from the notebook root directory.
For a quick introduction on how to use the jupyter-notebook interface, from the start page, check the notebook: "Introduction to jupyter notebook"


.. _jupyter official documentation: http://jupyter.readthedocs.org/en/latest/index.html
* Discover the other notebooks that are provided with OSGeoLive and find out how to work with Shapely, Rasterio, R, Iris & other software.
* For more information about the jupyter notebook, please refer to the `Jupyter Notebooks official documentation <https://jupyter.readthedocs.io/>`_.
* More notebook examples are available from the notebook root directory.
* Quick introduction on how to use the Jupyter Notebooks interface: `Get started with Jupyter Notebook <https://jupyter.readthedocs.io/en/latest/content-quickstart.html>`_.
136 changes: 136 additions & 0 deletions locale/en/LC_MESSAGES/overview/jupyter_overview.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2011~2019, OSGeo
# This file is distributed under the same license as the OSGeoLive package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2021.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: OSGeoLive 14.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-01-26 21:04+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.9.0\n"

#: ../../build/doc/overview/jupyter_overview.rst:16
msgid "Jupyter Notebook"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:19
msgid "Mixing rich media in documentation"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:21
msgid ""
"The Jupyter Notebook is a web application that allows you to create and "
"share documents that contain live code, equations, visualizations and "
"explanatory text."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:23
msgid "It combines two components:"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:25
msgid ""
"A web application providing browser-based, interactive authoring of "
"notebook documents."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:27
msgid ""
"Notebook documents which store a representation of all content visible in"
" the web application, including inputs and outputs of computations, "
"explanatory text, mathematics, code, images, videos, graphs, maps, and "
"other rich media representations of objects."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:35
msgid ""
"Notebooks can be shared with others on GitHub, Dropbox, and the `Jupyter "
"Notebook Viewer <https://nbviewer.jupyter.org/>`_."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:37
msgid ""
"Uses include: data cleaning and transformation, numerical simulation, "
"statistical modeling, machine learning and much more."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:41
msgid "Core Features"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:43
msgid "Create Jupyter Notebooks which can contain:"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:45
msgid "Marked up text (with headings, styles, paragraphs, etc)"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:46
msgid "Formulas, mathematics, plots, maps, ..."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:47
msgid "Imported external libraries to add functionality"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:48
msgid ""
"Code from multiple programming languages, including Python, R, Julia, "
"Bash and many more."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:50
msgid "Jupyter Notebooks on OSGeoLive can use geospatial functions from:"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:52
msgid ""
"Numpy, SciPy Matplotlib, IRIS, Cartopy, gdal, Geopandas, pyshp, Fiona, "
"netCDF4, PostgreSQL, psycopg2, R, rpy2, and more."
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:56
msgid "Details"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:58
msgid "**Website:** http://jupyter.org/"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:60
msgid "**Licence:** The 3-Clause BSD License"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:62
msgid "**Software Version:** |version-jupyter|"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:64
msgid "**Supported Platforms:** Linux, Mac, Windows"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:66
msgid "**API Interfaces:** Python"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:68
msgid "**Support:** http://jupyter.org/community.html"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:74
msgid "Quickstart"
msgstr ""

#: ../../build/doc/overview/jupyter_overview.rst:76
msgid ":doc:`Quickstart documentation <../quickstart/jupyter_quickstart>`"
msgstr ""

Loading

0 comments on commit 4bc7836

Please sign in to comment.