Skip to content

Commit 50f8b27

Browse files
committed
Update docs formatting such that not more than
one sentence is on a line.
1 parent 24a5248 commit 50f8b27

File tree

13 files changed

+123
-44
lines changed

13 files changed

+123
-44
lines changed

docs/source/adding_devices.rst

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,23 @@ Though not strictly required, you should also consider providing a `runviewer_pa
1212
General Strategy
1313
~~~~~~~~~~~~~~~~
1414

15-
As a general rule, it is best to model new hardware implementations off of a currently implemented device that has similar functionality. If the functionality is similar enough, it may even be possible to simply sub-class the currently implemented device, which is likely preferrable.
15+
As a general rule, it is best to model new hardware implementations off of a currently implemented device that has similar functionality.
16+
If the functionality is similar enough, it may even be possible to simply sub-class the currently implemented device, which is likely preferrable.
1617

17-
Barring the above simple solution, one must work from scratch. It is best to begin by determining the **labscript** device class to inherit from: `Psuedoclock`, `Device`, `IntermediateDevice`. The first is for implementing Psuedoclock devices, the second is for generic devices that are not hardware timed by a pseudoclock, and the last is for hardware timed device that are connected to another device controlled via labscript.
18+
Barring the above simple solution, one must work from scratch.
19+
It is best to begin by determining the **labscript** device class to inherit from: `Psuedoclock`, `Device`, `IntermediateDevice`.
20+
The first is for implementing Psuedoclock devices, the second is for generic devices that are not hardware timed by a pseudoclock, and the last is for hardware timed device that are connected to another device controlled via labscript.
1821

19-
The `labscript_device` implements general configuration parameters, many of which are passed to the `BLACS_worker`. It also implements the `generate_code` method which converts **labscript** high-level instructions and saves them to the h5 file.
22+
The `labscript_device` implements general configuration parameters, many of which are passed to the `BLACS_worker`.
23+
It also implements the `generate_code` method which converts **labscript** high-level instructions and saves them to the h5 file.
2024

21-
The `BLACS_tab` defines the GUI widgets that control the device. This typically takes the form of using standard widgets provided by **labscript** for controlling **labscript** output primitives (ie `AnalogOut`, `DigitalOut`,`DDS`, etc). This configuration is done in the `initialiseGUI` method. This also links directly to the appropriate BLACS workers.
25+
The `BLACS_tab` defines the GUI widgets that control the device.
26+
This typically takes the form of using standard widgets provided by **labscript** for controlling **labscript** output primitives (ie `AnalogOut`, `DigitalOut`,`DDS`, etc).
27+
This configuration is done in the `initialiseGUI` method.
28+
This also links directly to the appropriate BLACS workers.
2229

23-
The `BLACS_worker` handles communication with the hardware itself and often represents the bulk of the work required to implement a new labscript device. In general, it should provide five different methods:
30+
The `BLACS_worker` handles communication with the hardware itself and often represents the bulk of the work required to implement a new labscript device.
31+
In general, it should provide five different methods:
2432

2533
* `init`: This method initialised communications with the device. Not to be confused with the standard python class `__init__` method.
2634
* `program_manual`: This method allows for user control of the device via the `BLACS_tab`, setting outputs to the values set in the `BLACS_tab` widgets.
@@ -37,7 +45,9 @@ There are currently two supported file organization styles for a labscript-devic
3745

3846
The old style has the `labscript_device`, `BLACS_tab`, `BLACS_worker`, and `runviewer_parser` all in the same file, which typically has the same name as the `labscript_device` class name.
3947

40-
The new style allows for arbitrary code organization, but typically has a folder named after the `labscript_device` with each device component in a different file (ie `labscript_devices.py`, `BLACS_workers.py`, etc). With this style, the folder requires an `__init__.py` file (which can be empty) as well as a `register_classes.py` file. This file imports :obj:`<labscript-utils:labscript_utils.device_registry>` via
48+
The new style allows for arbitrary code organization, but typically has a folder named after the `labscript_device` with each device component in a different file (ie `labscript_devices.py`, `BLACS_workers.py`, etc).
49+
With this style, the folder requires an `__init__.py` file (which can be empty) as well as a `register_classes.py` file.
50+
This file imports :obj:`<labscript-utils:labscript_utils.device_registry>` via
4151

4252
.. code-block:: python
4353
@@ -56,4 +66,5 @@ This function informs **labscript** where to find the necessary classes during i
5666
Contributions to **labscript-devices**
5767
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5868

59-
If you decide to implement a labscript-device for controlling new hardware, we highly encourage you to consider making a pull-request to the **labscript-devices** repository in order to add your work to the **labscript-suite**. Increasing the list of supported devices is an important way for the **labscript-suite** to continue to grow, allowing new users to more quickly get up and running with hardware they may already have.
69+
If you decide to implement a labscript-device for controlling new hardware, we highly encourage you to consider making a pull-request to the **labscript-devices** repository in order to add your work to the **labscript-suite**.
70+
Increasing the list of supported devices is an important way for the **labscript-suite** to continue to grow, allowing new users to more quickly get up and running with hardware they may already have.

docs/source/devices.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Here is a list of all the currently supported devices.
77
Pseudoclocks
88
~~~~~~~~~~~~
99

10-
Pseudoclocks provide the timing backbone of the labscript_suite. These devices produce hardware-timed clocklines that trigger other device outputs and acquisitions. Many pseudoclock devices also include other types of outputs, including digital voltage and DDS frequency synthesizers.
10+
Pseudoclocks provide the timing backbone of the labscript_suite.
11+
These devices produce hardware-timed clocklines that trigger other device outputs and acquisitions.
12+
Many pseudoclock devices also include other types of outputs, including digital voltage and DDS frequency synthesizers.
1113

1214
.. toctree::
1315
:maxdepth: 2
@@ -22,7 +24,8 @@ Pseudoclocks provide the timing backbone of the labscript_suite. These devices p
2224
NI DAQS
2325
~~~~~~~~~~~~
2426

25-
The NI_DAQmx device provides a generic interface for National Instruments data acquisition hardware. This includes digital and analog voltage I/O. These input/outputs can be either static or hardware-timed dynamically changing variables.
27+
The NI_DAQmx device provides a generic interface for National Instruments data acquisition hardware.
28+
This includes digital and analog voltage I/O. These input/outputs can be either static or hardware-timed dynamically changing variables.
2629

2730
.. toctree::
2831
:maxdepth: 2
@@ -32,7 +35,9 @@ The NI_DAQmx device provides a generic interface for National Instruments data a
3235
Cameras
3336
~~~~~~~~~~~~
3437

35-
The camera devices provide interfaces for using various scientific cameras to acquire hardware-timed images during an experiment. They are organized by the programming API the underlies the communication to the device. The "master" camera class which provides the core functionality and from which the others derive is the IMAQdx class.
38+
The camera devices provide interfaces for using various scientific cameras to acquire hardware-timed images during an experiment.
39+
They are organized by the programming API the underlies the communication to the device.
40+
The "master" camera class which provides the core functionality and from which the others derive is the IMAQdx class.
3641

3742
.. toctree::
3843
:maxdepth: 2

docs/source/devices/andorsolis.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Andor Solis Cameras
33

44
A labscript device for controlling Andor scientific cameras via the Andor SDK3 interface.
55

6-
Presently, this device is hard-coded for use with the iXon camera. Minor modifications can allow use with other Andor cameras, so long as they are compatible with the Andor SDK3 library.
6+
Presently, this device is hard-coded for use with the iXon camera.
7+
Minor modifications can allow use with other Andor cameras, so long as they are compatible with the Andor SDK3 library.
78

89
.. autosummary::
910
labscript_devices.AndorSolis.labscript_devices
@@ -13,7 +14,8 @@ Presently, this device is hard-coded for use with the iXon camera. Minor modific
1314
Installation
1415
~~~~~~~~~~~~
1516

16-
The Andor SDK is available from Andor as a paid product (typically purchased with the camera). It must be installed with the SDK directory added to the system path.
17+
The Andor SDK is available from Andor as a paid product (typically purchased with the camera).
18+
It must be installed with the SDK directory added to the system path.
1719

1820
Detailed Documentation
1921
~~~~~~~~~~~~~~~~~~~~~~

docs/source/devices/flycapture2.rst

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
FlyCapture2 Cameras
22
===================
33

4-
This device allows control of FLIR (formerly Point Grey) scientific cameras via the `FlyCapture2 SDK <https://www.flir.com/products/flycapture-sdk/>`_ with the now deprecated PyCapture2 wrapper. In order to use this device, both the SDK and the python wrapper must be installed. Note that PyCapture2 only supports up to Python 3.6.
4+
This device allows control of FLIR (formerly Point Grey) scientific cameras via the `FlyCapture2 SDK <https://www.flir.com/products/flycapture-sdk/>`_ with the now deprecated PyCapture2 wrapper.
5+
In order to use this device, both the SDK and the python wrapper must be installed.
6+
Note that PyCapture2 only supports up to Python 3.6.
57

