Skip to content

Releases: bluesky/ophyd-async

v0.15

03 Feb 14:57
6ebd5ae

Choose a tag to compare

Notable changes

Remove the wait argument to Signal.set, it is now set when constructing the EPICS Signal.

It can be one of:

  • True: Return when server-side operation has completed
  • False: Return when server-side operation has started
  • callable: Call with the value being put to decide whether to wait

For procedural style devices:

# old
signal = epics_signal_rw(int, "PV")
signal.set(5, wait=False)

# new
signal = epics_signal_rw(int, "PV", wait=False)
signal.set(5)

For declarative style devices:

# old
from ophyd_async.epics.core import PvSuffix

class MyDevice(EpicsDevice):
    signal: A[SignalRW[int], PvSuffix("SUFF")]

my_device.signal.set(5, wait=False)

# new
from ophyd_async.epics.core import PvSuffix, EpicsOptions

class MyDevice(EpicsDevice):
    signal: A[SignalRW[int], PvSuffix("SUFF"), EpicsOptions(wait=False)]

my_device.signal.set(5)

If you need a different value for wait depending on the value you are setting, like for the busy record:

# old
busy_record_signal = epics_signal_rw(bool, "Acquire")
status = busy_record_signal.set(True, wait=True)
busy_record_signal.set(False, wait=False)
await status

# new
from ophyd_async.core import non_zero

busy_record_signal = epics_signal_rw(bool, "Acquire", wait=non_zero)
status = busy_record_signal.set(True)
busy_record_signal.set(False)
await status

Any usage of wait=True (the default) can be removed without any other changes

# old
await signal.set(value, wait=True)  # wait=True is the default

# new
await signal.set(value)

AsyncStatus can be used as a context manager

This avoids issues with dangling tasks at shutdown, and allows more complex logic to be cancelled by a signal set completion.

# old
status = signal1.set(new_value)
async for value in observe_value(signal2, done_status=status):
    if value > threshold:
        break
# warning here if we exit before signal1.set completes

# new
async with signal1.set(new_value):
    async for value in observe_value(signal2):
        if value > threshold:
            break

What's Changed

Full Changelog: v0.14.2...v0.15

v0.14.2

19 Dec 11:19
a221add

Choose a tag to compare

What's Changed

Full Changelog: v0.14.1...v0.14.2

v0.14.1

18 Dec 11:18
9b567b2

Choose a tag to compare

What's Changed

Full Changelog: v0.14.0...v0.14.1

v0.14.0

24 Nov 14:46
3da44d6

Choose a tag to compare

Notable Changes

Helper functions for downstream testing have moved

The following functions:

  • callback_on_mock_put
  • get_mock
  • get_mock_put
  • mock_puts_blocked
  • set_mock_put_proceeds
  • set_mock_value
  • set_mock_values

Have been moved from ophyd_async.testing to ophyd_async.core. They can currently be imported from either but will cause a DeprecationWarning if imported from ophyd_async.testing. The move will be finalised in version 1.0.

What's Changed

New Contributors

Full Changelog: v0.13.7...v0.14.0

v0.13.7

17 Nov 14:50
80ae448

Choose a tag to compare

What's Changed

Full Changelog: v0.13.6...v0.13.7

v0.13.6

04 Nov 09:00
13f67ee

Choose a tag to compare

What's Changed

Full Changelog: v0.13.5...v0.13.6

v0.13.5

27 Oct 12:29
bb7c989

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.4...v0.13.5

v0.13.4

06 Oct 14:48
b42c37b

Choose a tag to compare

What's Changed

Full Changelog: v0.13.3...v0.13.4

v0.13.3

19 Sep 10:15
abcdf59

Choose a tag to compare

What's Changed

Full Changelog: v0.13.2...v0.13.3

v0.13.2

10 Sep 12:09
c5aa76f

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.13.1...v0.13.2