Skip to content

Commit d6f3f56

Browse files
authored
Merge pull request #170 from emiliom/coding_std
Coding standards improvements
2 parents 334f660 + 6dfe590 commit d6f3f56

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

Diff for: odm2api/services/readService.py

+16-16
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def getAnnotations(self, annottype=None, codes=None, ids=None, **kwargs):
185185
a = Annotations
186186
self._check_kwargs(['type'], kwargs)
187187
if 'type' in kwargs:
188-
warnings.warn('The parameter \'type\' is deprecated. Please use the annottype parameter instead.',
188+
warnings.warn("The parameter 'type' is deprecated. Please use the annottype parameter instead.",
189189
DeprecationWarning, stacklevel=2)
190190
annottype = kwargs['type']
191191
if annottype:
@@ -238,7 +238,7 @@ def getCVs(self, cvtype, **kwargs):
238238
"""
239239
self._check_kwargs(['type'], kwargs)
240240
if 'type' in kwargs:
241-
warnings.warn('The parameter \'type\' is deprecated. Please use the cvtype parameter instead.',
241+
warnings.warn("The parameter 'type' is deprecated. Please use the cvtype parameter instead.",
242242
DeprecationWarning, stacklevel=2)
243243
cvtype = kwargs['type']
244244

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

@@ -517,7 +517,7 @@ def getSamplingFeatures(self, ids=None, codes=None, uuids=None,
517517
"""
518518
self._check_kwargs(['type'], kwargs)
519519
if 'type' in kwargs:
520-
warnings.warn('The parameter \'type\' is deprecated. Please use the sftype parameter instead.',
520+
warnings.warn("The parameter 'type' is deprecated. Please use the sftype parameter instead.",
521521
DeprecationWarning, stacklevel=2)
522522
sftype = kwargs['type']
523523
if results:
@@ -591,7 +591,7 @@ def getActions(self, ids=None, acttype=None, sfid=None, **kwargs):
591591
"""
592592
self._check_kwargs(['type'], kwargs)
593593
if 'type' in kwargs:
594-
warnings.warn('The parameter \'type\' is deprecated. Please use the acttype parameter instead.',
594+
warnings.warn("The parameter 'type' is deprecated. Please use the acttype parameter instead.",
595595
DeprecationWarning, stacklevel=2)
596596
acttype = kwargs['type']
597597
a = Actions
@@ -641,7 +641,7 @@ def getUnits(self, ids=None, name=None, unittype=None, **kwargs):
641641
"""
642642
self._check_kwargs(['type'], kwargs)
643643
if 'type' in kwargs:
644-
warnings.warn('The parameter \'type\' is deprecated. Please use the unittype parameter instead.',
644+
warnings.warn("The parameter 'type' is deprecated. Please use the unittype parameter instead.",
645645
DeprecationWarning, stacklevel=2)
646646
unittype = kwargs['type']
647647
q = self._session.query(Units)
@@ -779,7 +779,7 @@ def getResults(self, ids=None, restype=None, uuids=None, actionid=None, simulati
779779
query = self._session.query(Results)
780780
self._check_kwargs(['type', 'sfid'], kwargs)
781781
if 'type' in kwargs:
782-
warnings.warn('The parameter \'type\' is deprecated. Please use the restype parameter instead.',
782+
warnings.warn("The parameter 'type' is deprecated. Please use the restype parameter instead.",
783783
DeprecationWarning, stacklevel=2)
784784
restype = kwargs['type']
785785
if restype:
@@ -798,8 +798,8 @@ def getResults(self, ids=None, restype=None, uuids=None, actionid=None, simulati
798798
if actionid:
799799
query = query.join(FeatureActions).filter_by(ActionID=actionid)
800800
if 'sfid' in kwargs:
801-
warnings.warn('The parameter \'sfid\' is deprecated. '
802-
'Please use the sfids parameter instead and send in a list.',
801+
warnings.warn("The parameter 'sfid' is deprecated. " +
802+
"Please use the sfids parameter instead and send in a list.", # noqa
803803
DeprecationWarning, stacklevel=2)
804804
if kwargs['sfid']:
805805
query = query.join(FeatureActions).filter_by(SamplingFeatureID=kwargs['sfid'])
@@ -1087,7 +1087,7 @@ def getEquipment(self, codes=None, equiptype=None, sfid=None, actionid=None, **k
10871087
"""
10881088
self._check_kwargs(['type'], kwargs)
10891089
if 'type' in kwargs:
1090-
warnings.warn('The parameter \'type\' is deprecated. Please use the equiptype parameter instead.',
1090+
warnings.warn("The parameter 'type' is deprecated. Please use the equiptype parameter instead.",
10911091
DeprecationWarning, stacklevel=2)
10921092
equiptype = kwargs['type']
10931093

@@ -1191,7 +1191,7 @@ def getExtensionProperties(self, exptype=None, **kwargs):
11911191
# Todo what values to use for extensionproperties type
11921192
self._check_kwargs(['type'], kwargs)
11931193
if 'type' in kwargs:
1194-
warnings.warn('The parameter \'type\' is deprecated. Please use the exptype parameter instead.',
1194+
warnings.warn("The parameter 'type' is deprecated. Please use the exptype parameter instead.",
11951195
DeprecationWarning, stacklevel=2)
11961196
exptype = kwargs['type']
11971197
e = ExtensionProperties
@@ -1222,7 +1222,7 @@ def getExternalIdentifiers(self, eitype=None, **kwargs):
12221222
"""
12231223
self._check_kwargs(['type'], kwargs)
12241224
if 'type' in kwargs:
1225-
warnings.warn('The parameter \'type\' is deprecated. Please use the eitype parameter instead.',
1225+
warnings.warn("The parameter 'type' is deprecated. Please use the eitype parameter instead.",
12261226
DeprecationWarning, stacklevel=2)
12271227
eitype = kwargs['type']
12281228
e = ExternalIdentifierSystems
@@ -1415,9 +1415,9 @@ def getResultValues(self, resultids, starttime=None, endtime=None, lowercols=Tru
14151415
df.columns = [self._get_columns(ResultValues)[c] for c in df.columns]
14161416
else:
14171417
warnings.warn(
1418-
'In a near-future release, '
1419-
'the parameter \'lowercols\' default will be changed to False, '
1420-
'and later the parameter may be removed.',
1418+
"In a near-future release, " + # noqa
1419+
"the parameter 'lowercols' default will be changed to False, " +
1420+
"and later the parameter may be removed.", # noqa
14211421
DeprecationWarning, stacklevel=2)
14221422
return df
14231423
except Exception as e:
@@ -1487,7 +1487,7 @@ def getRelatedModels(self, modid=None, code=None, **kwargs):
14871487
"""
14881488
self._check_kwargs(['id'], kwargs)
14891489
if 'id' in kwargs:
1490-
warnings.warn('The parameter \'id\' is deprecated. Please use the modid parameter instead.',
1490+
warnings.warn("The parameter 'id' is deprecated. Please use the modid parameter instead.",
14911491
DeprecationWarning, stacklevel=2)
14921492
modid = kwargs['id']
14931493
m = self._session.query(Models).select_from(RelatedModels).join(RelatedModels.ModelObj)

Diff for: tests/test_odm2/test_readservice.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from os.path import abspath, dirname, join
44

55
from odm2api import models
6-
from odm2api.services.readService import ReadODM2
76
from odm2api.ODMconnection import dbconnection
7+
from odm2api.services.readService import ReadODM2
88

99
import pytest
1010

0 commit comments

Comments
 (0)