Skip to content

Commit c7dfc13

Browse files
committed
Squashed commit of the following:
commit eefdb75 Author: David Meyer <dihm@users.noreply.github.com> Date: Tue Dec 7 10:33:15 2021 -0500 Update setup.cfg to show python 3.9 support commit 6ea8316 Merge: 758b281 4cadcff Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 29 17:50:29 2021 -0500 Merge pull request #61 from dihm/PB_tweak Pulseblaster transition_to_buffered tweak commit 758b281 Merge: ef1e9b8 4ea4dc2 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 29 17:48:29 2021 -0500 Merge pull request #75 from dihm/DAQmx_AI_Diff Add support for differential analog inputs in NI_DAQmx commit 4ea4dc2 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 29 17:45:29 2021 -0500 Fixing docstring formatting. commit 7be7413 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 29 17:02:36 2021 -0500 Updating docstrings. commit 9a4d0a1 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 16:19:26 2021 -0500 Fix muffed indentation error. commit 052a0f0 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 16:17:18 2021 -0500 Fix bad logic in determining where things occur. commit 81b411d Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 16:11:21 2021 -0500 Updating to be more clear about how AI_start_delay is calculated, particularly in the case of devices that use AI_start_delay_ticks. commit 7123c4c Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 15:44:49 2021 -0500 Update version tag of NI_DAQmx to 1.1.0 to denote semi-significant changes to functionality. commit 2f5393c Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 15:44:15 2021 -0500 Update existing capabilities.json and pre-generated models with new functionality for AI termination configuration. Note, this commit also sorts out #67. commit be71723 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 15:35:44 2021 -0500 Fix extremely bad merge conflict resolution from #70. commit 0767130 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 15:07:35 2021 -0500 Adding explanatory warnings to the backwards compatibility code instructing users how to update existing configurations. commit f138144 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 14:28:51 2021 -0500 Add nominal support for analog inputs with the NRSE termination. commit 05146dd Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 14:20:20 2021 -0500 Update capabilities to include PXIe-4499 and USB-6363 commit 5be6992 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Oct 21 17:19:04 2021 -0400 Add more robust backwards compatibility checks for installations that have not updated their capabilities file or re-compiled the connection table. Should probably just add an error instructing to recompile if I go ahead and update all the capabilities files. commit 3116af4 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Oct 21 17:17:00 2021 -0400 Update docstring to include new DAQmx features. commit 539f328 Author: David Meyer <dihm.meyer@gmail.com> Date: Wed May 26 08:51:11 2021 -0400 Fix AI_start_delay_ticks logic so it actually works. commit d4eaf67 Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 24 17:33:26 2021 -0400 Add ability for DAQmx device to specify analog input delay in terms of sample clock periods. This is done by setting `AI_start_delay=None` and `AI_start_delay_ticks={int}` keyword arguments of labscript_device.__init__(). This is necessary for Dynamic Signal Acquisition devices with delta ADCs to properly calculate their input delays as the sample clock varies. commit 0a5f1d6 Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 24 17:02:54 2021 -0400 Configure get_capabilities to recognize PseudoDiff as a default AI_term. commit aeaf81b Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 24 16:29:17 2021 -0400 Add support of AI pseudoDiff termination. Device that requires this (a PXIe-4499) does handle start delays the same way as other DAQs. This current code just ignores that for now until a better solution gets worked out. DO NOT TRUST ABSOLUTE TIMING OF ANALOG INPUTS on such devices until this gets handled correctly! commit 5193aa9 Author: David Meyer <dihm.meyer@gmail.com> Date: Wed May 5 17:31:17 2021 -0400 Modified NI_DAQmx to handle differentially terminated analog inputs. Behavior is to either have all the inputs as single-ended or differential. Also modified `get_capabilities.py` a little more so that it will correctly set the default AI termination for devices that do not support RSE. Tested with a NI USB 6366. Was able to simultaneously sample at 2MS/s on two channels (the max spec for this device). commit 4d38383 Author: David Meyer <dihm.meyer@gmail.com> Date: Wed May 5 12:22:37 2021 -0400 Modifications to `get_capabilities.py` to handle DAQs to include details about Differential input channels. New details include the AI range for diff channels (which may be higher than the single-ended ones) and the number of RSE and Diff physical channels. This can now handle DAQs that do not have any RSE inputs (like the simultaneous sampling ones). Plan to implement to option to use differential inputs next. commit ef1e9b8 Merge: 1b66b81 9dc2162 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 15 15:18:03 2021 -0500 Merge pull request #85 from chrisjbillington/functionrunner-deserialise-fix Fix bug in FunctionRunner function deserialisation commit 1b66b81 Merge: db02508 0e85f73 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 15 15:15:53 2021 -0500 Merge pull request #86 from chrisjbillington/functionrunner-sort-fix Fix bug where FunctionRunner functions were sorted by name commit db02508 Merge: 737c37b 68fc0a8 Author: David Meyer <dihm@users.noreply.github.com> Date: Mon Nov 8 13:47:33 2021 -0500 Merge pull request #78 from ispielma/master Update to fix AI error that sometimes appears in nidaqmx. commit 737c37b Merge: 4b0722f 8909385 Author: David Meyer <dihm@users.noreply.github.com> Date: Fri Oct 22 17:48:08 2021 -0400 Merge pull request #88 from dihm/spinnaker_fix Quick fix for Spinnaker debugging commit 68fc0a8 Merge: be0970a 4b0722f Author: Ian B. Spielman <54444522+ispielma@users.noreply.github.com> Date: Tue Oct 12 08:27:57 2021 -0400 Merge branch 'labscript-suite:master' into master commit 4b0722f Merge: 75b175d c5f8a0f Author: Chris Billington <chrisjbillington@gmail.com> Date: Tue Oct 12 12:48:24 2021 +1100 Merge pull request #89 from chrisjbillington/novatech-runviewer-bug Resolve a bug in runviewer display of Novatech instructions commit c5f8a0f Author: chrisjbillington <chrisjbillington@gmail.com> Date: Tue Oct 12 12:44:28 2021 +1100 Resolve a bug in runviewer display of Novatech instructions This is an off-by-one error caused by incorrect use of `getattr` instead of `dict.get` to provide defaults when reading connection table properties for the device. commit 8909385 Author: David Meyer <dihm@users.noreply.github.com> Date: Wed Sep 1 11:04:25 2021 -0400 Quick fix for Spinnaker debugging as recommended in #72. commit 0e85f73 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Aug 20 14:33:25 2021 +1000 Fix bug where FunctionRunner functions were sorted by name Instead of remaining in the order they were added. Functions are intended to be sorted by time, but not by anything else. But naively sorting the tuples caused them to be sorted unintentionally by name if they had the same time. commit 9dc2162 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Aug 20 14:30:22 2021 +1000 Fix bug in FunctionRunner function deserialisation In h5py 3.0, all strings from datasets are returned as bytestrings: h5py/h5py#1338 Luckily this isn't more of an issue throughout the labscript suite, because we still have lots of code that is unassuming about string datatypes due to the port from Python 2. But it will probably show up elsewhere too. commit 4cadcff Author: David Meyer <dihm.meyer@gmail.com> Date: Mon Jul 6 10:41:18 2020 -0400 Tweak transition_to_buffered method for No DDS Pulseblasters. Now pb_start_programming() is called only if actual programming is needed or when using the 'pb_stop_programming/STOP' scheme. This helps an issue with some older firmwares where all outputs blank while programming, in conjunction with the 'pb_start/BRANCH' scheme, by limiting how often the device enters programming. commit 75b175d Merge: ac33c58 2eaf0ba Author: David Meyer <dihm@users.noreply.github.com> Date: Tue Aug 10 16:17:26 2021 -0400 Merge pull request #83 from dihm/3rd_party_devices_docs 3rd Party Repo List commit 2eaf0ba Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Aug 10 09:21:12 2021 -0400 Fixing minor typos. commit ac33c58 Merge: 141a299 0af6f83 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sun Aug 1 17:15:26 2021 +1000 Merge pull request #84 from philipstarkey/philipstarkey/prawnblaster-fix Fixed PrawnBlaster runviewer class commit 50f8b27 Author: David Meyer <dihm.meyer@gmail.com> Date: Mon Jul 26 08:04:50 2021 -0400 Update docs formatting such that not more than one sentence is on a line. commit 0af6f83 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sat Jul 24 19:33:17 2021 +1000 Fixed PrawnBlaster runviewer class There was a bug where runviewer did not correctly parse pulse programs for pseudoclocks/clocklines 1, 2, and 3. There were several bugs (redefinition of a global variable inside a loop and a loop nested when it shouldn't have been. This should now be resolved. Thanks to Amilson Fritsch for discovering this. commit 24a5248 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Jul 23 14:39:23 2021 -0400 Add disclaimer to 3rd party devices description. commit 85e0b79 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Jul 22 16:43:15 2021 -0400 Add small section for listing 3rd party devices repos to the docs. commit 141a299 Merge: 7b8adc6 a60d541 Author: David Meyer <dihm@users.noreply.github.com> Date: Sat Jul 17 14:18:38 2021 -0400 Merge pull request #82 from dihm/pdf_doc_fix Fix for PDF docs build commit a60d541 Author: David Meyer <dihm.meyer@gmail.com> Date: Sat Jul 17 14:12:11 2021 -0400 Fix a bunch of broken intersphinx references. commit 6755188 Author: David Meyer <dihm.meyer@gmail.com> Date: Sat Jul 17 14:11:40 2021 -0400 Make pdf docs generate in landscape. Given that almost everything in `labscript-devices` has a really long name that overfills the page in latex mode, landscape default for the whole thing is an easy help that reduces the pain. commit c82224a Author: David Meyer <dihm.meyer@gmail.com> Date: Sat Jul 17 14:10:22 2021 -0400 Fix PDF build blocking. Hides an attribute value that is too long for latex to handle. commit 7b8adc6 Merge: 7e2f328 d9514f0 Author: David Meyer <dihm@users.noreply.github.com> Date: Fri Jul 16 15:18:00 2021 -0400 Merge pull request #70 from dihm/devices-docs Initial labscript-devices docs commit d9514f0 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Jul 15 10:24:20 2021 -0400 Update sphinx version. commit c554131 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Jul 15 10:23:25 2021 -0400 Add docstring coverage to build. commit 20c2b6d Author: David Meyer <dihm.meyer@gmail.com> Date: Mon Jul 12 16:40:17 2021 -0400 Improve NI-DAQmx docs a little. commit 7e2f328 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Wed Jun 30 19:55:16 2021 +1000 Added PrawnBlaster to supported device list in readme commit e7b3571 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Wed Jun 30 19:50:55 2021 +1000 Fix typo in PrawnBlaster error message commit 0e31909 Merge: 7c1c485 60fa094 Author: Chris Billington <chrisjbillington@gmail.com> Date: Wed Jun 30 15:39:21 2021 +1000 Merge pull request #65 from rpanderson/tekscope_bugfix Tekscope bugfix commit be0970a Author: spielman <spielman@umd.edu> Date: Tue Jun 22 11:13:50 2021 -0400 Update to fix AI error that sometimes appears in nidaqmx. commit 34751ce Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Jun 1 15:05:30 2021 -0400 Add PyQT5 intersphinx inventory. commit 436f330 Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Jun 1 12:20:58 2021 -0400 Add docstring-level documentation for the new PrawnBlaster pseudoclock device. commit 17c507f Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 31 14:24:54 2021 -0400 Actually get automodule to document the PrawnBlaster code. commit 40b9a0c Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 31 14:24:26 2021 -0400 Fix warning in pylon.rst commit ab577ba Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 31 14:14:47 2021 -0400 Yet another tweak of the Prawnblaster bullet list. commit 69a7a47 Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 31 13:55:22 2021 -0400 Update sphinx_rtd_theme pin to 0.5.2 and fix PrawnBlaster nested listing. commit 3a2087f Author: David Meyer <dihm.meyer@gmail.com> Date: Mon May 31 13:45:52 2021 -0400 Basic high-level docs for the new PrawnBlaster device. commit 82871bc Author: David Meyer <dihm.meyer@gmail.com> Date: Thu May 27 15:54:51 2021 -0400 Attempting the easy mocking provided within sphinx-autodoc to mock all PyDAQmx imports. commit a78ed95 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu May 27 15:49:08 2021 -0400 Modify Spinnaker Camera so proprietary PySpin import does not happen on module load. Fixes docs-build failure and allows use of the Mock Camera for those without PySpin installed. commit b8e7923 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu May 27 15:44:58 2021 -0400 Sphinx version bump to match necessary bumps in other labscript docs. commit 45a54ed Author: David Meyer <dihm.meyer@gmail.com> Date: Thu May 27 15:43:39 2021 -0400 Adding unlisted dependencies so doc builds can successfully import more components. commit c7a4f58 Author: David Meyer <dihm.meyer@gmail.com> Date: Thu May 27 10:56:18 2021 -0400 Fix apidoc auto-run code. Apparently RTD builds are from a different directory than the makefile. Need to change the relative path specification to properly find the module code. commit 75bcb30 Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Dec 29 12:13:54 2020 -0500 Updated usage documentation for Spinnaker cameras. commit 5567a9d Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Dec 29 12:13:39 2020 -0500 Updated doc string in conf.py commit 30b983b Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 13 18:40:33 2020 -0500 Adding some basic high-level documentation. This is largely from my own experience, and could probably benefit from leveraging Chris and Phil's thesis instead. commit 7b0688f Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 13 16:06:56 2020 -0500 Increasing doc details for flycapture2 and pylon cameras. commit e597a0a Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 6 21:37:45 2020 -0500 Updating the NI_DAQmx model template and auto-generated files to produce slightly more helpful documentation. commit 8215778 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 6 21:36:59 2020 -0500 Fix some pathing issues on the last NI-DAQmx commit. commit b5071bd Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 6 21:35:41 2020 -0500 Add NI-DAQmx documentation. This employs apidoc to auto-generate a custom templated summary of all the auto-generated sub-class models. It modifies conf.py to auto-run apidoc to create the template. Therefore new sub-classes that are added will automatically have the appropriate documentation generated. Note: apidoc creates a large number of cruft docfiles for all modules in labscript_devices using this specific custom template. This is because I haven't figured out how to get the autodoc directives to work without full specification of the module from the top level. This could be worked around by the apidoc exclude option, but it only uses very basic fnmatch syntax that can't seem to be fudged to only select a single submodule. commit 68d6837 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 6 21:24:47 2020 -0500 Protecting the NI_DAQ.models.get_capabilities script against import. Now when sphinx imports it, it doesn't try to run NI-MAX device discovery. commit 0324995 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Nov 6 18:29:43 2020 -0500 Add docs for the SpinnakerCamera device I somehow overlooked. commit 6ce351c Author: David Meyer <dihm.meyer@gmail.com> Date: Wed Nov 4 17:17:23 2020 -0500 Adding boiler plate for rest of Pseudoclocks. commit 79a3e58 Author: David Meyer <dihm.meyer@gmail.com> Date: Fri Oct 30 16:59:16 2020 -0400 Increasing coverage to the rest of the devices, excluding a few remaining pseudoclocks. I have used an alternate file structure for the docs on the DummyIntermediateDevice as an example of another method of documenting. commit 19e42fd Author: David Meyer <dihm.meyer@gmail.com> Date: Thu Oct 29 20:26:09 2020 -0400 A few more updates to the Pylon Camera documentation and a start to the IMAQdx documentation. Mostly just to trigger another build on ReadTheDocs. commit bc525a1 Author: David Meyer <dihm.meyer@gmail.com> Date: Wed Oct 28 21:07:55 2020 -0400 Boiler plate doc files creation. Outlines basic documentation structure to cover all the devices as well as some higher level stuff. commit 7c1c485 Merge: 76c9a44 1c7e633 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sun May 30 10:45:53 2021 +1000 Merge pull request #76 from philipstarkey/philipstarkey/prawnblaster Support for the PrawnBlaster pseudoclock commit 1c7e633 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Fri May 28 00:33:26 2021 +1000 Fixed bug where transition_to_manual would complete when the PrawnBlaster was a secondary pseudoclock even if it hadn't finished (e.g. was still running or waiting for a trigger). Also formatted files with black. commit d7e5300 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Thu May 27 20:33:39 2021 +1000 Fixed bug with abort and added code to handle the PrawnBlaster as a secondary pseudoclock commit 91b35c8 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sat May 22 13:43:57 2021 +1000 Hopefully fixed the timing bug where PrawnBlaster pulses were twice as long as they should have been. Also fixed an incorrect max_instructions value commit 909d296 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Fri Apr 9 23:29:04 2021 +1000 Fixed clock limit to handle updated PrawnBlaster specs commit 76c9a44 Merge: 86e805d f298181 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Apr 9 12:37:49 2021 +1000 Merge branch 'dihm/setuptools_scm-fix' commit f298181 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Fri Apr 9 12:36:30 2021 +1000 * Continue to set local scheme based on env var in `__version__.py` for consistency. * Don't require specific setuptools or [toml] extra from setuptools_scm. We aren't configuring setuptools_scm in pyproject.toml anyway, and setuptools_scm itself will specify a fairly recent version of setuptools (we have no special requirement ourselves) * no longer use env var for version_scheme in setup.py, since we're now hard-coding release-branch-semver. commit 86e805d Merge: bdb8c13 8c7d78d Author: Chris Billington <chrisjbillington@gmail.com> Date: Thu Apr 8 21:20:07 2021 -0400 Merge pull request #74 from chrisjbillington/master Do not use deprecated set-env command in workflow commit d4e68c3 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Mon Apr 5 13:50:32 2021 +1000 More tweaks to wait length calculation commit 2a67e79 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Mon Apr 5 13:39:04 2021 +1000 Updated timing specs in labscript class commit b831752 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Mon Apr 5 00:22:20 2021 +1000 Updated PrawnBlaster device classes to support wait monitor and also to have all trigger pins share GPIO0 by default (since PseudoclockDevices can only have a single trigger in labscript regardless of the number of pseudoclocks) commit 74ce6ad Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sun Feb 28 19:41:39 2021 +1100 Initial commit of support for multi-pseudoclock PrawnBlaster. I have not yet fully implemented waits in the blacs_worker yet! commit 8c7d78d Author: chrisjbillington <chrisjbillington@gmail.com> Date: Mon Jan 4 12:29:44 2021 +1100 Do not use deprecated set-env command in workflow commit 9d689bc Author: David Meyer <dihm.meyer@gmail.com> Date: Tue Dec 29 14:16:33 2020 -0500 Update default setuptools_scm version scheme to release-branch-semver. Copies config from labscript-utils. This fixes half the circular dependency issue between labscript-devices and blacs (ie can now pip install dev labscript-devices properly). commit 60fa094 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Sat Aug 15 21:30:24 2020 +1000 black and flake8 commit 775c416 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Sat Aug 15 21:29:27 2020 +1000 Resolves #64 using proposal of ispielma
1 parent bdb8c13 commit c7dfc13

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5616
-210
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ defaults:
1515

