Blackened
This commit is contained in:
parent
ffc944fe99
commit
6df7fe9405
16 changed files with 22 additions and 64 deletions
|
|
@ -226,7 +226,7 @@ intersphinx_mapping = {
|
||||||
"openflexure_stage": ("https://openflexure-stage.readthedocs.io/en/latest/", None),
|
"openflexure_stage": ("https://openflexure-stage.readthedocs.io/en/latest/", None),
|
||||||
"picamera": ("https://picamera.readthedocs.io/en/release-1.13/", None),
|
"picamera": ("https://picamera.readthedocs.io/en/release-1.13/", None),
|
||||||
"marshmallow": ("https://marshmallow.readthedocs.io/en/stable/", None),
|
"marshmallow": ("https://marshmallow.readthedocs.io/en/stable/", None),
|
||||||
"webargs": ("https://webargs.readthedocs.io/en/latest/", None)
|
"webargs": ("https://webargs.readthedocs.io/en/latest/", None),
|
||||||
}
|
}
|
||||||
|
|
||||||
# -- Options for todo extension ----------------------------------------------
|
# -- Options for todo extension ----------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -11,4 +11,4 @@ try:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.error(
|
logging.error(
|
||||||
f"Exception loading builtin extension picamera_autocalibrate: \n{traceback.format_exc()}"
|
f"Exception loading builtin extension picamera_autocalibrate: \n{traceback.format_exc()}"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.extensions import BaseExtension
|
from labthings.server.extensions import BaseExtension
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import ThingAction, ThingProperty
|
||||||
ThingAction,
|
|
||||||
ThingProperty,
|
|
||||||
)
|
|
||||||
|
|
||||||
from openflexure_microscope.devel import JsonResponse, request, jsonify, taskify, abort
|
from openflexure_microscope.devel import JsonResponse, request, jsonify, taskify, abort
|
||||||
from openflexure_microscope.utilities import set_properties
|
from openflexure_microscope.utilities import set_properties
|
||||||
|
|
@ -359,7 +356,9 @@ class FastAutofocusAPI(View):
|
||||||
abort(503, "No stage connected. Unable to autofocus.")
|
abort(503, "No stage connected. Unable to autofocus.")
|
||||||
|
|
||||||
|
|
||||||
autofocus_extension_v2 = BaseExtension("org.openflexure.autofocus", version="2.0.0-beta.1")
|
autofocus_extension_v2 = BaseExtension(
|
||||||
|
"org.openflexure.autofocus", version="2.0.0-beta.1"
|
||||||
|
)
|
||||||
|
|
||||||
autofocus_extension_v2.add_method(fast_autofocus, "fast_autofocus")
|
autofocus_extension_v2.add_method(fast_autofocus, "fast_autofocus")
|
||||||
autofocus_extension_v2.add_method(autofocus, "autofocus")
|
autofocus_extension_v2.add_method(autofocus, "autofocus")
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.extensions import BaseExtension
|
from labthings.server.extensions import BaseExtension
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import marshal_task, ThingAction
|
||||||
marshal_task,
|
|
||||||
ThingAction,
|
|
||||||
)
|
|
||||||
|
|
||||||
from labthings.core.tasks import taskify
|
from labthings.core.tasks import taskify
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,9 @@ from typing import Tuple
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
from openflexure_microscope.camera.base import generate_basename
|
from openflexure_microscope.camera.base import generate_basename
|
||||||
from labthings.server.find import (
|
from labthings.server.find import find_component, find_extension
|
||||||
find_component,
|
|
||||||
find_extension,
|
|
||||||
)
|
|
||||||
from labthings.server.extensions import BaseExtension
|
from labthings.server.extensions import BaseExtension
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import marshal_task, use_args, ThingAction
|
||||||
marshal_task,
|
|
||||||
use_args,
|
|
||||||
ThingAction,
|
|
||||||
)
|
|
||||||
from labthings.server import fields
|
from labthings.server import fields
|
||||||
|
|
||||||
from openflexure_microscope.devel import taskify, abort, update_task_progress
|
from openflexure_microscope.devel import taskify, abort, update_task_progress
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,7 @@ import logging
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.extensions import BaseExtension
|
from labthings.server.extensions import BaseExtension
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import ThingAction, ThingProperty
|
||||||
ThingAction,
|
|
||||||
ThingProperty,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class ZipManager:
|
class ZipManager:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.extensions import BaseExtension
|
from labthings.server.extensions import BaseExtension
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import ThingAction, ThingProperty
|
||||||
ThingAction,
|
|
||||||
ThingProperty,
|
|
||||||
)
|
|
||||||
|
|
||||||
from openflexure_microscope.api.utilities.gui import build_gui
|
from openflexure_microscope.api.utilities.gui import build_gui
|
||||||
|
|
||||||
|
|
@ -35,7 +32,7 @@ def dynamic_form():
|
||||||
"name": "val_int",
|
"name": "val_int",
|
||||||
"label": "Number value",
|
"label": "Number value",
|
||||||
"minValue": 0,
|
"minValue": 0,
|
||||||
"value": val_int
|
"value": val_int,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldType": "htmlBlock",
|
"fieldType": "htmlBlock",
|
||||||
|
|
@ -66,7 +63,7 @@ static_form = {
|
||||||
"name": "val_int",
|
"name": "val_int",
|
||||||
"label": "Number value",
|
"label": "Number value",
|
||||||
"minValue": 0,
|
"minValue": 0,
|
||||||
"default": 1
|
"default": 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldType": "htmlBlock",
|
"fieldType": "htmlBlock",
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class ActionsView(View):
|
||||||
"self": {
|
"self": {
|
||||||
"href": current_labthing().url_for(action["view_class"]),
|
"href": current_labthing().url_for(action["view_class"]),
|
||||||
"mimetype": "application/json",
|
"mimetype": "application/json",
|
||||||
**description_from_view(action["view_class"])
|
**description_from_view(action["view_class"]),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rule": action["rule"],
|
"rule": action["rule"],
|
||||||
|
|
|
||||||
|
|
@ -132,10 +132,7 @@ class RAMCaptureAPI(View):
|
||||||
|
|
||||||
stream.seek(0)
|
stream.seek(0)
|
||||||
|
|
||||||
return send_file(
|
return send_file(io.BytesIO(stream.getbuffer()), mimetype="image/jpeg")
|
||||||
io.BytesIO(stream.getbuffer()),
|
|
||||||
mimetype="image/jpeg"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@ThingAction
|
@ThingAction
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,7 @@
|
||||||
from openflexure_microscope.api.utilities import JsonResponse
|
from openflexure_microscope.api.utilities import JsonResponse
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import use_args, marshal_with, doc, ThingAction
|
||||||
use_args,
|
|
||||||
marshal_with,
|
|
||||||
doc,
|
|
||||||
ThingAction,
|
|
||||||
)
|
|
||||||
from labthings.server import fields
|
from labthings.server import fields
|
||||||
|
|
||||||
from openflexure_microscope.utilities import axes_to_array, filter_dict
|
from openflexure_microscope.utilities import axes_to_array, filter_dict
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,7 @@ import subprocess
|
||||||
import os
|
import os
|
||||||
from sys import platform
|
from sys import platform
|
||||||
|
|
||||||
from labthings.server.decorators import (
|
from labthings.server.decorators import ThingAction, doc_response
|
||||||
ThingAction,
|
|
||||||
doc_response,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def is_raspberrypi(raise_on_errors=False):
|
def is_raspberrypi(raise_on_errors=False):
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,7 @@ from openflexure_microscope.api.utilities import get_bool, JsonResponse
|
||||||
from labthings.server.schema import Schema
|
from labthings.server.schema import Schema
|
||||||
from labthings.server import fields
|
from labthings.server import fields
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
from labthings.server.utilities import (
|
from labthings.server.utilities import description_from_view
|
||||||
description_from_view,
|
|
||||||
)
|
|
||||||
from labthings.server.decorators import marshal_with, doc_response, Tag, ThingProperty
|
from labthings.server.decorators import marshal_with, doc_response, Tag, ThingProperty
|
||||||
|
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
from openflexure_microscope.api.utilities import JsonResponse
|
from openflexure_microscope.api.utilities import JsonResponse
|
||||||
|
|
||||||
from labthings.core.utilities import (
|
from labthings.core.utilities import get_by_path, set_by_path, create_from_path
|
||||||
get_by_path,
|
|
||||||
set_by_path,
|
|
||||||
create_from_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
from openflexure_microscope.api.utilities import gen, JsonResponse
|
from openflexure_microscope.api.utilities import gen, JsonResponse
|
||||||
|
|
||||||
from labthings.core.utilities import (
|
from labthings.core.utilities import get_by_path, set_by_path, create_from_path
|
||||||
get_by_path,
|
|
||||||
set_by_path,
|
|
||||||
create_from_path,
|
|
||||||
)
|
|
||||||
|
|
||||||
from labthings.server.find import find_component
|
from labthings.server.find import find_component
|
||||||
from labthings.server.view import View
|
from labthings.server.view import View
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class Microscope:
|
||||||
# Initial attributes
|
# Initial attributes
|
||||||
self.id = uuid.uuid4() #: Microscope UUID
|
self.id = uuid.uuid4() #: Microscope UUID
|
||||||
self.name = self.id #: Microscope name (modifiable)
|
self.name = self.id #: Microscope name (modifiable)
|
||||||
self.fov = [0, 0] #: Microscope field-of-view in stage motor steps
|
self.fov = [0, 0] #: Microscope field-of-view in stage motor steps
|
||||||
self.camera = None #: Currently connected camera object
|
self.camera = None #: Currently connected camera object
|
||||||
self.stage = None #: Currently connected stage object
|
self.stage = None #: Currently connected stage object
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,11 +51,7 @@ class BaseStage(metaclass=ABCMeta):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def position_map(self):
|
def position_map(self):
|
||||||
return {
|
return {"x": self.position[0], "y": self.position[1], "z": self.position[2]}
|
||||||
"x": self.position[0],
|
|
||||||
"y": self.position[1],
|
|
||||||
"z": self.position[2],
|
|
||||||
}
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue