Skip to content

Fix doc builds #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/source/adding_devices.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ If the functionality is similar enough, it may even be possible to simply sub-cl

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.
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 devices that are connected to another device controlled via labscript.

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.

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 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.
This also specifies which BLACS workers to use and provides necessary instantiation arguments.

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:

* `init`: This method initialised communications with the device. Not to be confused with the standard python class `__init__` method.
* `init`: This method initialises communications with the device. Not to be confused with the standard python class `__init__` method.
* `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.
* `check_remote_values`: This method reads the current settings of the device, updating the `BLACS_tab` widgets to reflect these values.
* `transition_to_buffered`: This method transitions the device to buffered shot mode, reading the shot h5 file and taking the saved instructions from `labscript_device.generate_code` and sending the appropriate commands to the hardware.
* `transition_to_manual`: This method transitions the device from buffered to manual mode. It does any necessary configuration to take the device out of buffered mode and is used to read an measurements and save them to the shot h5 file as results.
* `transition_to_manual`: This method transitions the device from buffered to manual mode. It does any necessary configuration to take the device out of buffered mode and is used to read any measurements and save them to the shot h5 file as results.

The `runviewer_parser` takes shot h5 files, reads the saved instructions, and allows you to view them in **runviewer** in order to visualise experiment timing.

Expand All @@ -47,7 +47,7 @@ The old style has the `labscript_device`, `BLACS_tab`, `BLACS_worker`, and `runv

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
This file imports :mod:`labscript-utils:labscript_utils.device_registry` via

.. code-block:: python

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

autodoc_typehints = 'description'
autoclass_content = 'both' # options: 'both', 'class', 'init'
autodoc_mock_imports = ['PyDAQmx']
autodoc_mock_imports = ['PyDAQmx','labscript_utils']

# Prefix each autosectionlabel with the name of the document it is in and a colon
autosectionlabel_prefix_document = True
Expand Down
1 change: 1 addition & 0 deletions labscript_devices/NI_DAQmx/models/generate_subclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

python generate_subclasses.py

For proper formatting of the code, you will need to install the `black` python package.
"""
import os
import warnings
Expand Down