Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
595f411
combine queries to the same object into a single function
Mar 3, 2016
0c7fb35
update code in sample file to work with new query struture
Mar 7, 2016
566609f
adjust queries for ResultValues, affiliations, people, organizations,…
Mar 7, 2016
7133728
add Annotation objects and query
Mar 8, 2016
fac6abb
add tables from equipment schema
Mar 8, 2016
6047f1b
clean up queries and add them for lab analyses and Provenance schemas
Mar 8, 2016
ba911ff
update queries and add equipment queries
Mar 10, 2016
2bf515b
remove unneeded functions from readService
Mar 15, 2016
ed82918
rearrange model order
Mar 16, 2016
911537a
add code for related queries
Mar 17, 2016
e636f7b
Merge branch 'addqueries' into Dev1_0
Mar 17, 2016
dd233c0
new create functions
Mar 23, 2016
0c73b81
reformat createservices
Mar 23, 2016
dfcb7e3
update sample function calls, add inheritance in results, work on ge…
Mar 23, 2016
d14b3cf
implement polymorphic identity for SF and Results
Mar 23, 2016
d01a8f0
create CV parent class
Mar 23, 2016
3eb9b86
update sample to work with inheritance
Mar 30, 2016
13b664b
fix sample file so that it is not throwing an error when plotting
Apr 4, 2016
e304133
fix sample code to work with creating an inherited object
Apr 4, 2016
8179e10
Update models.py
emiliom Apr 7, 2016
b1cc22b
Merge pull request #39 from ODM2/addinheritance
Apr 11, 2016
ee6b859
add lists to all id and code fields
Apr 12, 2016
d476fe8
rename singular code to plural codes
Apr 12, 2016
40d407d
Merge branch 'master' into Dev1_0
Apr 15, 2016
3ed3253
Merge pull request #51 from ODM2/accept_lists
Apr 15, 2016
e82db59
update tests
Apr 18, 2016
a835f77
fix typos found by tests
Apr 18, 2016
892a3ec
fix typos found by tests, add FeatureGeometryWKT to testscripts
Apr 19, 2016
5585702
run pytest
Apr 19, 2016
f4473fb
alter insert into mysql script to account for featuregeometry wkt
Apr 19, 2016
70c56f1
add value to sampling feature type site for FeatureGeometryWKT
Apr 19, 2016
5d32e11
fix typo error
Apr 22, 2016
8ef2822
merging changes from master
Apr 22, 2016
9ac80e4
handle polymorphic case when no inherited class for specified type
Apr 22, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix typos found by tests
  • Loading branch information
Stephanie Reeder committed Apr 18, 2016
commit a835f77593d14a026563cef2c0cf21570897b75d
2 changes: 1 addition & 1 deletion odm2api/ODM2/services/readService.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ def getRelatedModels(self, id=None, code=None):

m = self._session.query(Models).select_from(RelatedModels).join(RelatedModels.RelatedModelObj)
if id: m = m.filter(RelatedModels.ModelID == id)
if code: m = m.filter(RelatedModels.ModelCode == code)
if code: m = m.filter(Models.ModelCode == code)

try:
return m.all()
Expand Down
1 change: 1 addition & 0 deletions tests/test_odm2/data/empty.sql
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ BEGIN TRANSACTION;CREATE TABLE ActionAnnotations (
SamplingFeatureDescription VARCHAR (500) NULL,
SamplingFeatureGeotypeCV VARCHAR (255) NULL,
FeatureGeometry geometry NULL,
FeatureGeometryWKT VARCHAR (50) NULL,
Elevation_m FLOAT NULL,
ElevationDatumCV VARCHAR (255) NULL,
FOREIGN KEY (ElevationDatumCV) REFERENCES CV_ElevationDatum (Name)
Expand Down
1 change: 1 addition & 0 deletions tests/test_odm2/data/populated.sql
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ CREATE TABLE SamplingFeatures (
SamplingFeatureDescription VARCHAR (500) NULL,
SamplingFeatureGeotypeCV VARCHAR (255) NULL,
FeatureGeometry geometry NULL,
FeatureGeometryWKT VARCHAR(50) NULL,
Elevation_m FLOAT NULL,
ElevationDatumCV VARCHAR (255) NULL,
FOREIGN KEY (ElevationDatumCV) REFERENCES CV_ElevationDatum (Name)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_odm2/test_createservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def test_createVariable(self):
nodv = -9999
speciation="mg/L as PO4"
definition="This is a test variable"
v = models.Variables(VariableCode = code, VariableName=name, VariableTypeCV=vType, NoDataValue= nodv, Speciation = speciation,
Definition=definition)
v = models.Variables(VariableCode = code, VariableNameCV=name, VariableTypeCV=vType, NoDataValue= nodv, SpeciationCV = speciation,
VariableDefinition=definition)
# self.writer.createVariable(code = code,name = name,vType = vType,nodv =nodv,speciation=None,definition=None)
self.writer.createVariable(v)
# assert that this dataset has been successfully inserted
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_createDataset(self):
# dstitle=title,
# dsabstract=desc)
#TODO uuid
d = models.Datasets(DataSetTypeCV = type, DataSetCode =code, DataSetTitle=title, DataSetAbstract = desc)
d = models.DataSets(DataSetTypeCV = type, DataSetCode =code, DataSetTitle=title, DataSetAbstract = desc)
dataset = self.writer.createDataset(d)


Expand Down Expand Up @@ -309,9 +309,9 @@ def test_createSimulation(self):
SimulationName ="MySimulation",
SimulationDescription = "My simulation description",
SimulationsStartDateTime = st,
SimulationStartOffset=6,
SimulationStartDateTimeUTCOffset=6,
SimulationEdnDateTime=et,
SimulationEndOffset=6,
SimulationEndDateTimeUTCOffset=6,
TimeStepValue=1,
TimeStepuUnitsID=1,
InputDataSetID=None
Expand Down
4 changes: 2 additions & 2 deletions tests/test_odm2/test_readservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_getModelByCode(self):


# get the model using the api
resapi = self.reader.getModels(code=modelCode)
resapi = self.reader.getModels(codes=[modelCode])

assert resapi is not None

Expand Down Expand Up @@ -212,7 +212,7 @@ def test_getSimulationByActionID(self):

# get simulation by actionid using the api
# resapi = self.reader.getSimulationByActionID(actionID=actionID)
resapi = self.reader.getSimulation(actionid=actionID)
resapi = self.reader.getSimulations(actionid=actionID)
assert resapi is not None

def test_getResultsBySimulationID(self):
Expand Down