68
The new FLIR SDK is supported using the :doc:`SpinnakerCamera labscript device <spinnaker>`.
79

@@ -15,21 +17,28 @@ Installation
1517

1618
First ensure that the FlyCapture2 SDK is installed.
1719

18-
The python wrapper is available via FLIR and is only released for Python up to 3.6. It must be installed separately, pointed to the correct conda environment during install.
20+
The python wrapper is available via FLIR and is only released for Python up to 3.6.
21+
It must be installed separately, pointed to the correct conda environment during install.
1922

2023

21-
For GigE cameras, ensure that the network interface card (NIC) on the computer with the BLACS controlling the camera has enabled Jumbo Frames. That maximum allowed value (typically 9000) is preferable to avoid dropped frames.
24+
For GigE cameras, ensure that the network interface card (NIC) on the computer with the BLACS controlling the camera has enabled Jumbo Frames.
25+
That maximum allowed value (typically 9000) is preferable to avoid dropped frames.
2226

2327
Usage
2428
~~~~~
2529

26-
Like the :doc:`IMAQdxCamera <IMAQdx>` device, the bulk of camera configuration is performed using a dictionary of kwargs, where the key names and values mirror those provided by the FlyCapture2 SDK interface. Which parameters can/need to be set depend on the communication interface. Discovery of what parameters are available can be done in three ways:
30+
Like the :doc:`IMAQdxCamera <IMAQdx>` device, the bulk of camera configuration is performed using a dictionary of kwargs, where the key names and values mirror those provided by the FlyCapture2 SDK interface.
31+
Which parameters can/need to be set depend on the communication interface.
32+
Discovery of what parameters are available can be done in three ways:
2733

