Skip to content

Commit

Permalink
Merge pull request #176 from ODM2/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
emiliom committed May 12, 2019
2 parents 952a42e + 53d0960 commit a5088ac
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 118 deletions.
90 changes: 53 additions & 37 deletions Examples/TimeSeries_RetrieveVisualize.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,9 @@
"\n",
"More details on the ODM2 Python API and its source code and latest development can be found at https://github.com/ODM2/ODM2PythonAPI\n",
"\n",
"[Emilio Mayorga](https://github.com/emiliom/). Last updated 2019-5-10."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Adapted from notebook https://big-cz.github.io/notebook_data_demo/notebooks/2017-06-24-odm2api_sample_fromsqlite/, based on earlier code and an ODM2 database from [Jeff Horsburgh's group](http://jeffh.usu.edu) at Utah State University."
"Adapted from notebook https://big-cz.github.io/notebook_data_demo/notebooks/2017-06-24-odm2api_sample_fromsqlite/, based on earlier code and an ODM2 database from [Jeff Horsburgh's group](http://jeffh.usu.edu) at Utah State University.\n",
"\n",
"[Emilio Mayorga](https://github.com/emiliom/)"
]
},
{
Expand All @@ -34,6 +29,7 @@
"outputs": [],
"source": [
"import os\n",
"import datetime\n",
"\n",
"import matplotlib as mpl\n",
"import matplotlib.pyplot as plt\n",
Expand All @@ -54,14 +50,34 @@
{
"data": {
"text/plain": [
"u'0.24.2'"
"'2019-05-12 01:56:25.421514 UTC'"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"{} UTC\".format(datetime.datetime.utcnow())"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"u'0.24.2'"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pd.__version__"
]
Expand All @@ -75,16 +91,16 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'0.7.1+12.g6997f36'"
"u'0.7.2'"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -106,7 +122,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -118,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -151,7 +167,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -179,7 +195,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand All @@ -188,7 +204,7 @@
"1"
]
},
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -200,7 +216,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -216,10 +232,10 @@
" 'SamplingFeatureName': u'Little Bear River at Mendon Road near Mendon, Utah',\n",
" 'SamplingFeatureTypeCV': u'Site',\n",
" 'SamplingFeatureUUID': u'6c74a4bd-e1d4-11e5-95b8-f45c8999816f',\n",
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5c65d0>}"
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f7b2e6cdfd0>}"
]
},
"execution_count": 8,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -230,7 +246,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -261,7 +277,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [
{
Expand All @@ -270,7 +286,7 @@
"1"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -282,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [
{
Expand All @@ -291,7 +307,7 @@
"text": [
"The ResultID for the Result is: 1\n",
"('The FeatureAction object for the Result is: ', <FeatureActions({'FeatureActionID': 1, 'SamplingFeatureID': 1, 'ActionID': 1})>)\n",
"('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",
"('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), 'BeginDateTimeUTCOffset': -7, 'EndDateTimeUTCOffset': -7, 'ActionTypeCV': u'Observation', 'ActionID': 1, 'BeginDateTime': datetime.datetime(2007, 8, 16, 16, 30)})>)\n",
"\n",
"The following are some of the attributes for the Action that created the Result: \n",
"ActionTypeCV: Observation\n",
Expand Down Expand Up @@ -335,7 +351,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"outputs": [
{
Expand All @@ -358,10 +374,10 @@
" 'ValidDateTimeUTCOffset': None,\n",
" 'ValueCount': 24206,\n",
" 'VariableID': 1,\n",
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7fd5bd5e7f90>})"
" '_sa_instance_state': <sqlalchemy.orm.state.InstanceState at 0x7f7b2e678d10>})"
]
},
"execution_count": 12,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -386,7 +402,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 14,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -442,7 +458,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -573,7 +589,7 @@
"2007-08-16 18:30:00 102 "
]
},
"execution_count": 14,
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -597,16 +613,16 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<matplotlib.axes._subplots.AxesSubplot at 0x7fd5bd5663d0>"
"<matplotlib.axes._subplots.AxesSubplot at 0x7f7b2e563250>"
]
},
"execution_count": 15,
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
},
Expand All @@ -629,7 +645,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 17,
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -672,9 +688,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:odm2api_dev]",
"display_name": "Python [conda env:odm2client]",
"language": "python",
"name": "conda-env-odm2api_dev-py"
"name": "conda-env-odm2client-py"
},
"language_info": {
"codemirror_mode": {
Expand Down
Loading

0 comments on commit a5088ac

Please sign in to comment.