diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1b877c..b87bff32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## New features * Background detection can now be used in scans, if you have the background-detect extension. ([!153](https://gitlab.com/openflexure/openflexure-microscope-server/-/merge_requests/153)) * Support for Sangaboard firmware v1, via updated `sangaboard` dependency ([!154](https://gitlab.com/openflexure/openflexure-microscope-server/-/merge_requests/154)) +* Fixed links in the OpenAPI documentation describing actions etc. ([!155](https://gitlab.com/openflexure/openflexure-microscope-server/-/merge_requests/154)) # [v2.10.1](https://gitlab.com/openflexure/openflexure-microscope-server/compare/v2.10.0...v2.10.1) (2022-01-17) ## Bug fixes diff --git a/openflexure_microscope/api/openapi.py b/openflexure_microscope/api/openapi.py index f0605954..77677740 100644 --- a/openflexure_microscope/api/openapi.py +++ b/openflexure_microscope/api/openapi.py @@ -8,8 +8,8 @@ API_TAGS = [ "embedded in the JSON action description." ), "externalDocs": { - "url": "https://iot.mozilla.org/wot/#action-resource", - "description": "Mozilla's description of Web of Things 'Action' resources.", + "url": "https://www.w3.org/TR/wot-thing-description/#actionaffordance", + "description": "w3's description of Web of Things 'Action' resources.", }, }, { @@ -19,8 +19,8 @@ API_TAGS = [ "state of the microscope." ), "externalDocs": { - "url": "https://iot.mozilla.org/wot/#property-resource", - "description": "Mozilla's description of Web of Things 'Property' resources.", + "url": "https://www.w3.org/TR/wot-thing-description/#propertyaffordance", + "description": "w3's description of Web of Things 'Property' resources.", }, }, {"name": "captures", "description": ""}, diff --git a/openflexure_microscope/api/v2/views/actions/stage.py b/openflexure_microscope/api/v2/views/actions/stage.py index d13774ab..20412a6f 100644 --- a/openflexure_microscope/api/v2/views/actions/stage.py +++ b/openflexure_microscope/api/v2/views/actions/stage.py @@ -10,9 +10,9 @@ class MoveStageAPI(ActionView): 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), - "z": fields.Int(load_default=None, metadata={"example": 20}, allow_none=False), + "x": fields.Int(load_default=None, metadata={"example": 100}, allow_none=True), + "y": fields.Int(load_default=None, metadata={"example": 100}, allow_none=True), + "z": fields.Int(load_default=None, metadata={"example": 20}, allow_none=True), } def post(self, args): diff --git a/openflexure_microscope/api/v2/views/stage.py b/openflexure_microscope/api/v2/views/stage.py index bcfec3a9..c6437a24 100644 --- a/openflexure_microscope/api/v2/views/stage.py +++ b/openflexure_microscope/api/v2/views/stage.py @@ -7,7 +7,7 @@ class StageTypeProperty(PropertyView): """The type of the stage""" schema = fields.String( - load_default=None, + load_default="SangaStage", validate=validate.OneOf(["SangaStage", "SangaDeltaStage"]), metadata={ "description": "The translation stage geometry", diff --git a/openflexure_microscope/camera/pi.py b/openflexure_microscope/camera/pi.py index 6052363b..e46360fa 100644 --- a/openflexure_microscope/camera/pi.py +++ b/openflexure_microscope/camera/pi.py @@ -30,7 +30,7 @@ import logging import time # Type hinting -from typing import BinaryIO, Tuple, Union, Optional +from typing import BinaryIO, Optional, Tuple, Union import numpy as np @@ -307,7 +307,9 @@ class PiCameraStreamer(BaseCamera): self.picamera.zoom = new_fov def start_preview( - self, fullscreen: bool = True, window: Optional[Tuple[int, int, int, int]] = None + self, + fullscreen: bool = True, + window: Optional[Tuple[int, int, int, int]] = None, ): """Start the on board GPU camera preview.""" with self.lock(timeout=1): diff --git a/openflexure_microscope/config.py b/openflexure_microscope/config.py index 8ceed138..b2db8546 100644 --- a/openflexure_microscope/config.py +++ b/openflexure_microscope/config.py @@ -5,7 +5,6 @@ import os import shutil from typing import Optional - from .json import JSONEncoder from .paths import CONFIGURATION_FILE_PATH, SETTINGS_FILE_PATH