Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to work with ophyd-registry v2.0.0 #371

Merged
merged 2 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ dependencies:
- autoapi
- pytest-mongodb
- StrEnum
- ophyd-registry >= 1.3.3
- ophyd-registry >= 2.0.0rc1
- guarneri >= 0.2.0
- xraydb >=4.5.0
- pytest-timeout # Get rid of this if tests are not hanging
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers = [
keywords = ["synchrotron", "xray", "bluesky"]
dependencies = ["aioca", "aiokafka", "bluesky", "ophyd", "ophyd-async>=0.9.0a1", "apsbss", "xraydb",
"mergedeep", "xrayutilities", "bluesky-queueserver-api", "tomlkit",
"apstools", "ophyd-registry", "caproto", "pcdsdevices",
"apstools", "ophyd-registry>=2.0.0rc1", "caproto", "pcdsdevices",
"bluesky-adaptive", "tiled[client]", "guarneri>=0.2.0"]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/haven/ipython_startup.ipy
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ print(f"Connected to {num_devices} devices in {time.monotonic() - t0:.2f} second
# Save references to all the devices in the global namespace
devices = haven.beamline.devices
ion_chambers = devices.findall("ion_chambers", allow_none=True)
for cpt in devices._objects_by_name.values():
for cpt in devices.all_devices:
# Replace spaces and other illegal characters in variable name
name = haven.sanitize_name(cpt.name)
# Add the device as a variable in module's globals
Expand Down
2 changes: 1 addition & 1 deletion src/haven/motor_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def save_motor_position(*motors, name: str, md: Mapping = {}):

"""
# Resolve device names or labels
motors = beamline.devices.findall(motors)
motors = [beamline.devices[motor] for motor in motors]
# Create the new run object
_md = {
"position_name": name,
Expand Down
10 changes: 1 addition & 9 deletions src/haven/tests/test_instrument_registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from ophyd import Device, EpicsMotor, sim
from ophyd import Device, sim
from ophydregistry import Registry

from haven.exceptions import ComponentNotFound, MultipleComponentsFound
Expand Down Expand Up @@ -255,14 +255,6 @@ def test_find_by_list_of_names(reg):
assert cptC not in result


def test_user_readback(reg):
"""Edge case where EpicsMotor.user_readback is named the same as the motor itself."""
device = EpicsMotor("", name="epics_motor")
reg.register(device)
# See if requesting the device.user_readback returns the proper signal
reg["epics_motor_user_readback"]


# -----------------------------------------------------------------------------
# :author: Mark Wolfman
# :email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion src/queueserver/queueserver_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
call_in_bluesky_event_loop(beamline.connect())
except NotConnected as exc:
log.exception(exc)
for cpt in beamline.devices._objects_by_name.values():
for cpt in beamline.devices.all_devices:
# Replace spaces and other illegal characters in variable name
# name = re.sub('\W|^(?=\d)','_', cpt.name)
name = sanitize_name(cpt.name)
Expand Down