diff --git a/pyproject.toml b/pyproject.toml index 68b6e6d9..7b09fcf6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,7 +129,6 @@ ignore = [ "D213", # incompatible with D212 "D400", # A stricter version of #415 that doesn't allow ! # The checkers below should be turned on as they complain about missing docstrings. - "D104", "D105", "D107", ] diff --git a/src/openflexure_microscope_server/__init__.py b/src/openflexure_microscope_server/__init__.py index e69de29b..67e2757a 100644 --- a/src/openflexure_microscope_server/__init__.py +++ b/src/openflexure_microscope_server/__init__.py @@ -0,0 +1,17 @@ +"""The OpenFlexure Microscope Server Package. + +The OpenFlexure Microscope Server is a LabThings-FastAPI server. All hardware +interfaces, and almost all functionality exposed over HTTP is done using ``Things``. + +On the microscope the server is started by systemd. It can be controlled using commands +such as ``ofm restart``, ``ofm start``, and ``ofm stop``. + +The server can also be run in simulation mode from the terminal. In the root directory +of the repository the server can be started with run: + +.. code-block:: bash + + openflexure-microscope-server --fallback -c ./ofm_config_simulation.json + + +""" diff --git a/src/openflexure_microscope_server/server/__init__.py b/src/openflexure_microscope_server/server/__init__.py index 9959978f..dc864e11 100644 --- a/src/openflexure_microscope_server/server/__init__.py +++ b/src/openflexure_microscope_server/server/__init__.py @@ -1,3 +1,5 @@ +"""A package responsible for, setup, booting, and shutting down the server.""" + from __future__ import annotations from typing import Optional, Callable diff --git a/src/openflexure_microscope_server/things/__init__.py b/src/openflexure_microscope_server/things/__init__.py index e69de29b..35b09029 100644 --- a/src/openflexure_microscope_server/things/__init__.py +++ b/src/openflexure_microscope_server/things/__init__.py @@ -0,0 +1,5 @@ +"""A package for all of the core LabThings-FastAPI Things shipped with the microscope. + +The microscope can be extended to be used with other hardware by creating a package +with other Things and including them in the LabThings-FastAPI config file. +""" diff --git a/src/openflexure_microscope_server/things/stage/__init__.py b/src/openflexure_microscope_server/things/stage/__init__.py index ab753dce..fb58cb65 100644 --- a/src/openflexure_microscope_server/things/stage/__init__.py +++ b/src/openflexure_microscope_server/things/stage/__init__.py @@ -1,3 +1,14 @@ +"""A package for stage control Things. + +`BaseStage` is the base class that provides core stage functionality, but +no hardware interface control. To create a stage Thing to control a specific +piece of hardware the BaseStage should be subclassed, and any method raising +a NotImplementedError should be created. + +As the object will be used as a context manager create the hardware connection in +``__enter__`` (not in ``__init__``), and close the connection with ``__exit__``. +""" + from __future__ import annotations from collections.abc import Sequence, Mapping diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..b58ffa86 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,6 @@ +"""The unit-test suite for the OpenFlexure Microscope Server. + +This package contains all of the unit tests that can be run without specific +hardware. See also the `hardware-specific-tests` directory and the +`integration-tests` directory for more testing!. +""" diff --git a/tests/mock_things/__init__.py b/tests/mock_things/__init__.py index e69de29b..78ba995c 100644 --- a/tests/mock_things/__init__.py +++ b/tests/mock_things/__init__.py @@ -0,0 +1,5 @@ +"""A package of test module providing mock Things for testing. + +The mock things do not subclass the origninal things to minimise the inflation of +test coverage. +"""