Skip to content

Commit 6e4465f

Browse files
author
Joel Collins
committed
Updated to simplified imports
1 parent 4cb418b commit 6e4465f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

docs/basic_usage/index.rst

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Basic usage
22
===========
33

4-
The easiest way to get started with Python-LabThings is via the :mod:`labthings.quick` module, and the :class:`labthings.LabThing` builder methods.
4+
The easiest way to get started with Python-LabThings is via the :meth:`labthings.create_app` module, and the :class:`labthings.LabThing` builder methods.
55

66
We will assume that for basic usage you already have some basic instrument control code. In our example, this is in the form of a ``PretendSpectrometer`` class, which will generate some data like your instrument control code might. Our ``PretendSpectrometer`` class has a ``data`` property which quickly returns a spectrum, an ``x_range`` property which determines the range of data we'll return, a ``magic_denoise`` property for cleaning up our signal, and a slow ``average_data(n)`` method to average ``n`` individual data measurements.
77

@@ -14,8 +14,7 @@ An example Lab Thing built from our ``PretendSpectrometer`` class, complete with
1414

1515
.. code-block:: python
1616
17-
from labthings.server.quick import create_app
18-
from labthings import fields
17+
from labthings import fields, create_app
1918
2019
from my_components import PretendSpectrometer
2120
@@ -62,13 +61,13 @@ An example Lab Thing built from our ``PretendSpectrometer`` class, complete with
6261
6362
# Start the app
6463
if __name__ == "__main__":
65-
from labthings.server.wsgi import Server
64+
from labthings import Server
6665
Server(app).run()
6766
6867
6968
Once started, the app will build and serve a full web API, and generate the following Thing Description:
7069

71-
.. code-block:: JSON
70+
.. code-block:: json
7271
7372
{
7473
"@context": [
@@ -152,8 +151,8 @@ Once started, the app will build and serve a full web API, and generate the foll
152151
}
153152
}
154153
},
155-
"links": [...],
156-
"securityDefinitions": {...},
154+
"links": [],
155+
"securityDefinitions": {},
157156
"security": "nosec_sc"
158157
}
159158

0 commit comments

Comments
 (0)