Skip to content

Commit 1b81956

Browse files
author
stephanie
committed
update conda channels in appveyor
1 parent f4ab3dc commit 1b81956

File tree

4 files changed

+23
-21
lines changed

4 files changed

+23
-21
lines changed

Examples/Sample.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@
8989
# from odm2api.ODM2.models import SamplingFeatures
9090
session = session_factory.getSession()
9191
newsf = Sites(FeatureGeometryWKT = "POINT(-111.946 41.718)", Elevation_m=100, ElevationDatumCV=sf.ElevationDatumCV,
92-
SamplingFeatureCode= "TestSF",SamplingFeatureDescription = "this is a test to add Feature Geomotry",
93-
SamplingFeatureGeotypeCV= "Point", SamplingFeatureTypeCV=sf.SamplingFeatureTypeCV,SamplingFeatureUUID= sf.SamplingFeatureUUID+"3",
92+
SamplingFeatureCode= "TestSF",SamplingFeatureDescription = "this is a test in sample.py",
93+
SamplingFeatureGeotypeCV= "Point", SamplingFeatureTypeCV=sf.SamplingFeatureTypeCV,SamplingFeatureUUID= sf.SamplingFeatureUUID+"2",
9494
SiteTypeCV="cave", Latitude= "100", Longitude= "-100", SpatialReferenceID= 0)
9595

96-
create.createSamplingFeature(newsf)
96+
c=create.createSamplingFeature(newsf)
9797
#session.commit()
98-
print("new sampling feature added to database", newsf)
98+
print("new sampling feature added to database", c)
9999

100100
except Exception as e :
101101
print("error adding a sampling feature: " + str(e))

appveyor.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ environment:
88
MINICONDA_VERSION: "latest"
99
# CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
1010
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers/appveyor/windows_sdk.cmd"
11-
CONDA_DEPENDENCIES: "scipy pandas seaborn sqlalchemy pymysql "
12-
PIP_DEPENDENCIES: "shapely,pyodbc,pytest,psycopg2"
11+
CONDA_CHANNELS: "ODM2"
12+
CONDA_DEPENDENCIES: "scipy pandas seaborn sqlalchemy pymysql geoalchemy-odm2 shapely psycopg2"
13+
PIP_DEPENDENCIES: "pyodbc,pytest"
1314
#,-e git+https://github.com/ODM2/geoalchemy.git@v0.7.4#egg=geoalchemy-0.7.4"
1415

1516

odm2api/ODM2/services/createService.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,16 @@ def createDatasetResults(self, datasetresult):
8383

8484
return datasetresult
8585

86-
def createAction(self, action, actionby):
86+
def createAction(self, action):
8787
self._session.add(action)
88-
89-
self._session.commit()
90-
self._session.flush()
91-
actionby.ActionID = action.ActionID
92-
self._session.add(actionby)
9388
self._session.commit()
9489
return action
9590

91+
def createActionby(self, actionby):
92+
93+
self._session.add(actionby)
94+
self._session.commit()
95+
return actionby
9696

9797
def createRelatedAction(self, relatedaction):
9898
self._session.add(relatedaction)

odm2api/ODM2/services/readService.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99

1010
class DetailedResult:
1111
def __init__(self, result,
12-
samplingFeature,
12+
sc, sn,
1313
method, variable,
1414
processingLevel,
1515
unit):
1616
# result.result_id etc.
1717
self.resultID = result.ResultID
18-
self.samplingFeatureCode = samplingFeature#.SamplingFeatureCode
18+
self.samplingFeatureCode = sc#.SamplingFeatureCode
1919
self.methodCode = method.MethodCode
2020
self.variableCode = variable.VariableCode
2121
self.processingLevelCode = processingLevel.ProcessingLevelCode
2222
self.unitsName = unit.UnitsName
2323

24-
self.samplingFeatureName = samplingFeature#.SamplingFeatureName
24+
self.samplingFeatureName = sn#.SamplingFeatureName
2525
self.methodName = method.MethodName
2626
self.variableNameCV = variable.VariableNameCV
2727
self.processingLevelDef = processingLevel.Definition
@@ -170,7 +170,7 @@ def getDetailedAffiliationInfo(self):
170170
return affiliationList
171171

172172
def getDetailedResultInfo(self, resultTypeCV, resultID=None):
173-
q = self._session.query(Results, SamplingFeatures.SamplingFeatureCode, Methods, Variables,
173+
q = self._session.query(Results, SamplingFeatures.SamplingFeatureCode, SamplingFeatures.SamplingFeatureName, Methods, Variables,
174174
ProcessingLevels, Units).filter(Results.VariableID == Variables.VariableID) \
175175
.filter(Results.UnitsID == Units.UnitsID) \
176176
.filter(Results.FeatureActionID == FeatureActions.FeatureActionID) \
@@ -181,14 +181,14 @@ def getDetailedResultInfo(self, resultTypeCV, resultID=None):
181181
.filter(Results.ResultTypeCV == resultTypeCV)
182182
resultList = []
183183
if resultID:
184-
for r, s, m, v, p, u in q.filter_by(ResultID=resultID).all():
184+
for r, sc, sn, m, v, p, u in q.filter_by(ResultID=resultID).all():
185185
detailedResult = DetailedResult( \
186-
r, s, m, v, p, u)
186+
r, sc, sn, m, v, p, u)
187187
resultList.append(detailedResult)
188188
else:
189-
for r, s, m, v, p, u in q.all():
189+
for r, sc, sn, m, v, p, u in q.all():
190190
detailedResult = DetailedResult( \
191-
r, s, m, v, p, u)
191+
r, sc, sn, m, v, p, u)
192192
resultList.append(detailedResult)
193193
return resultList
194194

@@ -466,7 +466,8 @@ def getResults(self, ids=None, uuids= None, actionid=None, simulationid = None)
466466

467467
try:
468468
return query.all()
469-
except:
469+
except Exception as e:
470+
print("Error running Query: %s" % e)
470471
return None
471472

472473
#

0 commit comments

Comments
 (0)