2834
1. Careful reading of the FlyCapture2 SDK docs.
2935
2. Mirroring the FlyCap Viewer parameter names and values.
3036
3. Connecting to the camera with a minimal configuration, viewing the current parameters dictionary, and copying the relevant values to the connection table (preferred).
3137

32-
The python structure for setting these values differs somewhat from other camera devices in labscript, taking the form of nested dictionaries. This structure most closely matches the structure of the FlyCapture2 SDK in that each camera property has multiple sub-elements that control the feature. In this implementation, the standard camera properties are set using keys with ALL CAPS. The control of the Trigger Mode and Image Mode properties is handled separately, using a slightly different nesting structure than the other properties.
38+
The python structure for setting these values differs somewhat from other camera devices in labscript, taking the form of nested dictionaries.
39+
This structure most closely matches the structure of the FlyCapture2 SDK in that each camera property has multiple sub-elements that control the feature.
40+
In this implementation, the standard camera properties are set using keys with ALL CAPS.
41+
The control of the Trigger Mode and Image Mode properties is handled separately, using a slightly different nesting structure than the other properties.
3342

3443
Below is a generic configuration for a Point Grey Blackfly PGE-23S6M-C device.
3544

docs/source/devices/ni_daqs.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ NI Multifunction DAQs generally provide hardware channels for
5656
:class:`StaticDigitalOut <labscript:labscript.labscript.StaticDigitalOut>`,
5757
:class:`AnalogOut <labscript:labscript.labscript.AnalogOut>`,
5858
:class:`DigitalOut <labscript:labscript.labscript.DigitalOut>`,
59-
and :class:`AnalogIn <labscript:labscript.labscript.AnalogIn>` labscript quantities for use in experiments. Exact numbers of channels, performance, and configuration depend on the model of DAQ used.
59+
and :class:`AnalogIn <labscript:labscript.labscript.AnalogIn>` labscript quantities for use in experiments.
60+
Exact numbers of channels, performance, and configuration depend on the model of DAQ used.
6061

