Skip to content

Commit 5ec7eb6

Browse files
author
sreeder
committed
update warning message
1 parent 1559213 commit 5ec7eb6

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Examples/Sample.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
#connect to database
1818
# createconnection (dbtype, servername, dbname, username, password)
1919
# 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
2220

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

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
2525

2626
# 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)
2828

2929

3030

@@ -34,7 +34,7 @@
3434
read = ReadODM2(session_factory)
3535
create = CreateODM2(session_factory)
3636

37-
37+
sitetest = read.getResults(sfid = 1)
3838

3939

4040

@@ -66,6 +66,7 @@
6666
try:
6767
print ("\n-------- Information about Sites ---------")
6868
siteFeatures = read.getSamplingFeatures(type= 'site')
69+
6970
# siteFeatures = read.getSamplingFeatures(type='Site')
7071
numSites = len(siteFeatures)
7172
print ("Successful query")
@@ -149,7 +150,7 @@
149150
# Get the values for a particular TimeSeriesResult
150151
print("\n-------- Example of Retrieving Time Series Result Values ---------")
151152

152-
tsValues = read.getResultValues(resultid = 1) # Return type is a pandas datafram
153+
tsValues = read.getResultValues(resultids = [1]) # Return type is a pandas datafram
153154

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

odm2api/ODM2/services/readService.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def getResults(self, ids=None, type=None, uuids=None, actionid=None, simulationi
671671
query = query.join(FeatureActions).filter_by(ActionID=actionid)
672672
if sfid:
673673
import warnings
674-
warnings.warn('the parameter sfid, will no longer be supported. please use the sfids parameter and send in a list. ')
674+
warnings.warn("The parameter 'sfid' is no longer be supported. Please use the sfids parameter and send in a list.")
675675
query = query.join(FeatureActions).filter_by(SamplingFeatureID=sfid)
676676
if sfids or sfcodes or sfuuids:
677677
sf_list = self.getSamplingFeatures(ids=sfids, codes=sfcodes, uuids=sfuuids)
@@ -695,7 +695,7 @@ def getResults(self, ids=None, type=None, uuids=None, actionid=None, simulationi
695695
# sfids = []
696696
# for sf in sf_list:
697697
# sfids.append(sf.SamplingFeatureID)
698-
698+
699699
query = query.join(FeatureActions).filter(FeatureActions.SamplingFeatureID.in_(sfids))
700700

701701
try:

tests/test_odm2/test_readservice.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ def test_getResultsBySFID(self):
137137

138138
# get the result using the api
139139
resapi = self.reader.getResults(sfids=[sfid])
140-
141140
assert resapi is not None
142141
assert len(resapi) > 0
143142
assert resapi[0].ResultID == res[0]

0 commit comments

Comments
 (0)