Skip to content

Commit

Permalink
Black, isort, and flake8.
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko committed Oct 16, 2024
1 parent ac434db commit 626bbd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/ophydregistry/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,10 @@ def __new__wrapper(self, cls, *args, **kwargs):
return obj

def register(
self, component: ophydobj.OphydObject, labels: Optional[Sequence] = None, warn_duplicates=True
self,
component: ophydobj.OphydObject,
labels: Optional[Sequence] = None,
warn_duplicates=True,
) -> ophydobj.OphydObject:
"""Register a device, component, etc so that it can be retrieved later.
Expand Down
8 changes: 5 additions & 3 deletions src/ophydregistry/tests/test_instrument_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import pytest
from ophyd import Device, EpicsMotor, sim
from ophyd_async.core import Device as AsyncDevice, soft_signal_rw
from ophyd_async.core import Device as AsyncDevice
from ophyd_async.core import soft_signal_rw

from ophydregistry import ComponentNotFound, MultipleComponentsFound, Registry

Expand Down Expand Up @@ -146,11 +147,12 @@ def test_find_component(registry):

def test_find_async_children(registry):
"""Check that the child components of an async device get registered."""

class MyDevice(AsyncDevice):
def __init__(self, name):
self.signal = soft_signal_rw()
super().__init__(name=name)

device = MyDevice(name="m1")
registry.register(device)
assert registry.find(device.signal.name) is device.signal
Expand Down Expand Up @@ -411,7 +413,7 @@ def test_duplicate_device(caplog, registry):
# Check that the warning is only issued for the top-level device, not all its children
assert "motor_user_setpoint" not in caplog.text
# Check that the correct second device is the one that wound up in the registry
assert registry['motor'] is motor2
assert registry["motor"] is motor2


def test_delete_by_name(registry):
Expand Down

0 comments on commit 626bbd3

Please sign in to comment.