1616
env:
1717
PACKAGE_NAME: labscript-devices
18-
SCM_VERSION_SCHEME: release-branch-semver
1918
SCM_LOCAL_SCHEME: no-local-version
2019
ANACONDA_USER: labscript-suite
2120

@@ -111,8 +110,8 @@ jobs:
111110
else
112111
CONDA_BUILD_ARGS=""
113112
fi
114-
echo "::set-env name=CONDA_INSTALLER::$CONDA_INSTALLER"
115-
echo "::set-env name=CONDA_BUILD_ARGS::$CONDA_BUILD_ARGS"
113+
echo "CONDA_INSTALLER=$CONDA_INSTALLER" >> $GITHUB_ENV
114+
echo "CONDA_BUILD_ARGS=$CONDA_BUILD_ARGS" >> $GITHUB_ENV
116115
117116
- name: Conda package (Unix)
118117
if: runner.os != 'Windows'
@@ -211,7 +210,7 @@ jobs:
211210
if: github.event.ref_type == 'tag'
212211
run: |
213212
VERSION="${GITHUB_REF/refs\/tags\/v/}"
214-
echo "::set-env name=VERSION::$VERSION"
213+
echo "VERSION=$VERSION" >> $GITHUB_ENV
215214
216215
- name: Create GitHub Release
217216
if: github.event.ref_type == 'tag'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,4 @@ conda_packages/
159159
docs/html/
160160
docs/source/_build/
161161
docs/source/components.rst
162+
docs/source/devices/_apidoc

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The following devices have been implemented in the _labscript suite_:<sup>†</s
4747
* [NovaTech DDS9m](http://www.novatechsales.com/PDF_files/dds9mds_lr.pdf) 170MHz Four Channel Direct Digital Synthesized Signal Generator (see [blog post](http://labscriptsuite.org/blog/tag/novatech-dds9m/))
4848
* [OpalKelly XEM3001](https://opalkelly.com/products/xem3001/) FPGA Boards used by the Cicero control system (PR [#50](https://bitbucket-archive.labscriptsuite.org/#!/labscript_suite/labscript_devices/pull-requests/50))
4949
* [PineBlaster](http://labscriptsuite.org/hardware/pineblaster) Open-source Digital Pattern Generator
50+
* [PrawnBlaster](https://github.com/labscript-suite/prawnblaster/) Open-source pseudoclock based on the $4 Raspberry Pi Pico
5051
* [SpinCore](https://www.spincore.com/products/#pulsegeneration) Programmable Pulse Generators and Direct Digital Synthesis
5152
* [PulseBlasterDDS-II-300-AWG](http://www.spincore.com/products/PulseBlasterDDS-II-300/)
5253
* [PulseBlasterESR-PRO](https://www.spincore.com/products/PulseBlasterESR-PRO/)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{%- macro automodule(modname, options) -%}
2+
.. automodule:: {{ modname }}
3+
{%- for option in options %}
4+
:{{ option }}:
5+
{%- endfor %}
6+
{%- endmacro %}
7+
8+
{%- macro toctree(docnames) -%}
9+
.. toctree::
10+
:maxdepth: {{ maxdepth }}
11+
{% for docname in docnames %}
12+
{{ docname }}
13+
{%- endfor %}
14+
{%- endmacro %}
15+
16+
{%- macro autosummary(submodules) -%}
17+
.. autosummary::
18+
{% for submodule in submodules %}
19+
{{submodule}}
20+
{%- endfor %}
21+
{%- endmacro %}
22+
23+
{%- macro autosum(pkgname) -%}
24+
.. autosummary::
25+
26+
{{pkgname}}
27+
{%- endmacro %}
28+
29+
{%- if is_namespace %}
30+
{{- [pkgname, "namespace"] | join(" ") | e | heading }}
31+
{% else %}
32+
{# {{- [pkgname, ""] | join(" ") | e | heading }} #}
33+
{% endif %}
34+
35+
{%- if submodules %}
36+
{{ autosummary(submodules) }}
37+
{% if separatemodules %}
38+
{{ toctree(submodules) }}
39+
{% else %}
40+
{%- for submodule in submodules %}
41+
{% if show_headings %}
42+
{{- [submodule, ""] | join(" ") | e | heading(2) }}
43+
{% endif %}
44+
{{ automodule(submodule, automodule_options) }}
45+
{% endfor %}
46+
{%- endif %}
47+
{%- endif %}

docs/source/adding_devices.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
How to Add a Device
2+
===================
3+
4+
Adding a **labscript-device** involves implementing interfaces for your hardware to different protions of the **labscript-suite**. Namely, you must provide
5+
6+
* A `labscript_device` that takes **labscript** high-level commands and turns them into instructions that are saved to the shot h5 file.
7+
* A `BLACS_worker` that handles communication with the hardware, in particular interpreting the instructions from the shot h5 file into the necessary hardware commands to configure the device.
8+
* A `BLACS_tab` which provides a graphical interface to control the instrument via **BLACS**
9+
10+
Though not strictly required, you should also consider providing a `runviewer_parser`, which can read the h5 instructions and produce the appropriate shot timings that would occur. This interface is only used in **runviewer**.
11+
12+
General Strategy
13+
~~~~~~~~~~~~~~~~
14+
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.
17+
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.
21+
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.
24+
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.
29+
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:
32+
33+
* `init`: This method initialised communications with the device. Not to be confused with the standard python class `__init__` method.
34+
* `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.
35+
* `check_remote_values`: This method reads the current settings of the device, updating the `BLACS_tab` widgets to reflect these values.
36+
* `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.
37+
* `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.
38+
39+
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.
40+
41+
Code Organization
42+
~~~~~~~~~~~~~~~~~
43+
44+
There are currently two supported file organization styles for a labscript-device.
45+
46+
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.
47+
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
51+
52+
.. code-block:: python
53+
54+
from labscript_devices import register_classes
55+
56+
This function informs **labscript** where to find the necessary classes during import. An example for the `NI_DAQmx` device is
57+
58+
.. code-block:: python
59+
60+
register_classes(
61+
'NI_DAQmx',
62+
BLACS_tab='labscript_devices.NI_DAQmx.blacs_tabs.NI_DAQmxTab',
63+
runviewer_parser='labscript_devices.NI_DAQmx.runviewer_parsers.NI_DAQmxParser',
64+
)
65+
66+
Contributions to **labscript-devices**
67+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68+
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/conf.py

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
# ones.
4040
extensions = [
4141
"sphinx.ext.autodoc",
42+
"sphinx.ext.autosummary",
4243
"sphinx.ext.autosectionlabel",
4344
"sphinx.ext.intersphinx",
4445
"sphinx.ext.napoleon",
@@ -49,6 +50,8 @@
4950
]
5051

5152
autodoc_typehints = 'description'
53+
autoclass_content = 'both' # options: 'both', 'class', 'init'
54+
autodoc_mock_imports = ['PyDAQmx']
5255

5356
# Prefix each autosectionlabel with the name of the document it is in and a colon
5457
autosectionlabel_prefix_document = True
@@ -169,6 +172,13 @@
169172
else:
170173
todo_include_todos = True
171174

175+
# -- Options for PDF output --------------------------------------------------
176+
177+
latex_elements = {
178+
# make entire document landscape
179+
'geometry': '\\usepackage[landscape]{geometry}',
180+
}
181+
172182
# -- Options for HTML output -------------------------------------------------
173183

174184
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -223,3 +233,64 @@ def setup(app):
223233
img_path=img_path
224234
)
225235
)
236+
237+
# hook to run apidoc before building
238+
app.connect('builder-inited', run_apidoc)
239+
# hooks to test docstring coverage
240+
app.connect('autodoc-process-docstring', doc_coverage)
241+
app.connect('build-finished', doc_report)
242+
243+
244+
def run_apidoc(_):
245+
"""Runs apidoc with our desired parameters to generate the NI_DAQmx models docs.
246+
"""
247+
from sphinx.ext.apidoc import main
248+
if os.environ.get('READTHEDOCS'):
249+
rel_path = '../..'
250+
else:
251+
rel_path = '..'
252+
daq_models_path = os.path.join(os.path.abspath(rel_path),
253+
'labscript_devices')
254+
out_path = os.path.join(os.path.dirname(Path(__file__)),
255+
'devices', '_apidoc', 'models')
256+
templates_path = os.path.join(os.path.dirname(Path(__file__)),
257+
'_templates', 'models')
258+
main(['-TMf', '-s', 'inc',
259+
'-t', templates_path,
260+
'-o', out_path, daq_models_path])
261+
262+
263+
members_to_watch = ['module', 'class', 'function', 'exception', 'method', 'attribute']
264+
doc_count = 0
265+
undoc_count = 0
266+
undoc_objects = []
267+
undoc_print_objects = False
268+
269+
270+
def doc_coverage(app, what, name, obj, options, lines):
271+
global doc_count
272+
global undoc_count
273+
global undoc_objects
274+
275+
if (what in members_to_watch and len(lines) == 0):
276+
# blank docstring detected
277+
undoc_count += 1
278+
undoc_objects.append(name)
279+
else:
280+
doc_count += 1
281+
282+
283+
def doc_report(app, exception):
284+
global doc_count
285+
global undoc_count
286+
global undoc_objects
287+
# print out report of documentation coverage
288+
total_docs = undoc_count + doc_count
289+
if total_docs != 0:
290+
print(f'\nAPI Doc coverage of {doc_count/total_docs:.1%}')
291+
if undoc_print_objects or os.environ.get('READTHEDOCS'):
292+
print('\nItems lacking documentation')
293+
print('===========================')
294+
print(*undoc_objects, sep='\n')
295+
else:
296+
print('No docs counted, run \'make clean\' then rebuild to get the count.')

docs/source/devices.rst

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
Devices
2+
=========
3+
4+
Here is a list of all the currently supported devices.
5+
6+
7+
Pseudoclocks
8+
~~~~~~~~~~~~
9+
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.
13+
14+
.. toctree::
15+
:maxdepth: 2
16+
17+
devices/pulseblaster
18+
devices/pulseblaster_no_dds
19+
devices/opalkellyXEM3001
20+
devices/pineblaster
21+
devices/prawnblaster
22+
devices/rfblaster
23+
24+
NI DAQS
25+
~~~~~~~~~~~~
26+
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.
29+
30+
.. toctree::
31+
:maxdepth: 2
32+
33+
devices/ni_daqs
34+
35+
Cameras
36+
~~~~~~~~~~~~
37+
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.
41+
42+
.. toctree::
43+
:maxdepth: 2
44+
45+
devices/IMAQdx
46+
devices/pylon
47+
devices/flycapture2
48+
devices/spinnaker
49+
devices/andorsolis
50+
51+
52+
Frequency Sources
53+
~~~~~~~~~~~~~~~~~
54+
55+
These devices cover various frequency sources that provide either hardware-timed frequency, amplitude, or phase updates or static frequency outputs.
56+
57+
.. toctree::
58+
:maxdepth: 2
59+
60+
devices/novatechDDS9m
61+
devices/phasematrixquicksyn
62+
63+
64+
Miscellaneous
65+
~~~~~~~~~~~~~~~
66+
67+
These devices cover other types of devices.
68+
69+
.. toctree::
70+
:maxdepth: 2
71+
72+
devices/alazartechboard
73+
devices/lightcrafterdmd
74+
devices/tekscope
75+
devices/zaberstagecontroller
76+
77+
78+
Other
79+
~~~~~~~~~~~~~~
80+
81+
These devices provide dummy instruments for prototyping and testing purposes of the rest of the labscript_suite as well as the FunctionRunner device which can run arbitrary code post-shot.
82+
83+
.. toctree::
84+
:maxdepth: 2
85+
86+
devices/functionrunner
87+
devices/dummypseudoclock
88+
devices/dummyintermediate
89+
devices/testdevice
90+

docs/source/devices/IMAQdx.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
IMAQdx Cameras
2+
==============
3+
4+
Overview
5+
~~~~~~~~
6+
7+
The "master" camera device from which all others derive.
8+
9+
.. autosummary::
10+
labscript_devices.IMAQdxCamera.labscript_devices
11+
labscript_devices.IMAQdxCamera.blacs_tabs
12+
labscript_devices.IMAQdxCamera.blacs_workers
13+
14+
Installation
15+
~~~~~~~~~~~~
16+
17+
18+
Usage
19+
~~~~~
20+
21+
22+
Detailed Documentation
23+
~~~~~~~~~~~~~~~~~~~~~~
24+
25+
.. automodule:: labscript_devices.IMAQdxCamera
26+
:members:
27+
:undoc-members:
28+
:show-inheritance:
29+
:private-members:
30+
31+
.. automodule:: labscript_devices.IMAQdxCamera.labscript_devices
32+
:members:
33+
:undoc-members:
34+
:show-inheritance:
35+
:private-members:
36+
37+
.. automodule:: labscript_devices.IMAQdxCamera.blacs_tabs
38+
:members:
39+
:undoc-members:
40+
:show-inheritance:
41+
:private-members:
42+
43+
.. automodule:: labscript_devices.IMAQdxCamera.blacs_workers
44+
:members:
45+
:undoc-members:
46+
:show-inheritance:
47+
:private-members:

0 commit comments

Comments
 (0)