|
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 |
|
26 | 26 | # session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "", "ODM", "odm")#mac/linux MSSQL |
27 | | -# session_factory = dbconnection.createConnection('sqlite', '/Users/stephanie/DEV/YODA-Tools/tests/test_files/XL_specimen.sqlite', 2.0) |
| 27 | +# session_factory = dbconnection.createConnection('sqlite', 'path/to/ODM2.sqlite', 2.0) |
28 | 28 |
|
29 | 29 |
|
30 | 30 |
|
|
34 | 34 | read = ReadODM2(session_factory) |
35 | 35 | create = CreateODM2(session_factory) |
36 | 36 |
|
37 | | - |
| 37 | +sitetest = read.getResults(sfid = 1) |
38 | 38 |
|
39 | 39 |
|
40 | 40 |
|
|
66 | 66 | try: |
67 | 67 | print ("\n-------- Information about Sites ---------") |
68 | 68 | siteFeatures = read.getSamplingFeatures(type= 'site') |
| 69 | + |
69 | 70 | # siteFeatures = read.getSamplingFeatures(type='Site') |
70 | 71 | numSites = len(siteFeatures) |
71 | 72 | print ("Successful query") |
|
149 | 150 | # Get the values for a particular TimeSeriesResult |
150 | 151 | print("\n-------- Example of Retrieving Time Series Result Values ---------") |
151 | 152 |
|
152 | | -tsValues = read.getResultValues(resultid = 1) # Return type is a pandas datafram |
| 153 | +tsValues = read.getResultValues(resultids = [1]) # Return type is a pandas datafram |
153 | 154 |
|
154 | 155 | # Print a few Time Series Values to the console |
155 | 156 | # tsValues.set_index('ValueDateTime', inplace=True) |
|
0 commit comments