Skip to content

Commit 97e8000

Browse files
committed
Updated/re-ran example notebooks
Re-ran against the latest development branch
1 parent 8c860e1 commit 97e8000

File tree

2 files changed

+38
-40
lines changed

2 files changed

+38
-40
lines changed

Examples/TimeSeries_RetrieveVisualize.ipynb

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"\n",
1818
"More details on the ODM2 Python API and its source code and latest development can be found at https://github.com/ODM2/ODM2PythonAPI\n",
1919
"\n",
20-
"[Emilio Mayorga](https://github.com/emiliom/). Last updated 2019-4-18."
20+
"[Emilio Mayorga](https://github.com/emiliom/). Last updated 2019-5-10."
2121
]
2222
},
2323
{
@@ -33,12 +33,12 @@
3333
"metadata": {},
3434
"outputs": [],
3535
"source": [
36-
"%matplotlib inline\n",
37-
"\n",
3836
"import os\n",
3937
"\n",
4038
"import matplotlib as mpl\n",
4139
"import matplotlib.pyplot as plt\n",
40+
"%matplotlib inline\n",
41+
"\n",
4242
"import pandas as pd\n",
4343
"\n",
4444
"import odm2api\n",
@@ -81,7 +81,7 @@
8181
{
8282
"data": {
8383
"text/plain": [
84-
"'0.7.1+3.g0b0f9ab'"
84+
"'0.7.1+12.g6997f36'"
8585
]
8686
},
8787
"execution_count": 3,
@@ -216,7 +216,7 @@
216216
" 'SamplingFeatureName': u'Little Bear River at Mendon Road near Mendon, Utah',\n",
217217
" 'SamplingFeatureTypeCV': u'Site',\n",
218218
" 'SamplingFeatureUUID': u'6c74a4bd-e1d4-11e5-95b8-f45c8999816f',\n",
219-
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f9b7a96ce50>}"
219+
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5c65d0>}"
220220
]
221221
},
222222
"execution_count": 8,
@@ -291,7 +291,7 @@
291291
"text": [
292292
"The ResultID for the Result is: 1\n",
293293
"('The FeatureAction object for the Result is: ', <FeatureActions({'FeatureActionID': 1, 'SamplingFeatureID': 1, 'ActionID': 1})>)\n",
294-
"('The Action object for the Result is: ', <Actions({'MethodID': 1, 'ActionDescription': u'An observation action that generated a time series result.', 'ActionFileLink': None, 'EndDateTime': datetime.datetime(2009, 1, 16, 12, 30), 'BeginDateTime': datetime.datetime(2007, 8, 16, 16, 30), 'EndDateTimeUTCOffset': -7, 'ActionTypeCV': u'Observation', 'ActionID': 1, 'BeginDateTimeUTCOffset': -7})>)\n",
294+
"('The Action object for the Result is: ', <Actions({'MethodID': 1, 'ActionDescription': u'An observation action that generated a time series result.', 'ActionFileLink': None, 'EndDateTime': datetime.datetime(2009, 1, 16, 12, 30), 'BeginDateTime': datetime.datetime(2007, 8, 16, 16, 30), 'BeginDateTimeUTCOffset': -7, 'ActionTypeCV': u'Observation', 'ActionID': 1, 'EndDateTimeUTCOffset': -7})>)\n",
295295
"\n",
296296
"The following are some of the attributes for the Action that created the Result: \n",
297297
"ActionTypeCV: Observation\n",
@@ -358,7 +358,7 @@
358358
" 'ValidDateTimeUTCOffset': None,\n",
359359
" 'ValueCount': 24206,\n",
360360
" 'VariableID': 1,\n",
361-
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f9b7a99aad0>})"
361+
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5e7f90>})"
362362
]
363363
},
364364
"execution_count": 12,
@@ -437,7 +437,7 @@
437437
"\n",
438438
"## Retrieve Time Series Result Values for a given Result\n",
439439
"\n",
440-
"The database contains a single time series result (a time series of water temperature sensor data at a single site). Let's use the **getResults( )** function to retrieve the time series values for this result by passing in the ResultID. We set the index to `ValueDateTime` for convenience."
440+
"The database contains a single time series result (a time series of water temperature sensor data at a single site). Let's use the **getResultValues()** function to retrieve the time series values for this result by passing in the ResultID. We set the index to `ValueDateTime` for convenience."
441441
]
442442
},
443443
{
@@ -603,7 +603,7 @@
603603
{
604604
"data": {
605605
"text/plain": [
606-
"<matplotlib.axes._subplots.AxesSubplot at 0x7f9b7a8782d0>"
606+
"<matplotlib.axes._subplots.AxesSubplot at 0x7fd5bd5663d0>"
607607
]
608608
},
609609
"execution_count": 15,
@@ -652,7 +652,8 @@
652652
"tsValues['DataValue'].plot(ax=ax)\n",
653653
"\n",
654654
"ax.set_ylabel('{} ({})'.format(\n",
655-
" tsResult.VariableObj.VariableNameCV, tsResult.UnitsObj.UnitsAbbreviation))\n",
655+
" tsResult.VariableObj.VariableNameCV, \n",
656+
" tsResult.UnitsObj.UnitsAbbreviation))\n",
656657
"ax.set_xlabel('')\n",
657658
"\n",
658659
"ax.xaxis.set_minor_locator(mpl.dates.MonthLocator())\n",
@@ -686,7 +687,8 @@
686687
"nbconvert_exporter": "python",
687688
"pygments_lexer": "ipython2",
688689
"version": "2.7.15"
689-
}
690+
},
691+
"toc-autonumbering": false
690692
},
691693
"nbformat": 4,
692694
"nbformat_minor": 2

0 commit comments

Comments
 (0)