Skip to content

Commit 5f76a22

Browse files
committed
Update jupyter notebooks section
1 parent 7a1e899 commit 5f76a22

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

Examples/clientenvironment.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,9 @@ dependencies:
77
- yodatools
88
- requests
99
- scipy
10-
- xarray
11-
- folium
1210
- geopandas
13-
- gdal=2.2
14-
- owslib
15-
- ulmo
11+
- gdal
12+
- folium
1613
# Jupyter notebook
1714
- ipykernel
1815
- jupyter

docs/source/getstarted.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ To create a new environment "myenv" with the ``odm2api`` package:
4949

5050
conda create -n myenv -c conda-forge python=2.7 odm2api
5151

52+
Sample Jupyter notebooks
53+
------------------------
54+
55+
These two notebooks are complete, extended examples that illustrate reading from ODM2 databases and using the resulting data and metadata. They use SQLite ODM2 file databases that can be `downloaded here <https://github.com/ODM2/ODM2PythonAPI/tree/master/Examples/data>`_.
56+
A conda environment to run these notebooks can be created with the conda environment file
57+
`clientenvironment.yml <https://github.com/ODM2/ODM2PythonAPI/blob/master/Examples/clientenvironment.yml>`_.
58+
59+
1. `WaterQualityMeasurements_RetrieveVisualize.ipynb <https://nbviewer.jupyter.org/github/ODM2/ODM2PythonAPI/blob/master/Examples/WaterQualityMeasurements_RetrieveVisualize.ipynb>`_
60+
61+
2. `TimeSeries_RetrieveVisualize.ipynb <https://nbviewer.jupyter.org/github/ODM2/ODM2PythonAPI/blob/master/Examples/TimeSeries_RetrieveVisualize.ipynb>`_
5262

5363
Code examples
5464
-------------
@@ -63,12 +73,14 @@ Connect to an ODM2 database and open the connection for reading.
6373
from odm2api.ODMconnection import dbconnection
6474
import odm2api.services.readService as odm2rs
6575
66-
# A SQLite file-based connection
76+
# -----------------------------------------------------
77+
# 1. A SQLite file-based connection
6778
session_factory = dbconnection.createConnection('sqlite',
6879
'/myfilepath/odm2db.sqlite')
6980
read = odm2rs.ReadODM2(session_factory)
7081
71-
# A connection to a server-based database system
82+
# -----------------------------------------------------
83+
# 2. A server-based database system connection
7284
db_credentials = {
7385
'address': 'ip-or-domainname',
7486
'db': 'dbname',
@@ -93,21 +105,9 @@ then constructing and issuing a direct ``SQL UPDATE`` statement, like this:
93105
from odm2api.ODMconnection import dbconnection
94106
95107
session_factory = dbconnection.createConnection('postgresql',
96-
**db_cred)
108+
**db_credentials)
97109
DBSession = session_factory.getSession()
98110
99111
sq_str = " UPDATE mytable SET variablecode = 'xyz' WHERE variablecode = 'abc' "
100112
DBSession.execute(sql_str)
101113
DBSession.commit()
102-
103-
104-
Sample Jupyter notebooks
105-
------------------------
106-
107-
These two notebooks are complete, extended examples that illustrate reading from ODM2 databases and using the resulting data and metadata. They use SQLite ODM2 file databases that can be `downloaded here <https://github.com/ODM2/ODM2PythonAPI/tree/master/Examples/data>`_.
108-
A conda environment to run these notebooks can be created with the conda environment file
109-
`clientenvironment.yml <https://github.com/ODM2/ODM2PythonAPI/blob/master/Examples/clientenvironment.yml>`_.
110-
111-
1. `WaterQualityMeasurements_RetrieveVisualize.ipynb <https://github.com/ODM2/ODM2PythonAPI/blob/master/Examples/WaterQualityMeasurements_RetrieveVisualize.ipynb>`_
112-
113-
2. `TimeSeries_RetrieveVisualize.ipynb <https://github.com/ODM2/ODM2PythonAPI/blob/master/Examples/TimeSeries_RetrieveVisualize.ipynb>`_

0 commit comments

Comments
 (0)