6162
.. code-block:: python
6263
@@ -78,7 +79,9 @@ and :class:`AnalogIn <labscript:labscript.labscript.AnalogIn>` labscript quantit
7879
AnalogOut('daq_ao0',daq,'ao0')
7980
AnalogIn('daq_ai1',daq,'ai1')
8081
81-
NI DAQs are also used within labscript to provide a :class:`WaitMonitor <labscript:labscript.labscript.waitmonitor>`. When configured, the `WaitMonitor` allows for arbitrary-length pauses in experiment execution, waiting for some trigger to restart. The monitor provides a measurement of the duration of the wait for use in interpreting the resulting data from the experiment.
82+
NI DAQs are also used within labscript to provide a :class:`WaitMonitor <labscript:labscript.labscript.waitmonitor>`.
83+
When configured, the `WaitMonitor` allows for arbitrary-length pauses in experiment execution, waiting for some trigger to restart.
84+
The monitor provides a measurement of the duration of the wait for use in interpreting the resulting data from the experiment.
8285

8386
Configuration uses three digital I/O connections on the DAQ:
8487

@@ -98,7 +101,9 @@ An example configuration of a `WaitMonitor` using a NI DAQ is shown here
98101
# Necessary to ensure even number of digital out lines in shot
99102
DigitalOut('daq_do1',daq,'port0/line1')
100103
101-
Note that the counter connection is specified using the logical label `'ctr0'`. On many NI DAQs, the physical connection to this counter is PFI9. The physical wiring for this configuration would have port0/line0 wired directly to PFI9, with PFI1 being sent to the master pseudoclock retriggering system in case of timeout. If timeouts are not expected/represent experiment failure, this physical connection can be omitted.
104+
Note that the counter connection is specified using the logical label `'ctr0'`. On many NI DAQs, the physical connection to this counter is PFI9.
105+
The physical wiring for this configuration would have port0/line0 wired directly to PFI9, with PFI1 being sent to the master pseudoclock retriggering system in case of timeout.
106+
If timeouts are not expected/represent experiment failure, this physical connection can be omitted.
102107

103108

104109
Detailed Documentation

docs/source/devices/opalkellyXEM3001.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ A pseudoclocking labscript device based on the OpalKelly XEM3001 integration mod
66
Installation
77
~~~~~~~~~~~~
88

9-
Firmware (.bit) files for the FPGA are available `here <https://github.com/labscript-suite/opalkellyxem3001>`_ and should be placed in the labscript_devices folder along with the `CiceroOpalKellyXEM3001.py` file. The Opal Kelly SDK, which provides the python bindings, is also required. The python bindings will need to either be added to the PATH or manually copied to the site-packages of the virtual environment that BLACS is running in.
9+
Firmware (.bit) files for the FPGA are available `here <https://github.com/labscript-suite/opalkellyxem3001>`_ and should be placed in the labscript_devices folder along with the `CiceroOpalKellyXEM3001.py` file.
10+
The Opal Kelly SDK, which provides the python bindings, is also required.
11+
The python bindings will need to either be added to the PATH or manually copied to the site-packages of the virtual environment that BLACS is running in.
1012

