Skip to content

Commit 551e18e

Browse files
authored
Merge pull request #105 from ISISComputingGroup/78-docs-make-classfunction-names-link-through-to-api-reference-more-consistently
78 docs make classfunction names link through to api reference more consistently
2 parents b667c4c + 4eb8fa6 commit 551e18e

File tree

12 files changed

+131
-95
lines changed

12 files changed

+131
-95
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Document Logging Callback
22

3-
The document logger is a callback that the BlueSky RunEngine subscribes to unconditionally. After receiving each document, if they share the same start document (in the same run) then it will write them to the same file. These logs are stored under `C:/instrument/var/logs/bluesky/raw_documents` and are handled by the log rotation.
3+
The [`document_logger`](ibex_bluesky_core.callbacks.document_logger) is a callback that the BlueSky RunEngine subscribes to unconditionally. After receiving each document, if they share the same start document (in the same run) then it will write them to the same file. These logs are stored under `C:/instrument/var/logs/bluesky/raw_documents` and are handled by the log rotation.
44

55
Each document is stored in a JSON format so can be both machine and human readable. It is in the format `{"type": name, "document": document}` whereby `name` is the type of the document, e.g start, stop, event, descriptor and the `document` is the [document from BlueSky in JSON format](https://blueskyproject.io/bluesky/main/documents.html). As these files are produced per BlueSky run, these will be useful for debugging.

doc/callbacks/file_writing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File writing callbacks
22
## Human readable files
33

4-
A callback (`HumanReadableFileCallback`) exists to write all documents to a separate human-readable file which contains the specified fields.
4+
A callback ([`HumanReadableFileCallback`](ibex_bluesky_core.callbacks.file_logger.HumanReadableFileCallback)) exists to write all documents to a separate human-readable file which contains the specified fields.
55

66
This callback will add units and honour precision for each field as well as add some metadata ie. the `uid` of each scan as well as the RB number, which is injected using the {doc}`/preprocessors/rbnumberpp`
77

doc/callbacks/plotting.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
# Plotting
22

33
Bluesky has good integration with `matplotlib` for data visualization, and data from scans
4-
may be easily plotted using the `LivePlot` callback.
4+
may be easily plotted using the [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) callback.
55

66
`ibex_bluesky_core` provides a thin wrapper over bluesky's default `LivePlot` callback,
77
which ensures that plots are promptly displayed in IBEX.
88

9-
In order to use the wrapper, import `LivePlot` from `ibex_bluesky_core` rather than
9+
In order to use the wrapper, import [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) from [`ibex_bluesky_core`](ibex_bluesky_core) rather than
1010
`bluesky` directly:
1111
```
1212
from ibex_bluesky_core.callbacks.plotting import LivePlot
1313
```
1414

1515
## Configuration
1616

17-
A range of configuration options for `LivePlot` are available - see the
17+
A range of configuration options for [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) are available - see the
1818
[bluesky `LivePlot` documentation](https://blueskyproject.io/bluesky/main/callbacks.html#bluesky.callbacks.mpl_plotting.LivePlot)
1919
for more details about available options.
2020

21-
The `LivePlot` object allows an arbitrary set of matplotlib `Axes` to be passed in, onto
21+
The [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) object allows an arbitrary set of matplotlib `Axes` to be passed in, onto
2222
which it will plot. This can be used to configure properties which are not directly exposed
23-
on the `LivePlot` object, for example log-scaled axes.
23+
on the [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) object, for example log-scaled axes.
2424

2525
See the [matplotlib `Axes` documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html)
2626
for a full range of options on how to configure an `Axes` object.
@@ -50,7 +50,7 @@ See [docs for `call_qt_aware`](../plan_stubs/matplotlib_helpers.md) for a descri
5050
`yield from call_qt_aware` rather than calling `matplotlib` functions directly.
5151
```
5252

53-
By providing a signal name to the `yerr` argument you can pass uncertainties to LivePlot, by not providing anything for this argument means that no errorbars will be drawn. Errorbars are drawn after each point collected, displaying their standard deviation- uncertainty data is collected from Bluesky event documents and errorbars are updated after every new point added.
53+
By providing a signal name to the `yerr` argument you can pass uncertainties to [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot), by not providing anything for this argument means that no errorbars will be drawn. Errorbars are drawn after each point collected, displaying their standard deviation- uncertainty data is collected from Bluesky event documents and errorbars are updated after every new point added.
5454

5555
The `plot_callback` object can then be subscribed to the run engine, using either:
5656
- An explicit callback when calling the run engine: `RE(some_plan(), plot_callback)`

doc/dev/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Logging
2-
To invoke the `ibex_bluesky_core` logger, create and use a `logger` object in [the standard way](https://docs.python.org/3/library/logging.html):
2+
To invoke the [`ibex_bluesky_core`](ibex_bluesky_core) logger, create and use a `logger` object in [the standard way](https://docs.python.org/3/library/logging.html):
33

44
```python
55
import logging

doc/devices/blocks.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Blocks are one of IBEX's central abstractions, which present a uniform interface to any
44
scientifically interesting PV.
55

6-
`ibex_bluesky_core` has support for four types of blocks:
6+
[`ibex_bluesky_core`](ibex_bluesky_core) has support for four types of blocks:
77
- Read-only
88
- Read/write
99
- Read/write with setpoint readback
@@ -25,7 +25,7 @@ mot: NotConnected:
2525

2626
## Block types
2727

28-
### `block_r` (read-only)
28+
### [`block_r`](ibex_bluesky_core.devices.block.block_r) (read-only)
2929

3030
This is a read-only block. It supports `bluesky`'s `Readable` protocol, as well as
3131
basic metadata protocols such as `HasName`.
@@ -35,20 +35,20 @@ This type of block is usable by:
3535
- Plan stubs like `bluesky.plan_stubs.rd()`, which plans may use to get the current value
3636
of a block easily for use in the plan.
3737

38-
A `BlockR` object does not implement any logic on read - it simply returns the most recent
38+
A [`BlockR`](ibex_bluesky_core.devices.block.BlockR) object does not implement any logic on read - it simply returns the most recent
3939
value of the block.
4040

41-
A simple constructor, `block_r`, is available, which assumes the current instrument's PV
41+
A simple constructor, [`block_r`](ibex_bluesky_core.devices.block.block_r), is available, which assumes the current instrument's PV
4242
prefix:
4343

4444
```python
4545
from ibex_bluesky_core.devices.block import block_r
4646
readable_block = block_r(float, "my_block_name")
4747
```
4848

49-
### `block_rw` (read, write)
49+
### [`block_rw`](ibex_bluesky_core.devices.block.block_rw) (read, write)
5050

51-
This is a read-write block. It supports all of the same protocols as `BlockR`, with the
51+
This is a read-write block. It supports all of the same protocols as [`BlockR`](ibex_bluesky_core.devices.block.BlockR), with the
5252
addition of the `Movable` protocol.
5353

5454
The addition of the movable protocol means that this type of block can be moved by plan
@@ -65,7 +65,7 @@ It can also be used as the `Movable` in full plans like `bluesky.plans.scan()`.
6565
are not motors, even if the documentation tends to use motors as the examples.
6666
```
6767

68-
Like `block_r`, a simple constructor is available:
68+
Like [`block_r`](ibex_bluesky_core.devices.block.block_r), a simple constructor is available:
6969

7070
```python
7171
from ibex_bluesky_core.devices.block import block_rw, BlockWriteConfig
@@ -79,9 +79,9 @@ writable_block = block_rw(
7979
```
8080

8181

82-
### `block_rw_rbv` (read, write, setpoint readback)
82+
### [`block_rw_rbv`](ibex_bluesky_core.devices.block.block_rw_rbv) (read, write, setpoint readback)
8383

84-
This is a block with full support for reading and writing as per `BlockRw`, but with
84+
This is a block with full support for reading and writing as per [`BlockRw`](ibex_bluesky_core.devices.block.BlockRw), but with
8585
the addition of `bluesky`'s `Locatable` protocol, which allows you to read back the
8686
current setpoint. Where possible, the setpoint will be read back from hardware.
8787

@@ -91,7 +91,7 @@ This object is also more suitable for use in plans which use relative moves - th
9191
relative move will be calculated with respect to the setpoint readback from hardware
9292
(if available).
9393

94-
Just like `block_rw`, a simple constructor is available:
94+
Just like [`block_rw`](ibex_bluesky_core.devices.block.block_rw), a simple constructor is available:
9595

9696
```python
9797
from ibex_bluesky_core.devices.block import block_rw_rbv, BlockWriteConfig
@@ -104,7 +104,7 @@ rw_rbv_block = block_rw_rbv(
104104
)
105105
```
106106

107-
### `block_mot` (motor-specific)
107+
### [`block_mot`](ibex_bluesky_core.devices.block.block_mot) (motor-specific)
108108

109109
This represents a block pointing at a motor record. This has support for:
110110
- Reading (`Readable`)
@@ -123,7 +123,7 @@ the plan is executed against hardware.
123123
`Stoppable` means that the motor can be asked to stop by bluesky. Plans may choose to execute
124124
a `stop()` on failure, or explicitly during a plan.
125125

126-
A `block_mot` can be made in a similar way to the other block types; however, it does not
126+
A [`block_mot`](ibex_bluesky_core.devices.block.block_mot) can be made in a similar way to the other block types; however, it does not
127127
require an explicit type as motors are always of `float` data type:
128128

129129
```python
@@ -132,20 +132,20 @@ mot_block = block_mot("motor_block")
132132
```
133133

134134
A motor block does not need an explicit write config: it always waits for the requested motion
135-
to complete. See {py:obj}`ibex_bluesky_core.devices.block.BlockMot` for a detailed mapping of
135+
to complete. See [`BlockMot`](ibex_bluesky_core.devices.block.BlockMot) for a detailed mapping of
136136
the usual write-configuration options and how these are instead achieved by a motor block.
137137

138138
## Configuring block write behaviour
139139

140-
`BlockRw` and `BlockRwRbv` both take a `write_config` argument, which can be used to configure
140+
[`BlockRw`](ibex_bluesky_core.devices.block.BlockRw) and [`BlockRwRbv`](ibex_bluesky_core.devices.block.BlockRwRbv) both take a `write_config` argument, which can be used to configure
141141
the behaviour on writing to a block, for example tolerances and settle times.
142142

143-
See {py:class}`ibex_bluesky_core.devices.block.BlockWriteConfig` for a detailed
143+
See [`BlockWriteConfig`](ibex_bluesky_core.devices.block.BlockWriteConfig) for a detailed
144144
description of all the options which are available.
145145

146-
## Run control
146+
## Run Control
147147

148-
Run control information is available via the `block.run_control` sub-device.
148+
[`RunControl`](ibex_bluesky_core.devices.block.RunControl) information is available via the [`block.RunControl`](ibex_bluesky_core.devices.block.RunControl) sub-device.
149149

150150
Both configuring and reading the current status of run control are permitted.
151151

0 commit comments

Comments
 (0)