Skip to content

Commit a953031

Browse files
committed
Squashed commit of the following:
commit d8b8343 Merge: 9bc7a39 bfa6932 Author: Chris Billington <chrisjbillington@gmail.com> Date: Wed Jun 24 20:48:39 2020 -0400 Merge pull request labscript-suite#59 from philipstarkey/fix-h5py-file-mode Addresses labscript-suite#47 for this module commit 9bc7a39 Merge: 1189334 66d0be4 Author: Chris Billington <chrisjbillington@gmail.com> Date: Wed Jun 24 20:30:42 2020 -0400 Merge pull request labscript-suite#55 from rpanderson/example_IMAQdx_remote Example labscript and analysis scripts for IMAQdxCamera and RemoteBLACS commit bfa6932 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jun 25 10:25:49 2020 +1000 Addresses labscript-suite#47 for this module commit 1189334 Merge: 5025b1b 0b0d07a Author: Chris Billington <chrisjbillington@gmail.com> Date: Wed Jun 24 19:35:15 2020 -0400 Merge pull request labscript-suite#54 from rpanderson/example_experiment Minimal working connection table and example experiment script commit 66d0be4 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Mon Jun 15 13:37:23 2020 +1000 lyse analysis script demonstrating some Run methods for example_IMAQdx_remote commit a48a9c0 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Mon Jun 15 13:15:48 2020 +1000 Example connection table and labscript experiment script for RemoteBLACS and IMAQdxCamera commit 5025b1b Merge: f77525f ed76901 Author: Chris Billington <chrisjbillington@gmail.com> Date: Wed Jun 24 02:16:29 2020 -0400 Merge pull request labscript-suite#58 from philipstarkey/philipstarkey/issue43 Fixes .pth file has no effect in editable install commit ed76901 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Wed Jun 24 01:23:44 2020 -0400 Move copying of .pth file into setup.py Use a custom develop command to copy the .pth file into site-packages when `python setup.py develop` is run - this is what pip does under the hood for `pip install -e`. No longer need desktop-app to locate site-packages, as the setuptools command class knows it as `self.install_dir`. The file is not removed by `pip uninstall`, but due to the `try: except:`s in the `.pth` file, leaving it behind is harmless. It is removed if the user runs whatever `setup.py` command undoies commit 894e245 Author: chrisjbillington <chrisjbillington@gmail.com> Date: Wed Jun 24 00:04:13 2020 -0400 Require desktop-app 0.2.6 Which renames `_get_install_directory` to not have an underscore, and which fixes a bug preventing docs from building on RTD. commit 271439e Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Wed Jun 24 12:53:49 2020 +1000 Removed support for custom development directories from path commit dd098a5 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Wed Jun 24 12:38:19 2020 +1000 Fixes .pth file has no effect in editable install Fixes labscript-suite#43 The .pth file is now copied during `labscript-profile-create` if it does not exist in the site-packages dir (where the .egg-info files exist) and if it the .pth file exists in the package structure (aka labscript-utils it is an editable install) The labscript-suite.pth file has been updated to not raise an exception if labscript-suite has been uninstalled (so we do not have to worry about cleanup). Also updated the `labscript_profile.add_userlib_and_pythonlib` function to use the `site` library for adding userlib and pythonlib to the system path. commit 0b0d07a Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Mon Jun 22 17:48:00 2020 +1000 start()/stop() in __main__ block so connection table can be imported commit 4c19de9 Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Mon Jun 15 13:12:52 2020 +1000 Add AnalogOut with ramp example, rename DigitalOut connection commit 9b64a0d Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Wed Jun 10 23:09:03 2020 +1000 Minimal example connection table and labscript using dummy devices commit f77525f Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sat Jun 20 18:09:53 2020 +1000 Removed unnecessary fixed title from main TOC This was erroneously added in labscript-suite#57 commit 5e02b01 Merge: 3f78207 8b19766 Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Sat Jun 20 18:07:04 2020 +1000 Merge pull request labscript-suite#57 from philipstarkey/master Changed URL for API reference to be shorter Fixed bug with readthedocs auto PR build commit 8b19766 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Sat Jun 20 12:02:51 2020 +1000 Updated method call for stylesheet to remove deprecated warning in build commit 56fdd63 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Sat Jun 20 11:46:33 2020 +1000 Fixed sphinx conf to detect PR builds and link to 'latest' instead of stable commit 9889d19 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Sat Jun 20 10:44:04 2020 +1000 Changed URL for API reference to be shorter commit 3f78207 Merge: bbd928a bf9d10e Author: Phil Starkey <philipstarkey@users.noreply.github.com> Date: Fri Jun 19 18:58:37 2020 +1000 Merge pull request labscript-suite#56 from philipstarkey/master Added links to other component docs commit bf9d10e Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Fri Jun 19 16:06:09 2020 +1000 Addressing latest review comments commit e75b6bc Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Fri Jun 19 11:23:49 2020 +1000 Updated docs to use jinja template for component doc links commit 9c61238 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jun 18 17:14:57 2020 +1000 Removed autogenerated rst file from version control commit 2303185 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jun 18 16:43:29 2020 +1000 Updated .gitignore with latest GitHub defaults commit 87b757e Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jun 18 16:39:52 2020 +1000 Relocated custom sphinx gitignore rules commit 75813a5 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Thu Jun 18 16:31:01 2020 +1000 Updated PR as per review in labscript-suite/labscript-suite#48 commit bbd928a Author: Russell Anderson <5637107+rpanderson@users.noreply.github.com> Date: Wed Jun 17 11:39:17 2020 +1000 Populated README.md with styling, iconogrpahy, prose, and badges commit 573c521 Author: philipstarkey <philipstarkey@users.noreply.github.com> Date: Tue Jun 16 18:10:25 2020 +1000 Added links to other component docs
1 parent b312180 commit a953031

