From 83856d61d87454d023352d08105fa98f58f648a6 Mon Sep 17 00:00:00 2001 From: philipstarkey Date: Thu, 25 Jun 2020 18:31:01 +1000 Subject: [PATCH] Squashed commit of the following: commit c3b79883dc40ab5fbe01b3eca9d95f5574cf7c60 Author: Phil Starkey Date: Thu Jun 25 18:27:06 2020 +1000 Update labscript_utils dependency to `>=3.0.0` commit 822e5d5df933402011776b5428428703a32b70b4 Merge: 2e2785c 39c6f0b Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 15:48:15 2020 +1000 Merge pull request #69 from rpanderson/example_fix Make example labscript functional and format using black commit 39c6f0b7d042e0137397b94ff4e2a1092bece8c3 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 12:34:08 2020 +1000 Name all the args commit 255d74e1a9659f6e22636c255465b2c815622864 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 12:11:48 2020 +1000 Name all arguments in connection table commit e3d3ece7e79338562174cab92f5f7c4bfc0786e3 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 11:08:25 2020 +1000 Omit __init__ import and comply with flake8 F403 commit 6b26f1ffc97c778c7ddb0576cbcd0df5229c3a5f Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Sun May 31 17:38:18 2020 +1000 Make example labscript functional and format using black commit 2e2785ceb914c3c8ea56be40104c70a065e6ffec Merge: 62b9098 4e77810 Author: Chris Billington Date: Wed Jun 24 21:22:05 2020 -0400 Merge pull request #70 from rpanderson/is-syntax-warning-bugfix Bugfix for ValueError introduced in #68 commit 4e7781092caf7a0f59bf9009be1e377e5f9589f5 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 11:18:56 2020 +1000 Abbreviated bugfix. commit a667f7efa116506a76b8b74fdf1cc993187df2d6 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 11:17:11 2020 +1000 Bugfix for ValueError introduced in #68 commit 62b9098b58e8db8cebd3753e95fa1851b80a101a Merge: 0e23ed0 1746399 Author: Chris Billington Date: Wed Jun 24 20:49:32 2020 -0400 Merge pull request #67 from philipstarkey/fix-h5py-file-mode Fix h5py deprecation warning commit 0e23ed0c88ab6447b692656e0b9d033853769255 Merge: 5b52c20 6373f02 Author: Chris Billington Date: Wed Jun 24 18:47:18 2020 -0400 Merge pull request #68 from rpanderson/is-syntax-warning Do not use 'is' for numeric literal comparisons commit 6373f0215f221999316de902aa6541409aee05a1 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Thu Jun 25 08:36:55 2020 +1000 Omitted 'is' with numeric literal comparisons commit 1746399cbbf86b064fb9f6aed5fe28afc8066028 Author: philipstarkey Date: Wed Jun 24 18:29:12 2020 +1000 Fix h5py deprecation warning Addresses labscript-suite/labscript-utils#47 for the labscript module commit 5b52c20c3dbba7cd496b3487789d4ff4404ad94b Merge: 0362fa7 88ce952 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Mon Jun 22 18:09:54 2020 +1000 Merge pull request #66 from philipstarkey/master Doc updates commit 88ce952e5c61d0df86a25f77d545ed34a8c25695 Author: philipstarkey Date: Sat Jun 20 18:17:23 2020 +1000 Doc updates Renamed API reference URL to match labscript utils and updated config to fix bugs identified in labscript-suite/labscript-utils#57 commit 0362fa7a6d597d39fcc781329e2df34189a1140e Merge: 74869ef 52d3b9f Author: Phil Starkey Date: Fri Jun 19 18:58:04 2020 +1000 Merge pull request #65 from philipstarkey/master Updated docs to follow our standard conf commit 52d3b9f72add927d77b50ac2e2dd378dbbe722af Author: philipstarkey Date: Fri Jun 19 16:04:04 2020 +1000 Addressing latest review comments commit 7674a8ffdec2bbf81b59c42c3c7e02cf5273aac8 Author: philipstarkey Date: Fri Jun 19 11:19:33 2020 +1000 Updated docs to use jinja template for component doc links commit d4474e21f254bc5fbf67ff0c41415e3430e11095 Author: philipstarkey Date: Thu Jun 18 16:43:10 2020 +1000 Updated .gitignore with latest GitHub defaults commit a18a0d1ea5a018f7dfd979f70638a3442c9a4dce Author: philipstarkey Date: Thu Jun 18 16:39:35 2020 +1000 Relocated custom sphinx git ignore rules commit 80aa5a1ae7e0d54bd6401265384afc3c9601764f Author: philipstarkey Date: Thu Jun 18 16:21:44 2020 +1000 Restored 64 pixel logo accidentally replaced with 32 pixel logo commit 42d3bc6de879a29a758584e5f7e28dc01be93eb9 Author: philipstarkey Date: Thu Jun 18 16:17:42 2020 +1000 Updated install requirement to 3.0.0rc1+ commit 1961a2cd12608d54fb375bcf4a26309d500d05eb Author: philipstarkey Date: Thu Jun 18 16:13:40 2020 +1000 testing dependency fix commit 234753dc673f35371f4d5d1e388aedfa5366fe1a Author: philipstarkey Date: Thu Jun 18 16:07:41 2020 +1000 Updated as per the review in labscript-suite/labscript-suite#48 commit 74869efead6f3de5c6c67b8b2cf240f60bd1f1a2 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Wed Jun 17 10:24:43 2020 +1000 Populated README.md with styling, iconogrpahy, prose, and badges commit 28dc675b4b4f6ed5a79726a7aadcbb36c8837118 Author: philipstarkey Date: Tue Jun 16 18:24:26 2020 +1000 Removed unnecessary header and added intersphinx link commit 35c54668eb8382818c0d648f727d53ef96a26f46 Author: philipstarkey Date: Tue Jun 16 17:19:33 2020 +1000 Updated docs to follow our standard conf Also added links to other labscript suite docs and standard links. Co-authored-by: chrisjbillington Co-authored-by: Russell Anderson <5637107+rpanderson@users.noreply.github.com> --- .gitignore | 57 +- README.md | 26 +- docs/requirements.txt | 1 - docs/source/_static/custom.css | 63 ++ docs/source/_templates/components.rst | 47 ++ .../{api_reference => api}/clockline.rst | 0 docs/source/{api_reference => api}/device.rst | 0 docs/source/{api_reference => api}/index.rst | 2 +- .../intermediatedevice.rst | 0 .../{api_reference => api}/pseudoclock.rst | 0 .../pseudoclockdevice.rst | 0 docs/source/conf.py | 458 ++++++-------- docs/source/img/blacs_32nx32n.svg | 178 ++++++ ...suite-rectangular-transparent_138nx70n.svg | 579 ++++++++++++++++++ docs/source/img/labscript.ico | Bin 0 -> 98716 bytes docs/source/img/labscript_32nx32n.svg | 186 ++++++ docs/source/img/labscript_64x64.svg | 42 ++ docs/source/img/lyse_32nx32n.svg | 256 ++++++++ docs/source/img/runmanager_32nx32n.svg | 267 ++++++++ docs/source/img/runviewer_32nx32n.svg | 223 +++++++ docs/source/index.rst | 35 +- example.py | 284 ++++++--- labscript/labscript.py | 6 +- readthedocs.yaml | 27 + setup.cfg | 10 +- 25 files changed, 2375 insertions(+), 372 deletions(-) delete mode 100644 docs/requirements.txt create mode 100644 docs/source/_static/custom.css create mode 100644 docs/source/_templates/components.rst rename docs/source/{api_reference => api}/clockline.rst (100%) rename docs/source/{api_reference => api}/device.rst (100%) rename docs/source/{api_reference => api}/index.rst (90%) rename docs/source/{api_reference => api}/intermediatedevice.rst (100%) rename docs/source/{api_reference => api}/pseudoclock.rst (100%) rename docs/source/{api_reference => api}/pseudoclockdevice.rst (100%) create mode 100644 docs/source/img/blacs_32nx32n.svg create mode 100644 docs/source/img/labscript-suite-rectangular-transparent_138nx70n.svg create mode 100644 docs/source/img/labscript.ico create mode 100644 docs/source/img/labscript_32nx32n.svg create mode 100644 docs/source/img/labscript_64x64.svg create mode 100644 docs/source/img/lyse_32nx32n.svg create mode 100644 docs/source/img/runmanager_32nx32n.svg create mode 100644 docs/source/img/runviewer_32nx32n.svg create mode 100644 readthedocs.yaml diff --git a/.gitignore b/.gitignore index 923159d..a389d9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ +# This gitignore file consists of 2 parts: +# * The standard Python .gitignore rules from GitHub +# * custom ignore rules for the labscript suite. +# +# These should be kept separate so that the generic rules can be updated with a +# copy/paste without having to worry about whether we are removing custom rules + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] @@ -20,6 +27,7 @@ parts/ sdist/ var/ wheels/ +share/python-wheels/ *.egg-info/ .installed.cfg *.egg @@ -38,14 +46,17 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ +.nox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover +*.py,cover .hypothesis/ .pytest_cache/ +cover/ # Translations *.mo @@ -55,6 +66,7 @@ coverage.xml *.log local_settings.py db.sqlite3 +db.sqlite3-journal # Flask stuff: instance/ @@ -67,16 +79,34 @@ instance/ docs/_build/ # PyBuilder +.pybuilder/ target/ # Jupyter Notebook .ipynb_checkpoints +# IPython +profile_default/ +ipython_config.py + # pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: .python-version -# celery beat schedule file +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff celerybeat-schedule +celerybeat.pid # SageMath parsed files *.sage.py @@ -102,6 +132,21 @@ venv.bak/ # mypy .mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# +# Custom labscript suite .gitignore rules start below +# # conda build results conda_build @@ -111,4 +156,12 @@ conda_packages *.out *.log *.aux -*.toc \ No newline at end of file +*.toc + +# Editors +.vscode/ + +# Sphinx documentation +docs/html/ +docs/source/_build/ +docs/source/components.rst \ No newline at end of file diff --git a/README.md b/README.md index 3f8fc16..e636470 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,24 @@ -# labscript +the labscript suite +# the _labscript suite_ ยป labscript -The labscript Python library provides a translation from simple Python code to complex hardware instructions. The library is used to construct a "connection table" containing information about what hardware is being used and how it is interconnected. Devices described in this connection table can then have their outputs set by using a range of functions, including arbitrary ramps. +### Expressive composition of hardware-timed experiments -( -[view on Github](https://github.com/labscript-suite/labscript) -) \ No newline at end of file +[![Actions Status](https://github.com/labscript-suite/labscript/workflows/Build%20and%20Release/badge.svg)](https://github.com/labscript-suite/labscript/actions) +[![License](https://img.shields.io/pypi/l/labscript.svg)](https://github.com/labscript-suite/labscript/raw/master/LICENSE.txt) +[![Python Version](https://img.shields.io/pypi/pyversions/labscript.svg)](https://python.org) +[![PyPI](https://img.shields.io/pypi/v/labscript.svg)](https://pypi.org/project/labscript) +[![Conda Version](https://img.shields.io/conda/v/labscript-suite/labscript)](https://anaconda.org/labscript-suite/labscript) +[![Google Group](https://img.shields.io/badge/Google%20Group-labscriptsuite-blue.svg)](https://groups.google.com/forum/#!forum/labscriptsuite) + + + +The **labscript** Python library permits expressive composition of hardware-timed experiments. Hardware connections and experiment logic are described using Python classes, functions and methods, which labscript translates into low-level primitives specific to individual instruments. + + + + +## Installation + +labscript is distributed as a Python package on [PyPI](https://pypi.org/user/labscript-suite) and [Anaconda Cloud](https://anaconda.org/labscript-suite), and should be installed with other components of the _labscript suite_. Please see the [installation guide](https://docs.labscriptsuite.org/en/latest/installation) for details. diff --git a/docs/requirements.txt b/docs/requirements.txt deleted file mode 100644 index 37a69c4..0000000 --- a/docs/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -PyQt5 \ No newline at end of file diff --git a/docs/source/_static/custom.css b/docs/source/_static/custom.css new file mode 100644 index 0000000..d766bfa --- /dev/null +++ b/docs/source/_static/custom.css @@ -0,0 +1,63 @@ +/* Add space between collapsible details HTML tags */ +details { + margin-bottom: 1em; +} + +/* Darker pygment highlighing of console input/output */ +.highlight .go { + color: #404040; +} + +/* White captions in sidebar */ +.wy-nav-side p.caption { + color: #f5f5f5; +} + +/* labscript blue, alpha = 83% */ +.wy-side-nav-search { + background: #2946bbd3; +} + +.wy-nav-top { + background: #2946bbd3; +} + +/* labscript green, alpha = 75% */ +.rst-content .note .admonition-title { + background: #00804fbf; +} + +/* labscript green, alpha = 25% */ +.rst-content .note { + background: #00804f3f; +} + +/* labscript red, alpha = 75% */ +.rst-content .warning .admonition-title { + background: #bc294cbf +} + +/* labscript red, alpha = 25% */ +.rst-content .warning { + background: #bc294c3b; +} + +/* Elevation +* +* Style box-shadows using Material Design's idea of elevation. These particular numbers are taken from here: +* +* https://github.com/material-components/material-components-web +* https://material-components-web.appspot.com/elevation.html +*/ + +.rst-content img.screenshot { + border: none; + /* MD Elevation 8 */ + box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), + 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12); + margin-bottom: 24px; +} + +img.labscript-suite-icon { + min-width: 32px; +} \ No newline at end of file diff --git a/docs/source/_templates/components.rst b/docs/source/_templates/components.rst new file mode 100644 index 0000000..f966939 --- /dev/null +++ b/docs/source/_templates/components.rst @@ -0,0 +1,47 @@ +{% if current_project != 'the labscript suite' %} +.. toctree:: + :maxdepth: 2 + :hidden: + + the labscript suite <{{intersphinx_mapping['labscript-suite'][0]}}> + +{% endif %} +*labscript suite* components +============================ + +The *labscript suite* is modular by design, and is comprised of: + +.. list-table:: Python libraries + :widths: 10 90 + :header-rows: 0 + + {% for prog, item in programs.items() if item.type == 'lib' %} + * - .. image:: {{img_path}}/{{item.icon}} + :target: {{intersphinx_mapping['%s' | format(prog)][0]}} + :class: labscript-suite-icon + - |{{prog}}|_ --- {{item.desc}} + {% endfor %} + +.. list-table:: Graphical applications + :widths: 10 90 + :header-rows: 0 + + {% for prog, item in programs.items() if item.type == 'gui' %} + * - .. image:: {{img_path}}/{{item.icon}} + :target: {{intersphinx_mapping['%s' | format(prog)][0]}} + :class: labscript-suite-icon + - |{{prog}}|_ --- {{item.desc}} + {% endfor %} + +.. toctree:: + :maxdepth: 2 + :hidden: + + {% for prog in programs|sort if prog != current_project %} + {{prog}} <{{intersphinx_mapping['%s' | format(prog)][0]}}> + {% endfor %} + +{% for prog in programs %} +.. |{{prog}}| replace:: **{{prog}}** +.. _{{prog}}: {{intersphinx_mapping['%s' | format(prog)][0]}} +{% endfor %} \ No newline at end of file diff --git a/docs/source/api_reference/clockline.rst b/docs/source/api/clockline.rst similarity index 100% rename from docs/source/api_reference/clockline.rst rename to docs/source/api/clockline.rst diff --git a/docs/source/api_reference/device.rst b/docs/source/api/device.rst similarity index 100% rename from docs/source/api_reference/device.rst rename to docs/source/api/device.rst diff --git a/docs/source/api_reference/index.rst b/docs/source/api/index.rst similarity index 90% rename from docs/source/api_reference/index.rst rename to docs/source/api/index.rst index 2fe6df4..dcfda06 100644 --- a/docs/source/api_reference/index.rst +++ b/docs/source/api/index.rst @@ -1,6 +1,6 @@ API Reference -======== +============= .. toctree:: :maxdepth: 2 diff --git a/docs/source/api_reference/intermediatedevice.rst b/docs/source/api/intermediatedevice.rst similarity index 100% rename from docs/source/api_reference/intermediatedevice.rst rename to docs/source/api/intermediatedevice.rst diff --git a/docs/source/api_reference/pseudoclock.rst b/docs/source/api/pseudoclock.rst similarity index 100% rename from docs/source/api_reference/pseudoclock.rst rename to docs/source/api/pseudoclock.rst diff --git a/docs/source/api_reference/pseudoclockdevice.rst b/docs/source/api/pseudoclockdevice.rst similarity index 100% rename from docs/source/api_reference/pseudoclockdevice.rst rename to docs/source/api/pseudoclockdevice.rst diff --git a/docs/source/conf.py b/docs/source/conf.py index 7051cd5..df5f266 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,300 +1,224 @@ -# -*- coding: utf-8 -*- +# Configuration file for the Sphinx documentation builder. # -# labscript documentation build configuration file, created by -# sphinx-quickstart on Mon Dec 08 14:26:41 2014. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html -import sys -import os +# -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# +import os +from pathlib import Path +from m2r import MdInclude +from recommonmark.transform import AutoStructify +from jinja2 import FileSystemLoader, Environment -# -- General configuration ------------------------------------------------ +# -- Project information (unique to each project) ------------------------------------- -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +project = "labscript" +copyright = "2020, labscript suite" +author = "labscript suite contributors" + +from labscript import __version__ as version # noqa: E402 + +release = version + +# HTML icons +img_path = 'img' +html_logo = img_path + "/labscript_64x64.svg" +html_favicon = img_path + "/labscript.ico" + +# -- General configuration (should be identical across all projects) ------------------ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'sphinx.ext.intersphinx', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.mathjax', - 'sphinx.ext.ifconfig', - 'sphinx.ext.viewcode', - # 'sphinx.ext.linkcode', + "sphinx.ext.autodoc", + "sphinx.ext.autosectionlabel", + "sphinx.ext.intersphinx", + "sphinx.ext.napoleon", + "sphinx.ext.todo", + "sphinx.ext.viewcode", + "sphinx_rtd_theme", + "recommonmark", ] -# def linkcode_resolve(domain, info): - # if domain != 'py': - # return None - # if not info['module']: - # return None - # elif info['module'] == 'labscript': - # return "https://bitbucket.org/labscript_suite/labscript/src/tip/labscript.py?at=default" - # else: - # return None +autodoc_typehints = 'description' -# Add any paths that contain templates here, relative to this directory. -templates_path = ['labscript_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'labscript' -copyright = u'2014, Monash University' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '2.0' -# The full version, including alpha/beta/rc tags. -release = '2.0.1' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None +# Prefix each autosectionlabel with the name of the document it is in and a colon +autosectionlabel_prefix_document = True -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True +# The suffix(es) of source filenames. +source_suffix = ['.rst', '.md'] -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' -highlight_language = 'python' -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# The master toctree document. +master_doc = 'index' -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False +# intersphinx allows us to link directly to other repos sphinxdocs. +# https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html +intersphinx_mapping = { + 'python': ('https://docs.python.org/3/', None), + 'numpy': ('https://numpy.org/doc/stable/', None), + 'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None), + 'pandas': ('https://pandas.pydata.org/pandas-docs/stable/', None), + 'qtutils': ('https://qtutils.readthedocs.io/en/stable/', None), + 'pyqtgraph': ( + 'https://pyqtgraph.readthedocs.io/en/latest/', + None, + ), # change to stable once v0.11 is published + 'matplotlib': ('https://matplotlib.org/', None), + 'h5py': ('http://docs.h5py.org/en/stable/', None), + 'pydaqmx': ('https://pythonhosted.org/PyDAQmx/', None), + 'qt': ( + '', + 'pyqt5-modified-objects.inv', + ) # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py + # under MIT License + # TODO + # desktop-app + # spinapi/pynivision/etc +} +# list of all labscript suite components that have docs +labscript_suite_programs = { + 'labscript': { + 'desc': 'Expressive composition of hardware-timed experiments', + 'icon': 'labscript_32nx32n.svg', + 'type': 'lib', + }, + 'labscript-devices': { + 'desc': 'Plugin architecture for controlling experiment hardware', + 'icon': 'labscript_32nx32n.svg', + 'type': 'lib', + }, + 'labscript-utils': { + 'desc': 'Shared modules used by the *labscript suite*', + 'icon': 'labscript_32nx32n.svg', + 'type': 'lib', + }, + 'runmanager': { + 'desc': 'Graphical and remote interface to parameterized experiments', + 'icon': 'runmanager_32nx32n.svg', + 'type': 'gui', + }, + 'blacs': { + 'desc': 'Graphical interface to scientific instruments and experiment supervision', + 'icon': 'blacs_32nx32n.svg', + 'type': 'gui', + }, + 'lyse': { + 'desc': 'Online analysis of live experiment data', + 'icon': 'lyse_32nx32n.svg', + 'type': 'gui', + }, + 'runviewer': { + 'desc': 'Visualize hardware-timed experiment instructions', + 'icon': 'runviewer_32nx32n.svg', + 'type': 'gui', + }, +} -# -- Options for HTML output ---------------------------------------------- +# whether to use stable or latest version +labscript_suite_doc_version = os.environ.get('READTHEDOCS_VERSION', 'latest') +if '.' in labscript_suite_doc_version: + labscript_suite_doc_version = 'stable' +elif labscript_suite_doc_version not in ['stable', 'latest']: + labscript_suite_doc_version = 'latest' + +# add intersphinx references for each component +for ls_prog in labscript_suite_programs: + intersphinx_mapping[ls_prog] = ( + 'https://docs.labscriptsuite.org/projects/{}/en/{}/'.format( + ls_prog, labscript_suite_doc_version + ), + None, + ) + +# add intersphinx reference for the metapackage +if project != "the labscript suite": + intersphinx_mapping['labscript-suite'] = ( + 'https://docs.labscriptsuite.org/en/{}/'.format(labscript_suite_doc_version), + None, + ) + +# Make `some code` equivalent to :code:`some code` +default_role = 'code' + +# hide todo notes if on readthedocs and not building the latest +if os.environ.get('READTHEDOCS') and ( + os.environ.get('READTHEDOCS_VERSION') != 'latest' + or ( + os.environ.get('READTHEDOCS_PROJECT') == project + or os.environ.get('READTHEDOCS_PROJECT') == 'labscriptsuite' + ) +): + todo_include_todos = False +else: + todo_include_todos = True + +# -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None +# +html_theme = "sphinx_rtd_theme" +html_title = "labscript suite | {project}".format( + project=project + if project != "labscript-suite" + else "experiment control and automation" +) +html_short_title = "labscript suite" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['labscript_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -#html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = 'labscriptdoc' - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', - -# Latex figure (float) alignment -#'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'labscript.tex', u'labscript Documentation', - u'Monash University', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'labscript', u'labscript Documentation', - [u'Monash University'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'labscript', u'labscript Documentation', - u'Monash University', 'labscript', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {'http://docs.python.org/': None} +html_static_path = ['_static'] + +# Customize the html_theme +html_theme_options = {'navigation_depth': 3} + +# Use m2r only for mdinclude and recommonmark for everything else +# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992 +def setup(app): + config = { + # 'url_resolver': lambda url: github_doc_root + url, + 'auto_toc_tree_section': 'Contents', + 'enable_eval_rst': True, + } + app.add_config_value('recommonmark_config', config, True) + app.add_transform(AutoStructify) + + # from m2r to make `mdinclude` work + app.add_config_value('no_underscore_emphasis', False, 'env') + app.add_config_value('m2r_parse_relative_links', False, 'env') + app.add_config_value('m2r_anonymous_references', False, 'env') + app.add_config_value('m2r_disable_inline_math', False, 'env') + app.add_directive('mdinclude', MdInclude) + app.add_css_file('custom.css') + + # generate the components.rst file dynamically so it points to stable/latest + # of subprojects correctly + loader = FileSystemLoader(Path(__file__).resolve().parent / templates_path[0]) + env = Environment(loader=loader) + template = env.get_template('components.rst') + with open(Path(__file__).resolve().parent / 'components.rst', 'w') as f: + f.write( + template.render( + intersphinx_mapping=intersphinx_mapping, + programs=labscript_suite_programs, + current_project=project, + img_path=img_path + ) + ) diff --git a/docs/source/img/blacs_32nx32n.svg b/docs/source/img/blacs_32nx32n.svg new file mode 100644 index 0000000..d6a2b0e --- /dev/null +++ b/docs/source/img/blacs_32nx32n.svg @@ -0,0 +1,178 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/docs/source/img/labscript-suite-rectangular-transparent_138nx70n.svg b/docs/source/img/labscript-suite-rectangular-transparent_138nx70n.svg new file mode 100644 index 0000000..828b77e --- /dev/null +++ b/docs/source/img/labscript-suite-rectangular-transparent_138nx70n.svg @@ -0,0 +1,579 @@ + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/img/labscript.ico b/docs/source/img/labscript.ico new file mode 100644 index 0000000000000000000000000000000000000000..28288fc88c1d3c2808ff74beee2b3e5fed11249d GIT binary patch literal 98716 zcmeHQ2V73y8^68nv@$NCbC0>ib7>&B_vTvBvDdn zYux`i<@CQDZ*JH7_VbhXem{a z7YY%CALwh{x|Ws|BZv}70U%LJ-)&0}BCUX?N-cc~=soHyKDkEGoqE7ZVf+6BA;+6cc292BjPnl3%#W0nFj& z+MEi6!yLn0OA-W_A-`{vB8ZlvES8;^px}KlzG^TKwlxiZUQ%R0Ic`6z)lrzzg_EAf{*)e#vPvr@E9@0a^eqo!8yTn4uEyT63!j! ze3B9qCAawb@p1o;;f~J(|IM38h!qt(h$X;uVq?|;c&-QJ>mBbEq@~Eyr%v&)|Bqvj z=EA9yCrOAIHU|m;w(z##&o&YKJRi;_KK6g!H4K~s_&NZu3jp|F8gSmkSgbYJoZ+we zf5<+M_I+yY=j)5F0VJ3Mt2m(#@9P2V>)q3X=Xz9o{Pv%>4sbXpEaG&ZP+X9;jk@nE zwp1V!pFij0{|E2?aDRo@YWTGwe1=3_1HiMSR`|XTukZQ$`=7VJbHdEm#|J+S6jPrW zf$KwfU%yU9RjC92-t8a0-&5xSyieCzxnmu^5Nql^0q`905fy)UPnW9CZ~yu00K8XB z#TY(2hQ|O2f@ll+>z?1k=L(PG;`sPCqx~Q5zwj9id`?H11J&Q(+p(hbks3pW@Ud@Z z*rW9uJ~yOd4ekj}{{AjUT|az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eAGh0Bc@#IQaXXEr8|$yJ_Ha3-_8TjY z;zl*@7tt2p3M4EIZFK&uG-60t8rtaiboOz(jg?1nqZ+q^Xte($8n5a6q5T`zLo^+q z&OWk(>c+~WxKWMt@%q0OKOP?)jmLv%6gR3-KVJXs@&E4iKW4ISqmQxpT)1hahr?M% zBivD4$6(mNeKJ(170Nd2YxKZ7Z+>#Y-$#dhnH5vol4&D0BEuX1B zB#+`oHR{Lf;P3za1jo4{8rP>=-?`;8^@rq9+^9zVczxcqYooD;=lA%=ZG3e4O#LBw z6gR3-KVC1glOjV#)6ai+e*fuK1g>6pf9MCs_YS)F==iwZ#>%6(L0$9SJG?K#X`@^J z>CWGqnvai}&L5PAv3`#q#-0M(so>ivf6Mj?z5gl1dI{ctz5?S9I(6!A37Q~&>4*yf&yX;UWG#1CS(MZbTLkq{@}q@^|Y&}(7@zfFem*Zls002^o@ zg8RVK$&;FW{4hosD<}tH>~Mp>0|9gq?BC|^-)wULWBVR^A&41$r>Zswf`S%+SKUHH zxLM|4tDheUV*@c(!QcAT1daWn{{9iJ5zS#efH7E2vP8JU-#$6zkh}61UxRl zV;g`TnP%&|5Iy5zkfzK zfHgce)}9}LbEKMcrP?*}Kc17K+OY~;fn$d;P-DW|-~aor`}hCSi~bwEOnR-LXmo82 pzhwY7^xuQwzpmnM|Dg=9YsXTDPjoFUm|k0p=GWFT2xo-*{{UOUNag?l literal 0 HcmV?d00001 diff --git a/docs/source/img/labscript_32nx32n.svg b/docs/source/img/labscript_32nx32n.svg new file mode 100644 index 0000000..97272af --- /dev/null +++ b/docs/source/img/labscript_32nx32n.svg @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/docs/source/img/labscript_64x64.svg b/docs/source/img/labscript_64x64.svg new file mode 100644 index 0000000..987cfe6 --- /dev/null +++ b/docs/source/img/labscript_64x64.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/docs/source/img/lyse_32nx32n.svg b/docs/source/img/lyse_32nx32n.svg new file mode 100644 index 0000000..1ddcdcc --- /dev/null +++ b/docs/source/img/lyse_32nx32n.svg @@ -0,0 +1,256 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/img/runmanager_32nx32n.svg b/docs/source/img/runmanager_32nx32n.svg new file mode 100644 index 0000000..d9df689 --- /dev/null +++ b/docs/source/img/runmanager_32nx32n.svg @@ -0,0 +1,267 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/img/runviewer_32nx32n.svg b/docs/source/img/runviewer_32nx32n.svg new file mode 100644 index 0000000..ee5aa68 --- /dev/null +++ b/docs/source/img/runviewer_32nx32n.svg @@ -0,0 +1,223 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/source/index.rst b/docs/source/index.rst index e3db258..cf14658 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -3,25 +3,38 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -``labscript`` documentation -=========================== -``labscript``, a component of the labscript suite, is an API used to define the experiment logic of a buffered experiment shot. This documentation will outline the general device hierarchy used when defining a connection table, and the ``labscript`` classes used to command input and output. For device specific documentation, and documentation for adding support for new devices, please refer to the ``labscript_devices`` documentation. +labscript +========= +**labscript**, a component of the labscript suite, is an API used to define the experiment logic of a buffered experiment shot. This documentation will outline the general device hierarchy used when defining a connection table, and the **labscript** classes used to command input and output. For device specific documentation, and documentation for adding support for new devices, please refer to the :doc:`labscript-devices ` documentation. -Contents -======== .. toctree:: :maxdepth: 2 + :hidden: + :caption: DOCUMENTATION introduction connection_table - api_reference/index + api/index +.. toctree:: + :maxdepth: 2 + :hidden: + :caption: FURTHER DOCUMENTATION + + components + +.. toctree:: + :maxdepth: 2 + :hidden: + :caption: LINKS + + Home Page + Source Code + PyPI + Anaconda Cloud + BitBucket Archive -Indices and tables -================== +.. todolist:: -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/example.py b/example.py index f757480..b7925cd 100644 --- a/example.py +++ b/example.py @@ -11,64 +11,161 @@ # # ##################################################################### -import __init__ # only have to do this because we're inside the labscript directory -from labscript import * +import numpy as np +from labscript import ( + AnalogIn, + AnalogOut, + ClockLine, + DDS, + DigitalOut, + MHz, + Shutter, + StaticDDS, + WaitMonitor, + start, + stop, + wait, +) from labscript_devices.PulseBlaster import PulseBlaster -from labscript_devices.NI_PCIe_6363 import NI_PCIe_6363 +from labscript_devices.NI_DAQmx.labscript_devices import NI_PCIe_6363 from labscript_devices.NovaTechDDS9M import NovaTechDDS9M from labscript_devices.Camera import Camera from labscript_devices.PineBlaster import PineBlaster -from labscript_devices.NI_PCI_6733 import NI_PCI_6733 -from labscript_utils.unitconversions import * +from labscript_devices.NI_DAQmx.labscript_devices import NI_PCI_6733 +from labscript_utils.unitconversions import example1, example2, example3 -PulseBlaster(name='pulseblaster_0', board_number=0) -ClockLine(name='pulseblaster_0_clockline_fast', pseudoclock=pulseblaster_0.pseudoclock, connection='flag 0') -ClockLine(name='pulseblaster_0_clockline_slow', pseudoclock=pulseblaster_0.pseudoclock, connection='flag 1') -NI_PCIe_6363(name='ni_card_0', parent_device=pulseblaster_0_clockline_fast, clock_terminal='ni_pcie_6363_0/PFI0', MAX_name='ni_pcie_6363_0', acquisition_rate=100e3) -NovaTechDDS9M(name='novatechdds9m_0', parent_device=pulseblaster_0_clockline_slow, com_port="com10") +PulseBlaster(name="pulseblaster_0", board_number=0) +ClockLine( + name="pulseblaster_0_clockline_fast", + pseudoclock=pulseblaster_0.pseudoclock, + connection="flag 0", +) +ClockLine( + name="pulseblaster_0_clockline_slow", + pseudoclock=pulseblaster_0.pseudoclock, + connection="flag 1", +) +NI_PCIe_6363( + name="ni_card_0", + parent_device=pulseblaster_0_clockline_fast, + clock_terminal="ni_pcie_6363_0/PFI0", + MAX_name="ni_pcie_6363_0", + acquisition_rate=100e3, +) +NovaTechDDS9M( + name="novatechdds9m_0", + parent_device=pulseblaster_0_clockline_slow, + com_port="com10", +) # Create a BIAS Camera, tirggered to take photos with flag 3 of pulseblaster_0 -Camera('andor_ixon_0', pulseblaster_0.direct_outputs, 'flag 3', BIAS_port = 42520, serial_number="0000", SDK="IMAQdx", effective_pixel_size=4.6e-6, exposure_time=.1, orientation='top') +Camera( + name="andor_ixon_0", + parent_device=pulseblaster_0.direct_outputs, + connection="flag 3", + BIAS_port=42520, + serial_number="0000", + SDK="IMAQdx", + effective_pixel_size=4.6e-6, + exposure_time=0.1, + orientation="top", +) # A second pseudoclock to just clock a NI_PCI_6733 Card -PineBlaster(name='pineblaster_0', trigger_device=ni_card_0, trigger_connection='port0/line15', usbport='COM7') -NI_PCI_6733(name='ni_card_1', parent_device=pineblaster_0.clockline, clock_terminal='ni_pcie_6733_0/PFI0', MAX_name='ni_pci_6733_0') - -# Create the output/input channels on the above devices -AnalogOut( 'analog0', ni_card_1, 'ao0', unit_conversion_class=example1) # use the example1 conversion class located in pythonlib/unitconversions/example.py with default paremeters - -# same as above, but we are changing some parameters used in the conversion and specifying a prefix to be used with units. You can now program in mA, uA, mGauss, uGauss -AnalogOut( 'analog1', ni_card_1, 'ao1', unit_conversion_class=example1, unit_conversion_parameters={'a':5, 'b':1, 'magnitudes':['m','u']}) -AnalogOut( 'analog2', ni_card_0, 'ao2') -AnalogIn( 'input1', ni_card_0, 'ai0') -Shutter( 'shutter1', ni_card_0, 'port0/line1', delay=(0,0)) -Shutter( 'shutter2', pulseblaster_0.direct_outputs, 'flag 2', delay=(0,0)) -DigitalOut( 'switch', pulseblaster_0.direct_outputs, 'flag 4') - -DDS( 'dds1', novatechdds9m_0, 'channel 0') -DDS( 'dds2', novatechdds9m_0, 'channel 1') -StaticDDS( 'dds5', novatechdds9m_0, 'channel 2') -# The next DDS is special because it has the frequency and amplitude calibrated using example2 and example3 classes from pythonlib/unitconversions/example.py -DDS( 'dds3', pulseblaster_0.direct_outputs, 'dds 0', freq_conv_class=example2, freq_conv_params={'a':4, 'b':6}, amp_conv_class=example3, amp_conv_params={'a':2, 'b':22, 'magnitudes':['m']}) -DDS( 'dds4', pulseblaster_0.direct_outputs, 'dds 1') +PineBlaster( + name="pineblaster_0", + trigger_device=ni_card_0, + trigger_connection="port0/line15", + usbport="COM7", +) +NI_PCI_6733( + name="ni_card_1", + parent_device=pineblaster_0.clockline, + clock_terminal="ni_pcie_6733_0/PFI0", + MAX_name="ni_pci_6733_0", +) + +# Create the output/input channels on the above devices use the example1 conversion +# class located in pythonlib/unitconversions/example.py with default paremeters +AnalogOut( + name="analog0", + parent_device=ni_card_1, + connection="ao0", + unit_conversion_class=example1, +) + +# same as above, but we are changing some parameters used in the conversion and +# specifying a prefix to be used with units. You can now program in mA, uA, mGauss, +# uGauss +AnalogOut( + name="analog1", + parent_device=ni_card_1, + connection="ao1", + unit_conversion_class=example1, + unit_conversion_parameters={"a": 5, "b": 1, "magnitudes": ["m", "u"]}, +) +AnalogOut(name="analog2", parent_device=ni_card_0, connection="ao2") +AnalogOut(name="analog3", parent_device=ni_card_0, connection="ao3") +AnalogIn(name="input1", parent_device=ni_card_0, connection="ai0") +DigitalOut(name="do0", parent_device=ni_card_0, connection="port0/line2") +Shutter( + name="shutter1", parent_device=ni_card_0, connection="port0/line1", delay=(0, 0) +) +Shutter( + name="shutter2", + parent_device=pulseblaster_0.direct_outputs, + connection="flag 2", + delay=(0, 0), +) +DigitalOut( + name="switch", parent_device=pulseblaster_0.direct_outputs, connection="flag 4" +) + +DDS(name="dds1", parent_device=novatechdds9m_0, connection="channel 0") +DDS(name="dds2", parent_device=novatechdds9m_0, connection="channel 1") +StaticDDS(name="dds5", parent_device=novatechdds9m_0, connection="channel 2") +# The next DDS is special because it has the frequency and amplitude calibrated using +# example2 and example3 classes from pythonlib/unitconversions/example.py +DDS( + name="dds3", + parent_device=pulseblaster_0.direct_outputs, + connection="dds 0", + freq_conv_class=example2, + freq_conv_params={"a": 4, "b": 6}, + amp_conv_class=example3, + amp_conv_params={"a": 2, "b": 22, "magnitudes": ["m"]}, +) +DDS(name="dds4", parent_device=pulseblaster_0.direct_outputs, connection="dds 1") # This sets up the inputs/counters/etc that will monitor # The first paremeter is the name for the WaitMonitor device -# The second and third paremeters are the device and channel respectively that goes high when a wait begins and low when it ends. This output should be +# The second and third paremeters are the device and channel respectively that goes +# high when a wait begins and low when it ends. This output should be # physically connected to a counter specified in the next two paremeters. -# The final two paremeters specify the device/channel that is to trigger the pseudoclock if the WAIT instruction hits the specified timeout. The output of -# this channel should be physicaly connect to the external trigger of the master pseudoclock. -WaitMonitor('wait_monitor', ni_card_0, 'port0/line0', ni_card_0, 'ctr0', ni_card_0, 'pfi1') +# The final two paremeters specify the device/channel that is to trigger the +# pseudoclock if the WAIT instruction hits the specified timeout. The output of +# this channel should be physicaly connect to the external trigger of the master +# pseudoclock. +WaitMonitor( + name="wait_monitor", + parent_device=ni_card_0, + connection="port0/line0", + acquisition_device=ni_card_0, + acquisition_connection="ctr0", + timeout_device=ni_card_0, + timeout_connection="pfi1", +) # A variable to define the acquisition rate used for the analog outputs below. # This is just here to show you that you can use variables instead of typing in numbers! -# Furthermore, these variables could be defined within runmanager (rather than in the code like this one is) +# Furthermore, these variables could be defined within runmanager (rather than in the +# code like this one is) # for easy manipulation via a graphical interface. rate = 1e4 # The time (in seconds) we wish the pineblaster pseudoclock to start after # the master pseudoclock (the pulseblaster) -pineblaster_0.set_initial_trigger_time(1) +pineblaster_0.set_initial_trigger_time(t=0.9) # Start the experiment! start() @@ -76,107 +173,132 @@ # A variable to keep track of time t = 0 -# Analog Acquisitions are acquired at the sample rate specified when the *device* is instantiated (eg NI_PCIE_6363() above) +# Analog Acquisitions are acquired at the sample rate specified when the *device* is +# instantiated (eg NI_PCIE_6363() above) # Acquire an analog trace on this channel from t=0s to t=1s -input1.acquire('measurement1', 0, 1) +input1.acquire(label='measurement1', start_time=0, end_time=1) # Acquire an analog trace on this channel from t=3s to t=5s -input1.acquire('measurement2', 3, 5) +input1.acquire(label='measurement2', start_time=3, end_time=5) # Acquire an analog trace on this channel from t=7s to t=9s -input1.acquire('measurement3', 7, 9) +input1.acquire(label='measurement3', start_time=7, end_time=9) # Set some initial values (t=0) for DDS 1 -dds1.setamp(t, 0.5) -dds1.setfreq(t, 0.6) -dds1.setphase(t, 0.7) +dds1.setamp(t=t, value=0.5) +dds1.setfreq(t=t, value=0.6) +dds1.setphase(t=t, value=0.7) # Set some values for dds2 at t=1s. They will have value '0' before this # time unless otherwise set -dds2.setamp(t+1, 0.9) -dds2.setfreq(t+1, 1.0) -dds2.setphase(t+1, 1.1) +dds2.setamp(t=t + 1, value=0.9) +dds2.setfreq(t=t + 1, value=1.0) +dds2.setphase(t=t + 1, value=1.1) # dds5 is a "static" DDS. This means its value can only be set once, and # will be set just before the experiment begins -dds5.setfreq(90*MHz) -dds5.setamp(1) -dds5.setphase(0) +dds5.setfreq(value=90 * MHz) +dds5.setamp(value=1) +dds5.setphase(value=0) # Have the shutters start in the closed state (t=0) -shutter1.close(t) -shutter2.close(t) +shutter1.close(t=t) +shutter2.close(t=t) -# Analog0 is attached to ni_card_1, which is an NI-pci_6733 card (MAX name ni_pcie_6733_0) clocked by a pineblaster -# The pineblaster is being triggered to start by a pulseblaster, which introduces a delay into the start of output from the NI card -# This is all handled by labscript, and you still specify times from the beginning of the experiment (when the master pseudoclock is started) +# Analog0 is attached to ni_card_1, which is an NI-pci_6733 card (MAX name +# ni_pcie_6733_0) clocked by a pineblaster +# The pineblaster is being triggered to start by a pulseblaster, which introduces +# a delay into the start of output from the NI card +# This is all handled by labscript, and you still specify times from the beginning of +# the experiment (when the master pseudoclock is started) # YOU DO NOT HAVE TO TAKE INTO ACCOUNT THE DELAY YOURSELF!! -# You do however need to make sure you do not command output from this device before the device has actually started. +# You do however need to make sure you do not command output from this device before +# the device has actually started. # To do so, make sure no commands happen on this channel before analog0.t0 # (this variable contains the delay time!) -analog0.constant(analog0.t0, 2) +analog0.constant(t=analog0.t0, value=2) # Set this channel to a constant value # As this channel is clocked by the master pseudoclock, you can command # output from t=0 -analog2.constant(t, 3) +analog2.constant(t=t, value=3) # Again, this must not start until analog1.t0 or later! -analog1.sine(analog1.t0, duration=6, amplitude=5, angfreq=2*pi, - phase=0, dc_offset=0.0, samplerate=rate) +analog1.sine( + t=analog1.t0, + duration=6, + amplitude=5, + angfreq=2 * np.pi, + phase=0, + dc_offset=0.0, + samplerate=rate, +) # Let's increment our time variable! t += max(1, analog0.t0) # Open the shutter, enable the DDS, ramp an analog output! -shutter2.open(t) -dds3.enable(t) -analog0.ramp(t, duration=2, initial=2, final=3, samplerate=rate) +shutter2.open(t=t) +dds3.enable(t=t) +analog0.ramp(t=t, duration=2, initial=2, final=3, samplerate=rate) # Take a picture -andor_ixon_0.expose('exposure_1', t, 'flat') -andor_ixon_0.expose('exposure_1', t+1, 'atoms') +andor_ixon_0.expose(name='exposure_1', t=t, frametype='flat') +andor_ixon_0.expose(name='exposure_1', t=t + 1, frametype='atoms') # Do some more things at various times! # (these are ignoring the t variable) def my_ramp(t, *args, **kwargs): lambda_func = functions.sine_ramp(*args, **kwargs) return lambda_func(t) -analog2.sine_ramp(t=2.25, duration=3, initial=3, final=4, - samplerate=rate, truncation=0.7) + + +analog2.sine_ramp( + t=2.25, duration=3, initial=3, final=4, samplerate=rate, truncation=0.7 +) shutter1.open(t=5.89) analog2.constant(t=5.9, value=5) analog2.constant(t=7, value=4) analog2.constant(t=8, value=5) +# Incremenent t by 9 seconds +t += 9 -t += 9 # set t=10 seconds # Wait for an external trigger on the master pseudoclock # Waits must be names # The timeout defaults to 5s, unless otherwise specified. # The timeout specifies how long to wait without seeing the external # trigger before continuing the experiment -t += wait('my_first_wait', t=t, timeout=2) -# Waits take very little time as far as labscript is concerned. They only add on the retirggering time needed to start devices up and get them all in sync again. -# After a wait, labscript time (the t variable here) and execution time (when the hardware instructions are executed on the hardware) will not be the same +t += wait(label='my_first_wait', t=t, timeout=2) + +# Waits take very little time as far as labscript is concerned. They only add on the +# retirggering time needed to start devices up and get them all in sync again. +# After a wait, labscript time (the t variable here) and execution time (when the +# hardware instructions are executed on the hardware) will not be the same # as the wait instruction may take anywhere from 0 to "timeout" seconds, # and this number is only determined during execution time. t += 1 # Do something 1s after the wait! -switch.go_high(t) +switch.go_high(t=t) # Examples programming in different units as specified in the # unitconversion classes passed as parameters to the channel definition -analog0.constant(t, value=5, units='A') -analog1.constant(t, value=1000, units='mGauss') -dds3.setfreq(t, value=50, units='detuned_MHz') -dds3.setamp(t, value=1.9, units='W') +analog0.constant(t=t, value=5, units='A') +analog1.constant(t=t, value=1000, units='mGauss') +dds3.setfreq(t=t, value=50, units='detuned_MHz') +dds3.setamp(t=t, value=1.9, units='W') + +# Hold values for 2 seconds t += 2 -analog0.ramp(t, duration=1, initial=5, final=7, samplerate=rate, units='Gauss') -analog1.constant(t, value=3e6, units='uA') -dds3.setfreq(t, value=60, units='detuned_MHz') -dds3.setamp(t, value=500, units='mW') + +analog0.ramp(t=t, duration=1, initial=5, final=7, samplerate=rate, units='Gauss') +analog1.constant(t=t, value=3e6, units='uA') +dds3.setfreq(t=t, value=60, units='detuned_MHz') +dds3.setamp(t=t, value=500, units='mW') + +# Hold values for 2 seconds t += 2 + # Stop at t=15 seconds, note that because of the wait timeout, this might # be as late as 17s (Plus a little bit of retriggering time) in execution # time -stop(t) +stop(t=t) diff --git a/labscript/labscript.py b/labscript/labscript.py index bd48e8a..39fd574 100644 --- a/labscript/labscript.py +++ b/labscript/labscript.py @@ -102,7 +102,7 @@ def bitfield(arrays,dtype): """converts a list of arrays of ones and zeros into a single array of unsigned ints of the given datatype.""" n = {uint8:8,uint16:16,uint32:32} - if arrays[0] is 0: + if np.array_equal(arrays[0], 0): y = zeros(max([len(arr) if iterable(arr) else 1 for arr in arrays]),dtype=dtype) else: y = array(arrays[0],dtype=dtype) @@ -1120,7 +1120,7 @@ def __init__(self,name,parent_device,connection,limits = None,unit_conversion_cl # Here we specifically differentiate "None" from False as we will later have a conditional which relies on # self.limits being either a correct tuple, or "None" if limits is not None: - if not isinstance(limits,tuple) or len(limits) is not 2: + if not isinstance(limits,tuple) or len(limits) != 2: raise LabscriptError('The limits for "%s" must be tuple of length 2. Eg. limits=(1,2)'%(self.name)) if limits[0] > limits[1]: raise LabscriptError('The first element of the tuple must be lower than the second element. Eg limits=(1,2), NOT limits=(2,1)') @@ -2279,7 +2279,7 @@ def generate_code(): elif not os.path.exists(compiler.hdf5_filename): with h5py.File(compiler.hdf5_filename ,'w') as hdf5_file: hdf5_file.create_group('globals') - with h5py.File(compiler.hdf5_filename) as hdf5_file: + with h5py.File(compiler.hdf5_filename, 'a') as hdf5_file: try: hdf5_file.create_group('devices') hdf5_file.create_group('calibrations') diff --git a/readthedocs.yaml b/readthedocs.yaml new file mode 100644 index 0000000..35084d6 --- /dev/null +++ b/readthedocs.yaml @@ -0,0 +1,27 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Build documentation in the docs/ directory with Sphinx +sphinx: + builder: dirhtml + configuration: docs/source/conf.py + fail_on_warning: false + +# Optionally build your docs in additional formats such as PDF +formats: + - pdf + - epub + +# Optionally set the version of Python and requirements required to build your docs +python: + version: 3.7 + install: + - method: pip + path: . + extra_requirements: + - docs + system_packages: true + \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 96927db..549744f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,7 +26,15 @@ packages = find: python_requires = >=3.6 install_requires = importlib_metadata - labscript_utils>=2.14.0 + labscript_utils>=3.0.0 numpy>=1.15 scipy matplotlib + +[options.extras_require] +docs = + PyQt5 + Sphinx==3.0.1 + sphinx-rtd-theme==0.4.3 + recommonmark==0.6.0 + m2r==0.2.1 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy