Skip to content

Commit c5ed188

Browse files
author
Joel Collins
committed
Fixed FLK-D200
1 parent 9174715 commit c5ed188

File tree

9 files changed

+15
-45
lines changed

9 files changed

+15
-45
lines changed

examples/nested_thing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ def noisy_pdf(self, x_value, mu=0.0, sigma=25.0):
4747

4848
@property
4949
def data(self):
50-
"""
51-
Return a 1D data trace.
52-
"""
50+
"""Return a 1D data trace."""
5351
return DataSet(self.x_range, [self.noisy_pdf(x) for x in self.x_range])
5452

5553

examples/simple_thing.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@ def noisy_pdf(self, x, mu=0.0, sigma=25.0):
4141

4242
@property
4343
def data(self):
44-
"""
45-
Return a 1D data trace.
46-
"""
44+
"""Return a 1D data trace."""
4745
return [self.noisy_pdf(x) for x in self.x_range]
4846

4947
def average_data(self, n: int):
50-
"""
51-
Average n-sets of data. Emulates a measurement that may take a while.
52-
"""
48+
"""Average n-sets of data. Emulates a measurement that may take a while."""
5349
summed_data = self.data
5450

5551
for i in range(n):

labthings/core/tasks/thread.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ def __init__(self, target=None, name=None, args=None, kwargs=None, daemon=True):
6161

6262
@property
6363
def id(self):
64-
"""
65-
Return ID of current TaskThread
66-
"""
64+
"""Return ID of current TaskThread"""
6765
return self._ID
6866

6967
@property
@@ -112,9 +110,7 @@ def wrapped(*args, **kwargs):
112110
return wrapped
113111

114112
def run(self):
115-
"""
116-
Overrides default threading.Thread run() method
117-
"""
113+
"""Overrides default threading.Thread run() method"""
118114
logging.debug((self._args, self._kwargs))
119115
try:
120116
with self._running_lock:
@@ -128,9 +124,7 @@ def run(self):
128124
del self._target, self._args, self._kwargs
129125

130126
def wait(self):
131-
"""
132-
Start waiting for the task to finish before returning
133-
"""
127+
"""Start waiting for the task to finish before returning"""
134128
print("Joining thread {}".format(self))
135129
self.join()
136130
return self._return_value

labthings/server/decorators.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,7 @@ def __call__(self, viewcls):
156156

157157

158158
class use_body:
159-
"""
160-
Gets the request body as a single value and adds it as a positional argument
161-
"""
159+
"""Gets the request body as a single value and adds it as a positional argument"""
162160

163161
def __init__(self, schema, **kwargs):
164162
self.schema = schema
@@ -198,9 +196,7 @@ def wrapper(*args, **kwargs):
198196

199197

200198
class use_args:
201-
"""
202-
Equivalent to webargs.flask_parser.use_args
203-
"""
199+
"""Equivalent to webargs.flask_parser.use_args"""
204200

205201
def __init__(self, schema, **kwargs):
206202
self.schema = schema

labthings/server/labthing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,7 @@ def add_root_link(self, view, title, kwargs=None):
254254

255255
# Description
256256
def rootrep(self):
257-
"""
258-
Root representation
259-
"""
257+
"""Root representation"""
260258
# TODO: Allow custom root representations
261259

262260
rr = {

labthings/server/spec/utilities.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def map_to_properties(schema, spec: APISpec):
6969

7070

7171
def field_to_property(field, spec: APISpec):
72-
"""
73-
Convert a single Marshmallow field into a JSON schema of that field
74-
"""
72+
"""Convert a single Marshmallow field into a JSON schema of that field"""
7573
marshmallow_plugin = next(
7674
plugin for plugin in spec.plugins if isinstance(plugin, MarshmallowPlugin)
7775
)

labthings/server/views/docs/__init__.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,19 @@ class APISpecView(View):
1010
"""
1111

1212
def get(self):
13-
"""
14-
OpenAPI v3 documentation
15-
"""
13+
"""OpenAPI v3 documentation"""
1614
return current_labthing().spec.to_dict()
1715

1816

1917
class SwaggerUIView(View):
20-
"""
21-
Swagger UI documentation
22-
"""
18+
"""Swagger UI documentation"""
2319

2420
def get(self):
2521
return make_response(render_template("swagger-ui.html"))
2622

2723

2824
class W3CThingDescriptionView(View):
29-
"""
30-
W3C-style Thing Description
31-
"""
25+
"""W3C-style Thing Description"""
3226

3327
def get(self):
3428
return current_labthing().thing_description.to_dict()

labthings/server/views/extensions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99

1010
class ExtensionList(View):
11-
"""
12-
List and basic documentation for all enabled Extensions
13-
"""
11+
"""List and basic documentation for all enabled Extensions"""
1412

1513
@marshal_with(ExtensionSchema(many=True))
1614
def get(self):

labthings/server/views/tasks.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
class TaskList(View):
1212
@marshal_with(TaskSchema(many=True))
1313
def get(self):
14-
"""
15-
List of all session tasks
16-
"""
14+
"""List of all session tasks"""
1715
return tasks.tasks()
1816

1917

0 commit comments

Comments
 (0)