Releases: bluesky/ophyd-async
v0.8.0a4
v0.8.0a3
What's Changed
- Windows: fix unit tests & enable CI by @Tom-Willemsen in #633
- Declarative EPICS and StandardReadable Devices by @coretl in #598
Changes
pvi structure changes
Structure read from .value
now includes DeviceVector
support. Requires at least PandABlocks-ioc 0.11.2
Epics signal
module moves
ophyd_async.epics.signal
moves to ophyd_async.epics.core
with a backwards compat module that emits deprecation warning.
# old
from ophyd_async.epics.signal import epics_signal_rw
# new
from ophyd_async.epics.core import epics_signal_rw
StandardReadable
wrappers change to StandardReadableFormat
StandardReadable
wrappers change to enum members of StandardReadableFormat
(normally imported as Format
)
# old
from ophyd_async.core import ConfigSignal, HintedSignal
class MyDevice(StandardReadable):
def __init__(self):
self.add_readables([sig1], ConfigSignal)
self.add_readables([sig2], HintedSignal)
self.add_readables([sig3], HintedSignal.uncached)
# new
from ophyd_async.core import StandardReadableFormat as Format
class MyDevice(StandardReadable):
def __init__(self):
self.add_readables([sig1], Format.CONFIG_SIGNAL)
self.add_readables([sig2], Format.HINTED_SIGNAL)
self.add_readables([sig3], Format.HINTED_UNCACHED_SIGNAL
Declarative Devices are now available
# old
from ophyd_async.core import ConfigSignal, HintedSignal
from ophyd_async.epics.signal import epics_signal_r, epics_signal_rw
class Sensor(StandardReadable):
def __init__(self, prefix: str, name="") -> None:
with self.add_children_as_readables(HintedSignal):
self.value = epics_signal_r(float, prefix + "Value")
with self.add_children_as_readables(ConfigSignal):
self.mode = epics_signal_rw(EnergyMode, prefix + "Mode")
super().__init__(name=name)
# new
from typing import Annotated as A
from ophyd_async.core import StandardReadableFormat as Format
from ophyd_async.epics.core import EpicsDevice, PvSuffix, epics_signal_r, epics_signal_rw
class Sensor(StandardReadable, EpicsDevice):
value: A[SignalR[float], PvSuffix("Value"), Format.HINTED_SIGNAL]
mode: A[SignalRW[EnergyMode], PvSuffix("Mode"), Format.CONFIG_SIGNAL]
Full Changelog: v0.8.0a2...v0.8.0a3
v0.8.0a2
What's Changed
- Allow CA/PVA mismatching enums to be bools by @coretl in #632
- Allow shared parent mock to be passed to Device.connect by @jsouter in #599
- Report Device name in error when using AsyncStatus.wrap by @jsouter in #607
- Temporary fix for PyPI publishing by @coretl in #634
Full Changelog: v0.8.0a1...v0.8.0a2
v0.8.0a1
What's Changed
- Add test for context race condition by @DominicOram in #600
- New signal typing by @coretl in #594
- Update copier template to 2.4.0 by @coretl in #628
- Logo by @coretl in #629
Breaking changes
pvi structure changes
Structure now read from .value
rather than .pvi
. Supported in FastCS. Requires at least PandABlocks-ioc 0.10.0
StrictEnum
is now requried for all strictly checked Enums
# old
from enum import Enum
class MyEnum(str, Enum):
ONE = "one"
TWO = "two"
# new
from ophyd_async.core import StrictEnum
class MyEnum(StrictEnum):
ONE = "one"
TWO = "two"
SubsetEnum
is now an Enum
subclass:
from ophyd_async.core import SubsetEnum
# old
MySubsetEnum = SubsetEnum["one", "two"]
# new
class MySubsetEnum(SubsetEnum):
ONE = "one"
TWO = "two"
Use python primitives for scalar types instead of numpy types
# old
import numpy as np
x = epics_signal_rw(np.int32, "PV")
# new
x = epics_signal_rw(int, "PV")
Use Array1D
for 1D arrays instead of npt.NDArray
import numpy as np
# old
import numpy.typing as npt
x = epics_signal_rw(npt.NDArray[np.int32], "PV")
# new
from ophyd_async.core import Array1D
x = epics_signal_rw(Array1D[np.int32], "PV")
Use Sequence[str]
for arrays of strings instead of npt.NDArray[np.str_]
import numpy as np
# old
import numpy.typing as npt
x = epics_signal_rw(npt.NDArray[np.str_], "PV")
# new
from collections.abc import Sequence
x = epics_signal_rw(Sequence[str], "PV")
MockSignalBackend
requires a real backend
# old
fake_set_signal = SignalRW(MockSignalBackend(float))
# new
fake_set_signal = soft_signal_rw(float)
await fake_set_signal.connect(mock=True)
get_mock_put
is no longer passed timeout as it is handled in Signal
# old
get_mock_put(driver.capture).assert_called_once_with(Writing.ON, wait=ANY, timeout=ANY)
# new
get_mock_put(driver.capture).assert_called_once_with(Writing.ON, wait=ANY)
super().__init__
required for Device
subclasses
# old
class MyDevice(Device):
def __init__(self, name: str = ""):
self.signal, self.backend_put = soft_signal_r_and_setter(int)
# new
class MyDevice(Device):
def __init__(self, name: str = ""):
self.signal, self.backend_put = soft_signal_r_and_setter(int)
super().__init__(name=name)
Arbitrary BaseModel
s not supported, pending use cases for them
The Table
type has been suitable for everything we have seen so far, if you need an arbitrary BaseModel
subclass then please make an issue
Child Device
s set parent on attach, and can't be public children of more than one parent
class SourceDevice(Device):
def __init__(self, name: str = ""):
self.signal = soft_signal_rw(int)
super().__init__(name=name)
# old
class ReferenceDevice(Device):
def __init__(self, signal: SignalRW[int], name: str = ""):
self.signal = signal
super().__init__(name=name)
def set(self, value) -> AsyncStatus:
return self.signal.set(value + 1)
# new
from ophyd_async.core import Reference
class ReferenceDevice(Device):
def __init__(self, signal: SignalRW[int], name: str = ""):
self._signal_ref = Reference(signal)
super().__init__(name=name)
def set(self, value) -> AsyncStatus:
return self._signal_ref().set(value + 1)
Full Changelog: v0.7.0...v0.8.0a1
v0.7.0
What's Changed
- fixed typos by @ZohebShaikh in #589
- Make table subclass enums be sequence enum rather than numpy string by @evalott100 in #579
- Reset completed iterations counter to 0 once target iterations are reached and detector is disarmed by @jwlodek in #590
- Simplify ad standard det tests by @jwlodek in #592
- Remove config sigs kwarg from flyer since use case for them was unclear. by @jwlodek in #593
- added number_of_frames instead of iterations by @ZohebShaikh in #581
- Rename core classes by @abbiemery in #577
- Tango support by @burkeds in #437
- add Capture mode signal to Panda DataBlock by @jsouter in #604
- with DeviceCollector doesn't work in plans, so error rather than hang by @coretl in #612
New Contributors
Full Changelog: v0.6.0...v0.7.0
v0.7.0a1
What's Changed
- fixed typos by @ZohebShaikh in #589
- Make table subclass enums be sequence enum rather than numpy string by @evalott100 in #579
- Reset completed iterations counter to 0 once target iterations are reached and detector is disarmed by @jwlodek in #590
- Simplify ad standard det tests by @jwlodek in #592
- Remove config sigs kwarg from flyer since use case for them was unclear. by @jwlodek in #593
- added number_of_frames instead of iterations by @ZohebShaikh in #581
- Rename core classes by @abbiemery in #577
- Tango support by @burkeds in #437
New Contributors
Full Changelog: v0.6.0...v0.7.0a1
v0.6.0
What's Changed
- Print warning if DATASETS table is empty on PandA writer open by @jwlodek in #558
- 539 put mock should be async by @DominicOram in #559
- Update signature of init for simdetector to match other detector classes by @jwlodek in #563
- Extend sleep time to avoid race condition by @coretl in #566
- Introduce PvaAbstractions and use them in SeqTable by @evalott100 in #522
- Use asyncio TimeoutError in wait_for_value by @DominicOram in #573
- Interface change of StandardDetector and Standard Controller by @ZohebShaikh in #568
- Added a fixtures that checks if tasks are still running in tests by @evalott100 in #538
- Update to copier template 2.3.0 by @coretl in #580
- Fix typo by @jwlodek in #588
- Use name provider instead of hdf name when calling path provider in ADHDFWriter by @jwlodek in #587
- Add asyncio_default_fixture_loop_scope variable to pytest.ini to avoid deprecation warning by @jwlodek in #584
- Include chunk shape as a parameter in stream resource for HDF dataset by @jwlodek in #544
Full Changelog: 0.5.2...v0.6.0
0.5.2
What's Changed
- Stop prepare setting negative velocity by @Relm-Arrowny in #552
- Fastcs eiger support by @DominicOram in #528
- Add no op status by @olliesilvester in #540
- Make np_datatype property of ShapeProvider rather than final axis by @DiamondJoseph in #555
Full Changelog: 0.5.1...0.5.2
0.5.1
What's Changed
- Bump softprops/action-gh-release from 2.0.6 to 2.0.8 in the actions group by @dependabot in #474
- Adding sub electron readout mode for the kinetix by @jwlodek in #469
- Remove references to root in PathInfo, PathProvider by @jwlodek in #477
- Add ruff SLF001 by @abbiemery in #483
- Rename panda files by @abbiemery in #486
- Create logfile in temporary path instead of project root by @jwlodek in #489
- 314 defer creation of hdf5 file until preparetrigger by @ZohebShaikh in #466
- 282-standardise-handling-of-read-config-and-hinted-signals-for-standarddetector by @ZohebShaikh in #468
- Fix race condition in set_and_wait_for_value by @DominicOram in #457
- Tests for AreaDetector drivers/plugins to insure attributes are regularly named by @subinsaji in #490
- AD HDF plugin should set directory creation value before path by @jwlodek in #497
- added support for str by @ZohebShaikh in #499
- NDStats docs update by @ZohebShaikh in #500
- Resolving issues preventing connection with areaDetector device by @jwlodek in #514
- Only pass data block to init of PandAHDFWriter instead of entire PandA device by @jwlodek in #512
- Allow precision 0 float records to be represented as int signals by @olliesilvester in #509
- Setup PandA writer to set create directory depth PV on open by @jwlodek in #503
- move h5py into real dependencies by @stan-dot in #511
- Use 'boolean' rather than 'bool' dtype per event-model by @Tom-Willemsen in #517
- Allow equality comparisons for signal by @Tom-Willemsen in #524
- Update make-a-simple-device.rst to include numpy array example by @rerpha in #515
- make motor locatable by @stan-dot in #541
- Small fix of typo in variable name in AD attributes HDF writer by @jwlodek in #545
- Make FilenameProvider optional on PathProvider impl by @DiamondJoseph in #547
New Contributors
Full Changelog: v0.5.0...0.5.1
v0.5.0
What's Changed
- Fix motor run up distance by @olliesilvester in #455
- Set motor to start max velocity at start by @subinsaji in #464
- Restructure repository to solidify public interface and document it by @coretl in #26
- Restructure on ADR 2.0 by @abbiemery in #467
Full Changelog: v0.4.0...v0.5.0