Skip to content

Commit e636f7b

Browse files
author
Stephanie Reeder
committed
Merge branch 'addqueries' into Dev1_0
2 parents 58b647f + 911537a commit e636f7b

File tree

6 files changed

+963
-3173
lines changed

6 files changed

+963
-3173
lines changed

Examples/Sample.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#createconnection (dbtype, servername, dbname, username, password)
2424
#session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')
2525
#session_factory = dbconnection.createConnection('connection type: sqlite|mysql|mssql|postgresql', '/your/path/to/db/goes/here', 2.0)
26-
session_factory = dbconnection.createConnection('sqlite', '/Users/denversmith/Downloads/ODM2.sqlite', 2.0)
27-
# session_factory= dbconnection.createConnection('mssql')
26+
# session_factory= dbconnection.createConnection('mssql', "(local)", "LBRODM2", "ODM", "odm")
27+
session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "LBRODM2", "ODM", "odm")
2828

2929

3030

@@ -52,15 +52,15 @@
5252

5353
try:
5454
print "\n-------- Information about an Affiliation ---------"
55-
allaff = read.getAllAffiliations()
55+
allaff = read.getAffiliations()
5656
for x in allaff:
5757
print x.PersonObj.PersonFirstName + ": " + str(x.OrganizationID)
5858
except Exception as e:
5959
print "Unable to demo getAllAffiliations", e
6060

6161
# Get all of the SamplingFeatures from the database that are Sites
6262
try:
63-
siteFeatures = read.getSamplingFeaturesByType('Site')
63+
siteFeatures = read.getSamplingFeatures(type='Site')
6464
numSites = len(siteFeatures)
6565

6666
for x in siteFeatures:
@@ -71,7 +71,7 @@
7171

7272
# Now get the SamplingFeature object for a SamplingFeature code
7373
try:
74-
sf = read.getSamplingFeatureByCode('USU-LBR-Mendon')
74+
sf = read.getSamplingFeatures(code='USU-LBR-Mendon')
7575
print sf
7676
print "\n-------- Information about an individual SamplingFeature ---------"
7777
print "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n"
@@ -148,6 +148,7 @@
148148
print "\n-------- Example of Retrieving Time Series Result Values ---------"
149149

150150
tsValues = read.getTimeSeriesResultValuesByResultId(1) # Return type is a pandas dataframe
151+
tsValues = read.getResultValues(type = 'timeseries', id = 1)
151152

152153
# Print a few Time Series Values to the console
153154
# tsValues.set_index('ValueDateTime', inplace=True)

odm2api/ODM2/apiCustomType.py

Lines changed: 0 additions & 132 deletions
This file was deleted.

0 commit comments

Comments
 (0)