Skip to content

Commit

Permalink
Merge pull request #170 from emiliom/coding_std
Browse files Browse the repository at this point in the history
Coding standards improvements
  • Loading branch information
emiliom authored Apr 20, 2019
2 parents 334f660 + 6dfe590 commit d6f3f56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions odm2api/services/readService.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def getAnnotations(self, annottype=None, codes=None, ids=None, **kwargs):
a = Annotations
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the annottype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the annottype parameter instead.",
DeprecationWarning, stacklevel=2)
annottype = kwargs['type']
if annottype:
Expand Down Expand Up @@ -238,7 +238,7 @@ def getCVs(self, cvtype, **kwargs):
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the cvtype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the cvtype parameter instead.",
DeprecationWarning, stacklevel=2)
cvtype = kwargs['type']

Expand Down Expand Up @@ -430,7 +430,7 @@ def getMethods(self, ids=None, codes=None, methodtype=None, **kwargs):
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the medtype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the medtype parameter instead.",
DeprecationWarning, stacklevel=2)
methodtype = kwargs['type']

Expand Down Expand Up @@ -517,7 +517,7 @@ def getSamplingFeatures(self, ids=None, codes=None, uuids=None,
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the sftype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the sftype parameter instead.",
DeprecationWarning, stacklevel=2)
sftype = kwargs['type']
if results:
Expand Down Expand Up @@ -591,7 +591,7 @@ def getActions(self, ids=None, acttype=None, sfid=None, **kwargs):
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the acttype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the acttype parameter instead.",
DeprecationWarning, stacklevel=2)
acttype = kwargs['type']
a = Actions
Expand Down Expand Up @@ -641,7 +641,7 @@ def getUnits(self, ids=None, name=None, unittype=None, **kwargs):
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the unittype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the unittype parameter instead.",
DeprecationWarning, stacklevel=2)
unittype = kwargs['type']
q = self._session.query(Units)
Expand Down Expand Up @@ -779,7 +779,7 @@ def getResults(self, ids=None, restype=None, uuids=None, actionid=None, simulati
query = self._session.query(Results)
self._check_kwargs(['type', 'sfid'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the restype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the restype parameter instead.",
DeprecationWarning, stacklevel=2)
restype = kwargs['type']
if restype:
Expand All @@ -798,8 +798,8 @@ def getResults(self, ids=None, restype=None, uuids=None, actionid=None, simulati
if actionid:
query = query.join(FeatureActions).filter_by(ActionID=actionid)
if 'sfid' in kwargs:
warnings.warn('The parameter \'sfid\' is deprecated. '
'Please use the sfids parameter instead and send in a list.',
warnings.warn("The parameter 'sfid' is deprecated. " +
"Please use the sfids parameter instead and send in a list.", # noqa
DeprecationWarning, stacklevel=2)
if kwargs['sfid']:
query = query.join(FeatureActions).filter_by(SamplingFeatureID=kwargs['sfid'])
Expand Down Expand Up @@ -1087,7 +1087,7 @@ def getEquipment(self, codes=None, equiptype=None, sfid=None, actionid=None, **k
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the equiptype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the equiptype parameter instead.",
DeprecationWarning, stacklevel=2)
equiptype = kwargs['type']

Expand Down Expand Up @@ -1191,7 +1191,7 @@ def getExtensionProperties(self, exptype=None, **kwargs):
# Todo what values to use for extensionproperties type
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the exptype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the exptype parameter instead.",
DeprecationWarning, stacklevel=2)
exptype = kwargs['type']
e = ExtensionProperties
Expand Down Expand Up @@ -1222,7 +1222,7 @@ def getExternalIdentifiers(self, eitype=None, **kwargs):
"""
self._check_kwargs(['type'], kwargs)
if 'type' in kwargs:
warnings.warn('The parameter \'type\' is deprecated. Please use the eitype parameter instead.',
warnings.warn("The parameter 'type' is deprecated. Please use the eitype parameter instead.",
DeprecationWarning, stacklevel=2)
eitype = kwargs['type']
e = ExternalIdentifierSystems
Expand Down Expand Up @@ -1415,9 +1415,9 @@ def getResultValues(self, resultids, starttime=None, endtime=None, lowercols=Tru
df.columns = [self._get_columns(ResultValues)[c] for c in df.columns]
else:
warnings.warn(
'In a near-future release, '
'the parameter \'lowercols\' default will be changed to False, '
'and later the parameter may be removed.',
"In a near-future release, " + # noqa
"the parameter 'lowercols' default will be changed to False, " +
"and later the parameter may be removed.", # noqa
DeprecationWarning, stacklevel=2)
return df
except Exception as e:
Expand Down Expand Up @@ -1487,7 +1487,7 @@ def getRelatedModels(self, modid=None, code=None, **kwargs):
"""
self._check_kwargs(['id'], kwargs)
if 'id' in kwargs:
warnings.warn('The parameter \'id\' is deprecated. Please use the modid parameter instead.',
warnings.warn("The parameter 'id' is deprecated. Please use the modid parameter instead.",
DeprecationWarning, stacklevel=2)
modid = kwargs['id']
m = self._session.query(Models).select_from(RelatedModels).join(RelatedModels.ModelObj)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_odm2/test_readservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from os.path import abspath, dirname, join

from odm2api import models
from odm2api.services.readService import ReadODM2
from odm2api.ODMconnection import dbconnection
from odm2api.services.readService import ReadODM2

import pytest

Expand Down

0 comments on commit d6f3f56

Please sign in to comment.