28 files changed

+2149
-168
lines changed

.gitignore

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# This gitignore file consists of 2 parts:
2+
# * The standard Python .gitignore rules from GitHub
3+
# * custom ignore rules for the labscript suite.
4+
#
5+
# These should be kept separate so that the generic rules can be updated with a
6+
# copy/paste without having to worry about whether we are removing custom rules
7+
18
# Byte-compiled / optimized / DLL files
29
__pycache__/
310
*.py[cod]
@@ -20,7 +27,6 @@ parts/
2027
sdist/
2128
var/
2229
wheels/
23-
pip-wheel-metadata/
2430
share/python-wheels/
2531
*.egg-info/
2632
.installed.cfg
@@ -50,6 +56,7 @@ coverage.xml
5056
*.py,cover
5157
.hypothesis/
5258
.pytest_cache/
59+
cover/
5360

5461
# Translations
5562
*.mo
@@ -69,11 +76,10 @@ instance/
6976
.scrapy
7077

7178
# Sphinx documentation
72-
docs/html/
7379
docs/_build/
74-
docs/source/_build/
7580

7681
# PyBuilder
82+
.pybuilder/
7783
target/
7884

7985
# Jupyter Notebook
@@ -84,6 +90,8 @@ profile_default/
8490
ipython_config.py
8591

8692
# pyenv
93+
# For a library or package, you might want to ignore these files since the code is
94+
# intended to run in multiple environments; otherwise, check them in:
8795
.python-version
8896

8997
# pipenv
@@ -130,9 +138,24 @@ dmypy.json
130138
# Pyre type checker
131139
.pyre/
132140

141+
# pytype static type analyzer
142+
.pytype/
143+
144+
# Cython debug symbols
145+
cython_debug/
146+
147+
#
148+
# Custom labscript suite .gitignore rules start below
149+
#
150+
133151
# Editors
134152
.vscode/
135153

136154
# conda build results
137155
conda_build/
138156
conda_packages/
157+
158+
# Sphinx documentation
159+
docs/html/
160+
docs/source/_build/
161+
docs/source/components.rst

README.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
1-
# labscript_utils
1+
<img src="https://raw.githubusercontent.com/labscript-suite/labscript-suite/master/art/labscript_32nx32n.svg" height="64" alt="the labscript suite" align="right">
22

3-
Shared modules used by the labscript suite. Includes a graphical exception handler, debug tools, configuration management, cross platform filepath conversions, unit conversions and custom GUI widgets.
3+
# the _labscript suite_ » labscript-utils
44

