Skip to content

Commit

Permalink
Merge pull request #142 from ODM2/development
Browse files Browse the repository at this point in the history
Preparing for release 0.7, merging development to master
  • Loading branch information
emiliom authored Jan 19, 2018
2 parents 2f82702 + f634574 commit 85932e7
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 444 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ script:
fi

- if [[ $TEST_TARGET == 'coding_standards' ]]; then
find . -type f -name "*.py" ! -name 'conf.py' ! -name '_version.py' ! -name 'versioneer.py' | xargs flake8 --max-line-length=110 ;
find . -type f -name "*.py" ! -name 'conf.py' ! -name '_version.py' ! -name 'versioneer.py' ! -name '*DBConfig.py' ! -name 'Sample.py' | xargs flake8 --max-line-length=110 ;
fi

- if [[ $TEST_TARGET == 'docs' ]]; then
Expand Down
17 changes: 6 additions & 11 deletions Examples/Sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,13 @@
#connect to database
# createconnection (dbtype, servername, dbname, username, password)
# session_factory = dbconnection.createConnection('connection type: sqlite|mysql|mssql|postgresql', '/your/path/to/db/goes/here', 2.0)#sqlite
session_factory = dbconnection.createConnection('postgresql', 'localhost', 'odm2', 'ODM', 'odm')
# session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')#mysql

# session_factory= dbconnection.createConnection('mssql', "(local)", "ODM2", "ODM", "odm")#win MSSQL

# session_factory = dbconnection.createConnection('postgresql', 'localhost', 'odm2', 'ODM', 'odm')
# session_factory = dbconnection.createConnection('mysql', 'localhost', 'odm2', 'ODM', 'odm')#mysql
session_factory= dbconnection.createConnection('mssql', "(local)", "ODM2", "ODM", "odm")#win MSSQL
# session_factory= dbconnection.createConnection('mssql', "arroyoodm2", "", "ODM", "odm")#mac/linux MSSQL
# session_factory = dbconnection.createConnection('sqlite', '/Users/stephanie/DEV/YODA-Tools/tests/test_files/XL_specimen.sqlite', 2.0)






# session_factory = dbconnection.createConnection('sqlite', 'path/to/ODM2.sqlite', 2.0)



Expand Down Expand Up @@ -67,6 +61,7 @@
try:
print ("\n-------- Information about Sites ---------")
siteFeatures = read.getSamplingFeatures(type= 'site')

# siteFeatures = read.getSamplingFeatures(type='Site')
numSites = len(siteFeatures)
print ("Successful query")
Expand Down Expand Up @@ -150,7 +145,7 @@
# Get the values for a particular TimeSeriesResult
print("\n-------- Example of Retrieving Time Series Result Values ---------")

tsValues = read.getResultValues(resultid = 1) # Return type is a pandas datafram
tsValues = read.getResultValues(resultids = [1]) # Return type is a pandas datafram

# Print a few Time Series Values to the console
# tsValues.set_index('ValueDateTime', inplace=True)
Expand Down
172 changes: 42 additions & 130 deletions odm2api/ODM2/models.py

Large diffs are not rendered by default.

Loading

0 comments on commit 85932e7

Please sign in to comment.