|
23 | 23 | #createconnection (dbtype, servername, dbname, username, password)
|
24 | 24 | #session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')
|
25 | 25 | #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") |
28 | 28 |
|
29 | 29 |
|
30 | 30 |
|
|
52 | 52 |
|
53 | 53 | try:
|
54 | 54 | print "\n-------- Information about an Affiliation ---------"
|
55 |
| - allaff = read.getAllAffiliations() |
| 55 | + allaff = read.getAffiliations() |
56 | 56 | for x in allaff:
|
57 | 57 | print x.PersonObj.PersonFirstName + ": " + str(x.OrganizationID)
|
58 | 58 | except Exception as e:
|
59 | 59 | print "Unable to demo getAllAffiliations", e
|
60 | 60 |
|
61 | 61 | # Get all of the SamplingFeatures from the database that are Sites
|
62 | 62 | try:
|
63 |
| - siteFeatures = read.getSamplingFeaturesByType('Site') |
| 63 | + siteFeatures = read.getSamplingFeatures(type='Site') |
64 | 64 | numSites = len(siteFeatures)
|
65 | 65 |
|
66 | 66 | for x in siteFeatures:
|
|
71 | 71 |
|
72 | 72 | # Now get the SamplingFeature object for a SamplingFeature code
|
73 | 73 | try:
|
74 |
| - sf = read.getSamplingFeatureByCode('USU-LBR-Mendon') |
| 74 | + sf = read.getSamplingFeatures(code='USU-LBR-Mendon') |
75 | 75 | print sf
|
76 | 76 | print "\n-------- Information about an individual SamplingFeature ---------"
|
77 | 77 | print "The following are some of the attributes of a SamplingFeature retrieved using getSamplingFeatureByCode(): \n"
|
|
148 | 148 | print "\n-------- Example of Retrieving Time Series Result Values ---------"
|
149 | 149 |
|
150 | 150 | tsValues = read.getTimeSeriesResultValuesByResultId(1) # Return type is a pandas dataframe
|
| 151 | +tsValues = read.getResultValues(type = 'timeseries', id = 1) |
151 | 152 |
|
152 | 153 | # Print a few Time Series Values to the console
|
153 | 154 | # tsValues.set_index('ValueDateTime', inplace=True)
|
|
0 commit comments