5-
(
6-
[view on Github](https://github.com/labscript-suite/labscript_utils)
7-
)
5+
### Shared modules used by the _labscript suite_
86

7+
[![Actions Status](https://github.com/labscript-suite/labscript-utils/workflows/Build%20and%20Release/badge.svg?branch=maintenance%2F3.0.x)](https://github.com/labscript-suite/labscript-utils/actions)
8+
[![License](https://img.shields.io/pypi/l/labscript-utils.svg)](https://github.com/labscript-suite/labscript-utils/raw/master/LICENSE.txt)
9+
[![Python Version](https://img.shields.io/pypi/pyversions/labscript-utils.svg)](https://python.org)
10+
[![PyPI](https://img.shields.io/pypi/v/labscript-utils.svg)](https://pypi.org/project/labscript-utils)
11+
[![Conda Version](https://img.shields.io/conda/v/labscript-suite/labscript-utils)](https://anaconda.org/labscript-suite/labscript-utils)
12+
[![Google Group](https://img.shields.io/badge/Google%20Group-labscriptsuite-blue.svg)](https://groups.google.com/forum/#!forum/labscriptsuite)
13+
<!-- [![DOI](http://img.shields.io/badge/DOI-10.1063%2F1.4817213-0F79D0.svg)](https://doi.org/10.1063/1.4817213) -->
914

15+
16+
Shared modules used by the [*labscript suite*](https://github.com/labscript-suite/labscript-suite). Includes a graphical exception handler, debug tools, configuration management, cross-platform filepath conversions, physical unit conversions and custom GUI widgets.
17+
18+
19+
## Installation
20+
21+
labscript-utils 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.

docs/source/_static/custom.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ details {
5757
0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
5858
margin-bottom: 24px;
5959
}
60+
61+
img.labscript-suite-icon {
62+
min-width: 32px;
63+
}

docs/source/_templates/components.rst

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{% if current_project != 'the labscript suite' %}
2+
.. toctree::
3+
:maxdepth: 2
4+
:hidden:
5+
6+
the labscript suite <{{intersphinx_mapping['labscript-suite'][0]}}>
7+
8+
{% endif %}
9+
*labscript suite* components
10+
============================
11+
12+
The *labscript suite* is modular by design, and is comprised of:
13+
14+
.. list-table:: Python libraries
15+
:widths: 10 90
16+
:header-rows: 0
17+
18+
{% for prog, item in programs.items() if item.type == 'lib' %}
19+
* - .. image:: {{img_path}}/{{item.icon}}
20+
:target: {{intersphinx_mapping['%s' | format(prog)][0]}}
21+
:class: labscript-suite-icon
22+
- |{{prog}}|_ --- {{item.desc}}
23+
{% endfor %}
24+
25+
.. list-table:: Graphical applications
26+
:widths: 10 90
27+
:header-rows: 0
28+
29+
{% for prog, item in programs.items() if item.type == 'gui' %}
30+
* - .. image:: {{img_path}}/{{item.icon}}
31+
:target: {{intersphinx_mapping['%s' | format(prog)][0]}}
32+
:class: labscript-suite-icon
33+
- |{{prog}}|_ --- {{item.desc}}
34+
{% endfor %}
35+
36+
.. toctree::
37+
:maxdepth: 2
38+
:hidden:
39+
40+
{% for prog in programs|sort if prog != current_project %}
41+
{{prog}} <{{intersphinx_mapping['%s' | format(prog)][0]}}>
42+
{% endfor %}
43+
44+
{% for prog in programs %}
45+
.. |{{prog}}| replace:: **{{prog}}**
46+
.. _{{prog}}: {{intersphinx_mapping['%s' | format(prog)][0]}}
47+
{% endfor %}
File renamed without changes.

docs/source/conf.py

Lines changed: 68 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111
# documentation root, use os.path.abspath to make it absolute, like shown here.
1212
#
1313
import os
14+
from pathlib import Path
1415
from m2r import MdInclude
1516
from recommonmark.transform import AutoStructify
17+
from jinja2 import FileSystemLoader, Environment
1618

1719
# -- Project information (unique to each project) -------------------------------------
1820

@@ -26,8 +28,9 @@
2628
release = version
2729

2830
# HTML icons
29-
html_logo = "img/{}.svg".format(project)
30-
html_favicon = "img/{}.ico".format(project)
31+
img_path = 'img'
32+
html_logo = img_path + "/labscript_64x64.svg"
33+
html_favicon = img_path + "/labscript.ico"
3134

3235
# -- General configuration (should be identical across all projects) ------------------
3336

@@ -79,38 +82,66 @@
7982
'matplotlib': ('https://matplotlib.org/', None),
8083
'h5py': ('http://docs.h5py.org/en/stable/', None),
8184
'pydaqmx': ('https://pythonhosted.org/PyDAQmx/', None),
82-
# from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py
83-
# under MIT License
8485
'qt': (
8586
'',
8687
'pyqt5-modified-objects.inv',
87-
)
88+
) # from https://github.com/MSLNZ/msl-qt/blob/master/docs/create_pyqt_objects.py
89+
# under MIT License
8890
# TODO
8991
# desktop-app
9092
# spinapi/pynivision/etc
9193
}
9294

9395
# list of all labscript suite components that have docs
94-
labscript_suite_programs = [
95-
'labscript',
96-
'runmanager',
97-
'runviewer',
98-
'blacs',
99-
'lyse',
100-
'labscript-utils',
101-
'labscript-devices',
102-
]
103-
# remove this current repo from the list
104-
if project in labscript_suite_programs:
105-
labscript_suite_programs.remove(project)
96+
labscript_suite_programs = {
97+
'labscript': {
98+
'desc': 'Expressive composition of hardware-timed experiments',
99+
'icon': 'labscript_32nx32n.svg',
100+
'type': 'lib',
101+
},
102+
'labscript-devices': {
103+
'desc': 'Plugin architecture for controlling experiment hardware',
104+
'icon': 'labscript_32nx32n.svg',
105+
'type': 'lib',
106+
},
107+
'labscript-utils': {
108+
'desc': 'Shared modules used by the *labscript suite*',
109+
'icon': 'labscript_32nx32n.svg',
110+
'type': 'lib',
111+
},
112+
'runmanager': {
113+
'desc': 'Graphical and remote interface to parameterized experiments',
114+
'icon': 'runmanager_32nx32n.svg',
115+
'type': 'gui',
116+
},
117+
'blacs': {
118+
'desc': 'Graphical interface to scientific instruments and experiment supervision',
119+
'icon': 'blacs_32nx32n.svg',
120+
'type': 'gui',
121+
},
122+
'lyse': {
123+
'desc': 'Online analysis of live experiment data',
124+
'icon': 'lyse_32nx32n.svg',
125+
'type': 'gui',
126+
},
127+
'runviewer': {
128+
'desc': 'Visualize hardware-timed experiment instructions',
129+
'icon': 'runviewer_32nx32n.svg',
130+
'type': 'gui',
131+
},
132+
}
106133

107134
# whether to use stable or latest version
108-
labscript_suite_doc_version = 'stable' # 'stable' or 'latest'
135+
labscript_suite_doc_version = os.environ.get('READTHEDOCS_VERSION', 'latest')
136+
if '.' in labscript_suite_doc_version:
137+
labscript_suite_doc_version = 'stable'
138+
elif labscript_suite_doc_version not in ['stable', 'latest']:
139+
labscript_suite_doc_version = 'latest'
109140

110141
# add intersphinx references for each component
111142
for ls_prog in labscript_suite_programs:
112143
intersphinx_mapping[ls_prog] = (
113-
'https://docs.labscript_suite.org/projects/{}/en/{}/'.format(
144+
'https://docs.labscriptsuite.org/projects/{}/en/{}/'.format(
114145
ls_prog, labscript_suite_doc_version
115146
),
116147
None,
@@ -119,7 +150,7 @@
119150
# add intersphinx reference for the metapackage
120151
if project != "the labscript suite":
121152
intersphinx_mapping['labscript-suite'] = (
122-
'https://docs.labscript_suite.org/en/{}/'.format(labscript_suite_doc_version),
153+
'https://docs.labscriptsuite.org/en/{}/'.format(labscript_suite_doc_version),
123154
None,
124155
)
125156

@@ -137,6 +168,7 @@
137168
todo_include_todos = False
138169
else:
139170
todo_include_todos = True
171+
140172
# -- Options for HTML output -------------------------------------------------
141173

142174
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -158,7 +190,6 @@
158190
# Customize the html_theme
159191
html_theme_options = {'navigation_depth': 3}
160192

161-
162193
# Use m2r only for mdinclude and recommonmark for everything else
163194
# https://github.com/readthedocs/recommonmark/issues/191#issuecomment-622369992
164195
def setup(app):
@@ -176,4 +207,19 @@ def setup(app):
176207
app.add_config_value('m2r_anonymous_references', False, 'env')
177208
app.add_config_value('m2r_disable_inline_math', False, 'env')
178209
app.add_directive('mdinclude', MdInclude)
179-
app.add_stylesheet('custom.css')
210+
app.add_css_file('custom.css')
211+
212+
# generate the components.rst file dynamically so it points to stable/latest
213+
# of subprojects correctly
214+
loader = FileSystemLoader(Path(__file__).resolve().parent / templates_path[0])
215+
env = Environment(loader=loader)
216+
template = env.get_template('components.rst')
217+
with open(Path(__file__).resolve().parent / 'components.rst', 'w') as f:
218+
f.write(
219+
template.render(
220+
intersphinx_mapping=intersphinx_mapping,
221+
programs=labscript_suite_programs,
222+
current_project=project,
223+
img_path=img_path
224+
)
225+
)

0 commit comments

Comments
 (0)
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