Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
87767c3
move fitting callbacks into fitting.__init__
rerpha Apr 2, 2025
e30388d
move fitmethod into fitting_utils(to be moved)
rerpha Apr 2, 2025
82e67c8
move fit methods out to own module
rerpha Apr 2, 2025
44e7e4d
fix sphinx?
rerpha Apr 2, 2025
fab25e4
sort out callbacks
rerpha Apr 2, 2025
d53d0b0
Merge branch 'main' into consolidate_imports
rerpha Apr 2, 2025
2fabfb8
fix some sphinx warnings
rerpha Apr 2, 2025
fb4c2d2
Merge branch 'consolidate_imports' of https://github.com/ISISComputin…
rerpha Apr 2, 2025
6ff0a0a
add doc logging callback to callbacks.all
rerpha Apr 2, 2025
f49cc5e
sphinx
rerpha Apr 2, 2025
23775df
break absolutely everything
rerpha Apr 2, 2025
812cf2b
more breaking - expose dae low level controls to dae module
rerpha Apr 2, 2025
93b98c9
get tests working again
rerpha Apr 2, 2025
c651c3d
add missing bits for dae settings etc
rerpha Apr 2, 2025
ba193c0
more things exposed in simpledae
rerpha Apr 2, 2025
5a3c4ce
sphinx
rerpha Apr 2, 2025
7e14257
Merge branch 'main' into consolidate_imports
rerpha Apr 2, 2025
847e834
always use top-level imports except where needed (_reducers and _cont…
rerpha Apr 2, 2025
339bc33
Merge branch 'consolidate_imports' of https://github.com/ISISComputin…
rerpha Apr 2, 2025
8844add
Merge branch 'main' into consolidate_imports
rerpha Apr 3, 2025
1488454
Merge branch 'main' into consolidate_imports
rerpha Apr 8, 2025
d215587
fix sphinx
rerpha Apr 9, 2025
affe211
Merge remote-tracking branch 'origin/main' into consolidate_imports
rerpha Apr 14, 2025
656dac7
review comments
rerpha Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/callbacks/docs_logging_callback.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Document Logging Callback

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.
The [`DocLoggingCallback`](ibex_bluesky_core.callbacks.DocLoggingCallback) 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.

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.
2 changes: 1 addition & 1 deletion doc/callbacks/file_writing.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# File writing callbacks
## Human readable files

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.
A callback ([`HumanReadableFileCallback`](ibex_bluesky_core.callbacks.HumanReadableFileCallback)) exists to write all documents to a separate human-readable file which contains the specified fields.

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`

Expand Down
14 changes: 7 additions & 7 deletions doc/callbacks/plotting.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Plotting

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

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

In order to use the wrapper, import [`LivePlot`](ibex_bluesky_core.callbacks.plotting.LivePlot) from [`ibex_bluesky_core`](ibex_bluesky_core) rather than
In order to use the wrapper, import [`LivePlot`](ibex_bluesky_core.callbacks.LivePlot) from [`ibex_bluesky_core`](ibex_bluesky_core) rather than
`bluesky` directly:
```
from ibex_bluesky_core.callbacks.plotting import LivePlot
```

## Configuration

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

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

See the [matplotlib `Axes` documentation](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html)
for a full range of options on how to configure an `Axes` object.
Expand All @@ -30,7 +30,7 @@ to plot a scan with a logarithmically-scaled y-axis:

```python
import matplotlib.pyplot as plt
from ibex_bluesky_core.callbacks.plotting import LivePlot
from ibex_bluesky_core.callbacks import LivePlot
from ibex_bluesky_core.plan_stubs import call_qt_aware

def plan():
Expand All @@ -50,7 +50,7 @@ See [docs for `call_qt_aware`](../plan_stubs/matplotlib_helpers.md) for a descri
`yield from call_qt_aware` rather than calling `matplotlib` functions directly.
```

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.
By providing a signal name to the `yerr` argument you can pass uncertainties to [`LivePlot`](ibex_bluesky_core.callbacks.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.

The `plot_callback` object can then be subscribed to the run engine, using either:
- An explicit callback when calling the run engine: `RE(some_plan(), plot_callback)`
Expand Down
6 changes: 3 additions & 3 deletions doc/dev/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ Scientist-facing output files are written to `<isis share>\inst$\NDX<inst>\user\
default.

Custom file-output paths can be specified by passing extra arguments to
{py:obj}`HumanReadableFileCallback<ibex_bluesky_core.callbacks.file_logger.HumanReadableFileCallback>`
{py:obj}`HumanReadableFileCallback<ibex_bluesky_core.callbacks.HumanReadableFileCallback>`
for the "human-readable" files, or
{py:obj}`LiveFitLogger<ibex_bluesky_core.callbacks.fitting.livefit_logger.LiveFitLogger>`
{py:obj}`LiveFitLogger<ibex_bluesky_core.callbacks.LiveFitLogger>`
for the fit output files. These callbacks may be hidden behind
{py:obj}`ISISCallbacks<ibex_bluesky_core.callbacks.ISISCallbacks>` which also allows specifying output paths.

Expand All @@ -62,7 +62,7 @@ Raw documents emitted by bluesky are stored in `C:\Instrument\Var\logs\bluesky\r
data emitted by bluesky scans. The filenames in this directory correspond to bluesky's scan ID, which is printed to
the console at the end of each scan, and is also included as metadata in the scientist-facing output files.

These files are written by {py:obj}`ibex_bluesky_core.callbacks.document_logger.DocLoggingCallback`, which is subscribed
These files are written by {py:obj}`ibex_bluesky_core.callbacks.DocLoggingCallback`, which is subscribed
to the run engine by default in {py:obj}`ibex_bluesky_core.run_engine.get_run_engine`.

```{note}
Expand Down
Loading