1113
Detailed Documentation
1214
~~~~~~~~~~~~~~~~~~~~~~

docs/source/devices/prawnblaster.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,12 @@ The PrawnBlaster takes advantage of the specs of the Pico to provide the followi
3030
Installation
3131
~~~~~~~~~~~~
3232

33-
In order to turn the standard Pico into a PrawnBlaster, you need to load the custom firmware available in the `Github repo <https://github.com/labscript-suite/PrawnBlaster/tree/master/build/prawnblaster>`_ onto the board. The simplest way to do this is by holding the reset button on the board while plugging the USB into a computer. This will bring up a mounted folder that you copy-paste the firmware to. Once copied, the board will reset and be ready to go.
33+
In order to turn the standard Pico into a PrawnBlaster, you need to load the custom firmware available in the `Github repo <https://github.com/labscript-suite/PrawnBlaster/tree/master/build/prawnblaster>`_ onto the board.
34+
The simplest way to do this is by holding the reset button on the board while plugging the USB into a computer.
35+
This will bring up a mounted folder that you copy-paste the firmware to. Once copied, the board will reset and be ready to go.
3436

35-
Note that this device communicates using a virtual COM port. The number is assigned by the controlling computer and will need to be determined in order for BLACS to connect to the PrawnBlaster.
37+
Note that this device communicates using a virtual COM port.
38+
The number is assigned by the controlling computer and will need to be determined in order for BLACS to connect to the PrawnBlaster.
3639

3740
Usage
3841
~~~~~

docs/source/devices/pulseblaster.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
Pulseblaster
22
============
33

4-
This labscript device controls the Spincore PulseblaserDDS-II-300-AWG. The Pulseblaster is a programmable pulse generator that is the typical timing backbone of an experiment (ie it generates the pseudoclock timing pulses that control execution of other devices in the experiment). This labscript device is the master implementation of the various Pulseblaster devices. Other Pulseblaster labscript devices subclass this device and make the relevant changes to hard-coded values. Most importantly, the `core_clock_freq` must be manually set to match that of the Pulseblaster being used in order for the timing of the programmed pulses to be correct (in the `labscript_device` and the `BLACS_worker`).
4+
This labscript device controls the Spincore PulseblaserDDS-II-300-AWG.
5+
The Pulseblaster is a programmable pulse generator that is the typical timing backbone of an experiment (ie it generates the pseudoclock timing pulses that control execution of other devices in the experiment).
6+
This labscript device is the master implementation of the various Pulseblaster devices.
7+
Other Pulseblaster labscript devices subclass this device and make the relevant changes to hard-coded values.
8+
Most importantly, the `core_clock_freq` must be manually set to match that of the Pulseblaster being used in order for the timing of the programmed pulses to be correct (in the `labscript_device` and the `BLACS_worker`).
59

610
This particular version of Pulseblaster has a 75 MHz core clock frequency and also has DDS synthesizer outputs.
711

812
Installation
913
~~~~~~~~~~~~
1014

11-
Use of the Pulseblaster requires driver installation available from the manufacturer `here <https://www.spincore.com/support/>`_. The corresponding python wrapper, `spinapi <https://github.com/chrisjbillington/spinapi/>`_ is available via pip.
15+
Use of the Pulseblaster requires driver installation available from the manufacturer `here <https://www.spincore.com/support/>`_.
16+
The corresponding python wrapper, `spinapi <https://github.com/chrisjbillington/spinapi/>`_ is available via pip.
1217

1318
.. code-block:: bash
1419

0 commit comments

Comments
 (0)