Skip to content

Refactor of labscript.py #102

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
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5345e6d
Initial work centered around refactoring the `Device` and `compiler` …
philipstarkey Dec 30, 2023
461344e
Break out `Device` class into it's own file
philipstarkey Dec 30, 2023
994ccc6
Updated core device subclasses (`Pseudoclock`, `ClockLine`, `Triggera…
philipstarkey Jan 3, 2024
6e43872
Moved core classes into their own files. Also moved some utils functi…
philipstarkey Jan 3, 2024
63ce813
Updated output classes to more modern Python and improved some format…
philipstarkey Jan 3, 2024
6d4535b
* Move `Output` classes to a separate file.
philipstarkey Jan 3, 2024
96b3dd3
Revert change made that tried to write to a property
philipstarkey Jan 4, 2024
4d0089b
Fix bug in error condition. This was an error that perviously wasn't …
philipstarkey Jan 4, 2024
5b580ad
Fix bug with cached imports in utils
philipstarkey Jan 4, 2024
91025be
Revert change to use public property in `ClockLine.add_device` internals
philipstarkey Jan 27, 2024
ba082c1
Merge branch 'labscript-suite:master' into philipstarkey/v3-refactor
philipstarkey Jan 27, 2024
36dad35
First pass at getting new files included in the docs
philipstarkey Jan 27, 2024
8775e24
Updated connection table documentation with links to class documentat…
philipstarkey Jan 27, 2024
9a9e205
Attempt to fix module cross reference
philipstarkey Jan 27, 2024
59757a4
Added note about not using generic classes directly
philipstarkey Jan 27, 2024
5c04f42
Split `AnalogIn` into it's own module so that documentation makes a l…
philipstarkey Jan 27, 2024
5ea15e8
Added copyright notices and docstrings to new files
philipstarkey Jan 27, 2024
32b3d6e
Updated module doc strings so they are only a single sentence and rel…
philipstarkey Jan 27, 2024
7e0ab10
Reamed `Compiler` class to work around an autosummary bug
philipstarkey Jan 27, 2024
714d982
Remove `compiler` module from autosummary documentation due to a bug …
philipstarkey Jan 27, 2024
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
7 changes: 7 additions & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,12 @@ API Reference
:template: autosummary-module.rst
:recursive:

labscript.core
labscript.outputs
labscript.inputs
labscript.remote
labscript.constants
labscript.labscript
labscript.functions
labscript.base
labscript.utils
10 changes: 7 additions & 3 deletions docs/source/connection_table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ The connection table maps out the way input/output devices are connected to each
.. image:: img/connection_diagram.png
:alt: Example wiring diagram.

Here we see two :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>` instances in the top tier of the diagram. They do not have a parent device that tells them when to update their output (this is true for all :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>` instances). However, all but one (the master pseudoclock device) must be triggered by an output clocked by the master pseudoclock device.
Here we see two :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>` instances in the top tier of the diagram. They do not have a parent device that tells them when to update their output (this is true for all :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>` instances). However, all but one (the master pseudoclock device) must be triggered by an output clocked by the master pseudoclock device.

Each :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>` instance should have one or more :py:class:`Pseudoclock <labscript.Pseudoclock>` children. Some :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>` instances may automatically create these children for you (check the device specific documentation). In turn, each :py:class:`Pseudoclock <labscript.Pseudoclock>` will have one of more :py:class:`ClockLine <labscript.ClockLine>` instances connected to it. These :py:class:`ClockLine <labscript.ClockLine>` instances generally refer to physical outputs of a device which will be used to clock another device. However, in some cases, one or more :py:class:`ClockLine <labscript.ClockLine>` instances may be internally created for you (check the device specific documentation).
Each :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>` instance should have one or more :py:class:`Pseudoclock <labscript.core.Pseudoclock>` children. Some :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>` instances may automatically create these children for you (check the device specific documentation). In turn, each :py:class:`Pseudoclock <labscript.core.Pseudoclock>` will have one of more :py:class:`ClockLine <labscript.core.ClockLine>` instances connected to it. These :py:class:`ClockLine <labscript.core.ClockLine>` instances generally refer to physical outputs of a device which will be used to clock another device. However, in some cases, one or more :py:class:`ClockLine <labscript.core.ClockLine>` instances may be internally created for you (check the device specific documentation).

If a device is not a :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>`, it must be connected to one via a clockline. such devices inherit from :py:class:`IntermediateDevice <labscript.IntermediateDevice>`. Inputs and outputs are then connected to these devices. If a :py:class:`PseudoclockDevice <labscript.PseudoclockDevice>` also has outputs that are not used for a :py:class:`ClockLine <labscript.ClockLine>`, then an :py:class:`IntermediateDevice <labscript.IntermediateDevice>` is internally instantiated, and should be made available through the ``PseudoclockDevice.direct_outputs`` attribute (for example see PulseBlaster implementation TODO: link!).
If a device is not a :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>`, it must be connected to one via a clockline. such devices inherit from :py:class:`IntermediateDevice <labscript.core.IntermediateDevice>`. Inputs and outputs are then connected to these devices. For example, :py:class:`DigitalOut <labscript.outputs.DigitalOut>`, :py:class:`AnalogOut <labscript.outputs.AnalogOut>`, and :py:class:`DDS <labscript.outputs.DDS>`. See :py:mod:`labscript.outputs` and :py:mod:`labscript.inputs` for a complete list. Note that devices determine what types of inputs and outputs can be connected, see :doc:`labscript-devices <labscript-devices:index>` for device information.

If a :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>` also has outputs that are not used for a :py:class:`ClockLine <labscript.core.ClockLine>`, then an :py:class:`IntermediateDevice <labscript.core.IntermediateDevice>` is internally instantiated, and should be made available through the ``PseudoclockDevice.direct_outputs`` attribute (for example see the :py:class:`PulseBlaster <labscript_devices.PulseBlaster.PulseBlaster>` implementation).

.. note::
Most user's will not need to use :py:class:`PseudoclockDevice <labscript.core.PseudoclockDevice>`, :py:class:`Pseudoclock <labscript.core.Pseudoclock>`, and :py:class:`IntermediateDevice <labscript.core.IntermediateDevice>` directly. These are generic classes that are subclassed by device implementations in :doc:`labscript-devices <labscript-devices:index>`. It is these device implementations that you are most likely to use.
Loading