-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc53b5b
commit 71bfdaa
Showing
94 changed files
with
12,977 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: c56ee6fc5016e96a4da57b6fe21cec46 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+5 KB
0.9.0/.doctrees/explanations/decisions/0001-record-architecture-decisions.doctree
Binary file not shown.
Binary file added
BIN
+6.67 KB
0.9.0/.doctrees/explanations/decisions/0002-switched-to-python-copier-template.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Explanations | ||
|
||
Explanations of how it works and why it works that way. | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
explanations/* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Architectural Decision Records | ||
|
||
Architectural decisions are made throughout a project's lifetime. As a way of keeping track of these decisions, we record these decisions in Architecture Decision Records (ADRs) listed below. | ||
|
||
```{toctree} | ||
:glob: true | ||
:maxdepth: 1 | ||
|
||
decisions/* | ||
``` | ||
|
||
For more information on ADRs see this [blog by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions). |
18 changes: 18 additions & 0 deletions
18
0.9.0/_sources/explanations/decisions/0001-record-architecture-decisions.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 1. Record architecture decisions | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
We need to record the architectural decisions made on this project. | ||
|
||
## Decision | ||
|
||
We will use Architecture Decision Records, as [described by Michael Nygard](http://thinkrelevance.com/blog/2011/11/15/documenting-architecture-decisions). | ||
|
||
## Consequences | ||
|
||
See Michael Nygard's article, linked above. To create new ADRs we will copy and | ||
paste from existing ones. |
28 changes: 28 additions & 0 deletions
28
0.9.0/_sources/explanations/decisions/0002-switched-to-python-copier-template.md.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# 2. Adopt python-copier-template for project structure | ||
|
||
## Status | ||
|
||
Accepted | ||
|
||
## Context | ||
|
||
We should use the following [python-copier-template](https://github.com/DiamondLightSource/python-copier-template). | ||
The template will ensure consistency in developer | ||
environments and package management. | ||
|
||
## Decision | ||
|
||
We have switched to using the template. | ||
|
||
## Consequences | ||
|
||
This module will use a fixed set of tools as developed in `python-copier-template` | ||
and can pull from this template to update the packaging to the latest techniques. | ||
|
||
As such, the developer environment may have changed, the following could be | ||
different: | ||
|
||
- linting | ||
- formatting | ||
- pip venv setup | ||
- CI/CD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Index | ||
|
||
<!-- Placeholder that sphinx will replace with a generated index --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# How-to Guides | ||
|
||
Practical step-by-step guides for the more experienced user. | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
how-to/* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Capture data | ||
|
||
The `:DATA` PVs are used to capture data from the panda. | ||
These can be viewed from the DATA screen. | ||
|
||
```{image} /images/data_bobfile.png | ||
:align: center | ||
:alt: The data screen | ||
``` | ||
|
||
- The file directory and name are chosen with `:DATA:HDFDirectory` and `:DATA:HDFFileName`. | ||
- The number of directories that the IOC is allowed to create provided they don't exist is determined by `:DATA:CreateDirectory`. The behavior of this signal is the same as the identical PV in [`areaDetector`](https://areadetector.github.io/areaDetector/ADCore/NDPluginFile.html). | ||
- `DATA:DirectoryExists` represents whether or not the directory specified exists and is writable by the user under which the IOC is running. | ||
- `:DATA:NumCapture` is the number of frames to capture in the file. | ||
- `:DATA:NumCaptured` is the number of frames written to file. | ||
- `:DATA:NumReceived` is the number of frames received from the panda. | ||
- `:DATA:FlushPeriod` is the frequency that the data is flushed into frames in the client. | ||
- `:DATA:Capture` will begin capturing data. | ||
- `:DATA:CaptureMode` is one of the three capture modes listed below. | ||
|
||
## First N mode | ||
|
||
Begin capturing data and writing it to file as soon as it is received. Stop capturing once `NumCapture` | ||
frames have been written or the panda has been disarmed. | ||
|
||
## Last N mode | ||
|
||
Begin capturing data in a buffer, once capturing has finished write the last `NumCapture` frames to disk. | ||
|
||
## Forever mode | ||
|
||
Keep capturing and writing frames. Once the panda has been disarmed wait for it to be armed again and continue writing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
```{include} ../../.github/CONTRIBUTING.md | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Run in a container | ||
|
||
Pre-built containers with PandABlocks-ioc and its dependencies already | ||
installed are available on [Github Container Registry](https://ghcr.io/PandABlocks/PandABlocks-ioc). | ||
|
||
## Starting the container | ||
|
||
To pull the container from github container registry and run: | ||
|
||
``` | ||
$ docker run ghcr.io/pandablocks/PandABlocks-ioc:latest --version | ||
``` | ||
|
||
To get a released version, use a numbered release instead of `latest`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
html_theme.sidebar_secondary.remove: true | ||
--- | ||
|
||
```{include} ../README.md | ||
:end-before: <!-- README only content | ||
``` | ||
|
||
|
||
How the documentation is structured | ||
----------------------------------- | ||
|
||
Documentation is split into [four categories](https://diataxis.fr), also accessible from links in the top bar. | ||
|
||
<!-- https://sphinx-design.readthedocs.io/en/latest/grids.html --> | ||
|
||
::::{grid} 2 | ||
:gutter: 4 | ||
|
||
:::{grid-item-card} {material-regular}`directions_walk;2em` | ||
```{toctree} | ||
:maxdepth: 2 | ||
tutorials | ||
``` | ||
+++ | ||
Tutorials for installation and typical usage. New users start here. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`directions;2em` | ||
```{toctree} | ||
:maxdepth: 2 | ||
how-to | ||
``` | ||
+++ | ||
Practical step-by-step guides for the more experienced user. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`info;2em` | ||
```{toctree} | ||
:maxdepth: 2 | ||
explanations | ||
``` | ||
+++ | ||
Explanations of how it works and why it works that way. | ||
::: | ||
|
||
:::{grid-item-card} {material-regular}`menu_book;2em` | ||
```{toctree} | ||
:maxdepth: 2 | ||
reference | ||
``` | ||
+++ | ||
Technical reference material including APIs and release notes. | ||
::: | ||
|
||
:::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Reference | ||
|
||
Technical reference material including APIs and release notes. | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
reference/* | ||
genindex | ||
Release Notes <https://github.com/PandABlocks/PandABlocks-ioc/releases> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# API | ||
|
||
```{eval-rst} | ||
.. automodule:: pandablocks_ioc | ||
|
||
``pandablocks_ioc`` | ||
----------------------------------- | ||
``` | ||
|
||
This is the internal API reference for {\{package_name}} | ||
|
||
```{eval-rst} | ||
.. data:: pandablocks_ioc.__version__ | ||
:type: str | ||
|
||
Version number as calculated by https://github.com/pypa/setuptools_scm | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Tutorials | ||
|
||
Tutorials for installation and typical usage. New users start here. | ||
|
||
```{toctree} | ||
:maxdepth: 1 | ||
:glob: | ||
|
||
tutorials/* | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Installation | ||
|
||
## Check your version of python | ||
|
||
You will need python 3.8 or later. You can check your version of python by | ||
typing into a terminal: | ||
|
||
``` | ||
$ python3 --version | ||
``` | ||
|
||
## Create a virtual environment | ||
|
||
It is recommended that you install into a “virtual environment” so this | ||
installation will not interfere with any existing Python software: | ||
|
||
``` | ||
$ python3 -m venv /path/to/venv | ||
$ source /path/to/venv/bin/activate | ||
``` | ||
|
||
## Installing the library | ||
|
||
You can now use `pip` to install the library and its dependencies: | ||
|
||
``` | ||
$ python3 -m pip install pandablocks-ioc | ||
``` | ||
|
||
If you require a feature that is not currently released you can also install | ||
from github: | ||
|
||
``` | ||
$ python3 -m pip install git+https://github.com/PandABlocks/PandABlocks-ioc.git | ||
``` | ||
|
||
The library should now be installed and the commandline interface on your path. | ||
You can check the version that has been installed by typing: | ||
|
||
``` | ||
$ PandABlocks-ioc --version | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// @ts-check | ||
|
||
// Extra JS capability for selected tabs to be synced | ||
// The selection is stored in local storage so that it persists across page loads. | ||
|
||
/** | ||
* @type {Record<string, HTMLElement[]>} | ||
*/ | ||
let sd_id_to_elements = {}; | ||
const storageKeyPrefix = "sphinx-design-tab-id-"; | ||
|
||
/** | ||
* Create a key for a tab element. | ||
* @param {HTMLElement} el - The tab element. | ||
* @returns {[string, string, string] | null} - The key. | ||
* | ||
*/ | ||
function create_key(el) { | ||
let syncId = el.getAttribute("data-sync-id"); | ||
let syncGroup = el.getAttribute("data-sync-group"); | ||
if (!syncId || !syncGroup) return null; | ||
return [syncGroup, syncId, syncGroup + "--" + syncId]; | ||
} | ||
|
||
/** | ||
* Initialize the tab selection. | ||
* | ||
*/ | ||
function ready() { | ||
// Find all tabs with sync data | ||
|
||
/** @type {string[]} */ | ||
let groups = []; | ||
|
||
document.querySelectorAll(".sd-tab-label").forEach((label) => { | ||
if (label instanceof HTMLElement) { | ||
let data = create_key(label); | ||
if (data) { | ||
let [group, id, key] = data; | ||
|
||
// add click event listener | ||
// @ts-ignore | ||
label.onclick = onSDLabelClick; | ||
|
||
// store map of key to elements | ||
if (!sd_id_to_elements[key]) { | ||
sd_id_to_elements[key] = []; | ||
} | ||
sd_id_to_elements[key].push(label); | ||
|
||
if (groups.indexOf(group) === -1) { | ||
groups.push(group); | ||
// Check if a specific tab has been selected via URL parameter | ||
const tabParam = new URLSearchParams(window.location.search).get( | ||
group | ||
); | ||
if (tabParam) { | ||
console.log( | ||
"sphinx-design: Selecting tab id for group '" + | ||
group + | ||
"' from URL parameter: " + | ||
tabParam | ||
); | ||
window.sessionStorage.setItem(storageKeyPrefix + group, tabParam); | ||
} | ||
} | ||
|
||
// Check is a specific tab has been selected previously | ||
let previousId = window.sessionStorage.getItem( | ||
storageKeyPrefix + group | ||
); | ||
if (previousId === id) { | ||
// console.log( | ||
// "sphinx-design: Selecting tab from session storage: " + id | ||
// ); | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
} | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Activate other tabs with the same sync id. | ||
* | ||
* @this {HTMLElement} - The element that was clicked. | ||
*/ | ||
function onSDLabelClick() { | ||
let data = create_key(this); | ||
if (!data) return; | ||
let [group, id, key] = data; | ||
for (const label of sd_id_to_elements[key]) { | ||
if (label === this) continue; | ||
// @ts-ignore | ||
label.previousElementSibling.checked = true; | ||
} | ||
window.sessionStorage.setItem(storageKeyPrefix + group, id); | ||
} | ||
|
||
document.addEventListener("DOMContentLoaded", ready, false); |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.