Format fixes from black

This commit is contained in:
Richard Bowman 2022-08-09 13:17:45 +01:00
parent 9dbb083ee7
commit 106b50d333
13 changed files with 101 additions and 32 deletions

View file

@ -10,22 +10,27 @@ from openflexure_microscope.api.v2.views.captures import CaptureSchema
class CaptureResizeSchema(Schema):
width = fields.Integer(metadata={"example":640}, required=True)
width = fields.Integer(metadata={"example": 640}, required=True)
height = fields.Integer(metadata={"example": 480}, required=True)
class BasicCaptureArgs(Schema):
use_video_port = fields.Boolean(load_default=False)
bayer = fields.Boolean(
load_default=False, metadata={"description": "Include raw bayer data in capture"}
load_default=False,
metadata={"description": "Include raw bayer data in capture"},
)
resize = fields.Nested(CaptureResizeSchema(), required=False)
class FullCaptureArgs(BasicCaptureArgs):
filename = fields.String(metadata={"example": "MyFileName"})
temporary = fields.Boolean(load_default=False, metadata={"description": "Delete capture on shutdown"})
annotations = fields.Dict(load_default={}, metadata={"example": {"Client": "SwaggerUI"}})
temporary = fields.Boolean(
load_default=False, metadata={"description": "Delete capture on shutdown"}
)
annotations = fields.Dict(
load_default={}, metadata={"example": {"Client": "SwaggerUI"}}
)
tags = fields.List(fields.String, load_default=[], metadata={"example": ["docs"]})
@ -113,7 +118,11 @@ class GPUPreviewStartAPI(ActionView):
in the format ``[x, y, width, height]``.
"""
args = {"window": fields.List(fields.Integer, load_default=[], metadata={"example": [0, 0, 640, 480]})}
args = {
"window": fields.List(
fields.Integer, load_default=[], metadata={"example": [0, 0, 640, 480]}
)
}
def post(self, args):
"""

View file

@ -7,7 +7,8 @@ from labthings.views import ActionView
class MoveStageAPI(ActionView):
args = {
"absolute": fields.Boolean(
load_default=False, metadata={"description": "Move to an absolute position", "example": False}
load_default=False,
metadata={"description": "Move to an absolute position", "example": False},
),
"x": fields.Int(load_default=None, metadata={"example": 100}, allow_none=False),
"y": fields.Int(load_default=None, metadata={"example": 100}, allow_none=False),

View file

@ -9,7 +9,10 @@ class StageTypeProperty(PropertyView):
schema = fields.String(
load_default=None,
validate=validate.OneOf(["SangaStage", "SangaDeltaStage"]),
metadata={"description": "The translation stage geometry", "example": "SangaStage",},
metadata={
"description": "The translation stage geometry",
"example": "SangaStage",
},
allow_none=False,
)