|
17 | 17 | #connect to database
|
18 | 18 | # createconnection (dbtype, servername, dbname, username, password)
|
19 | 19 | # session_factory = dbconnection.createConnection('connection type: sqlite|mysql|mssql|postgresql', '/your/path/to/db/goes/here', 2.0)#sqlite
|
20 |
| -session_factory = dbconnection.createConnection('postgresql', 'localhost', 'odm2', 'ODM', 'odm') |
21 |
| -# session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')#mysql |
22 | 20 |
|
23 |
| -# session_factory= dbconnection.createConnection('mssql', "(local)", "ODM2", "ODM", "odm")#win MSSQL |
24 | 21 |
|
| 22 | +# session_factory = dbconnection.createConnection('postgresql', 'localhost', 'odm2', 'ODM', 'odm') |
| 23 | +# session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')#mysql |
| 24 | +session_factory= dbconnection.createConnection('mssql', "(local)", "ODM2", "ODM", "odm")#win MSSQL |
25 | 25 | # session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "", "ODM", "odm")#mac/linux MSSQL
|
26 |
| -# session_factory = dbconnection.createConnection('sqlite', '/Users/stephanie/DEV/YODA-Tools/tests/test_files/XL_specimen.sqlite', 2.0) |
27 |
| - |
28 |
| - |
29 |
| - |
30 |
| - |
31 |
| - |
32 |
| - |
| 26 | +# session_factory = dbconnection.createConnection('sqlite', 'path/to/ODM2.sqlite', 2.0) |
33 | 27 |
|
34 | 28 |
|
35 | 29 |
|
|
67 | 61 | try:
|
68 | 62 | print ("\n-------- Information about Sites ---------")
|
69 | 63 | siteFeatures = read.getSamplingFeatures(type= 'site')
|
| 64 | + |
70 | 65 | # siteFeatures = read.getSamplingFeatures(type='Site')
|
71 | 66 | numSites = len(siteFeatures)
|
72 | 67 | print ("Successful query")
|
|
150 | 145 | # Get the values for a particular TimeSeriesResult
|
151 | 146 | print("\n-------- Example of Retrieving Time Series Result Values ---------")
|
152 | 147 |
|
153 |
| -tsValues = read.getResultValues(resultid = 1) # Return type is a pandas datafram |
| 148 | +tsValues = read.getResultValues(resultids = [1]) # Return type is a pandas datafram |
154 | 149 |
|
155 | 150 | # Print a few Time Series Values to the console
|
156 | 151 | # tsValues.set_index('ValueDateTime', inplace=True)
|
|
0 commit comments