{"id":24177,"library":"ophyd","title":"ophyd","description":"Ophyd is a hardware abstraction library for the Bluesky framework with an emphasis on EPICS. It provides a device-oriented API for control system signals, motors, area detectors, and more. Currently at version 1.11.1, it is under active development with regular releases. Requires Python >=3.8.","status":"active","version":"1.11.1","language":"python","source_language":"en","source_url":"https://github.com/bluesky/ophyd","tags":["bluesky","epics","hardware-abstraction","control-system","synchrotron"],"install":[{"cmd":"pip install ophyd","lang":"bash","label":"Install from PyPI"},{"cmd":"conda install -c conda-forge ophyd","lang":"bash","label":"Install via conda"}],"dependencies":[{"reason":"EPICS channel access for PyEpics backend","package":"epics-base","optional":true},{"reason":"Required for EPICS PV communication unless using caproto or simulated signals","package":"pyepics","optional":true},{"reason":"Alternative EPICS CA backend","package":"caproto","optional":true},{"reason":"Array support for signals","package":"numpy","optional":false}],"imports":[{"note":"Simple EPICS PV signal","symbol":"EpicsSignal","correct":"from ophyd import EpicsSignal"},{"note":"EPICS motor record device","symbol":"EpicsMotor","correct":"from ophyd import EpicsMotor"},{"note":"Base class for composite devices","symbol":"Device","correct":"from ophyd import Device"},{"note":"Base signal class for internal or simulated signals","symbol":"Signal","correct":"from ophyd import Signal"},{"note":"Component is re-exported at top-level; importing from ophyd.device is deprecated.","wrong":"from ophyd.device import Component","symbol":"Component","correct":"from ophyd import Component"},{"note":"Same as Component; prefer top-level import.","wrong":"from ophyd.device import DynamicDeviceComponent","symbol":"DynamicDeviceComponent","correct":"from ophyd import DynamicDeviceComponent"}],"quickstart":{"code":"from ophyd import EpicsSignal, EpicsMotor\nfrom ophyd import Component, Device\n\n# Create a simple EPICS signal\nsig = EpicsSignal('MYPV:PREFIX', name='my_signal')\nsig.wait_for_connection()\nprint(sig.get())\n\n# Create a motor\nmotor = EpicsMotor('MYMOTOR:PREFIX', name='my_motor')\nmotor.wait_for_connection()\nprint(motor.user_readback.get())\n\n# Define a composite device\nclass MyDevice(Device):\n    x = Component(EpicsMotor, 'X')\n    y = Component(EpicsMotor, 'Y')\n    detector = Component(EpicsSignal, 'Det')\n\ndev = MyDevice('MYDEV:', name='my_device')\ndev.wait_for_connection()\nprint(dev.detector.get())","lang":"python","description":"Basic usage: create an EPICS signal and motor, define a composite device with Components, and wait for connections."},"warnings":[{"fix":"Review migration notes at https://blueskyproject.io/ophyd/upcoming-changes.html","message":"Inophyd v1.10.0, the EPICS backend API changed. Fallback backends are now class-based instead of function-based. Code using custom backends may need updates.","severity":"breaking","affected_versions":">=1.10.0"},{"fix":"Use Signal.set() with await or status events instead.","message":"The function 'set_and_wait' is deprecated since v1.7.0 and may be removed in future releases.","severity":"deprecated","affected_versions":">=1.7.0"},{"fix":"Set 'wait_for_connection=False' and check connection status manually, or increase timeout via timeout kwarg.","message":"EpicsSignal and EpicsMotor require a connection to the EPICS PV. If the PV does not exist, connecting will block until timeout (default 2.0 seconds in v1.10.5+).","severity":"gotcha","affected_versions":"all"},{"fix":"Adjust code to handle updated fraction value.","message":"DeviceStatus reports a fraction of 1.0 once complete as of v1.7.0. Code relying on a fraction of 0.0 after completion will break.","severity":"gotcha","affected_versions":">=1.7.0, <1.7.0? earlier versions had 0.0? Actually v1.7.0 changed to 1.0."},{"fix":"No direct breakage, but import ordering may require changes if using strict flake8 or isort checks.","message":"In v1.8.0, isort was adopted; imports may need reorganization. Also, setuptools-scm replaced manual versioning.","severity":"breaking","affected_versions":">=1.8.0"},{"fix":"Replace 'from ophyd import user_v2' with direct imports from ophyd.","message":"The 'user_v2' module is removed as of v1.10.0. Use the standard 'ophyd' API instead.","severity":"deprecated","affected_versions":">=1.10.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install pyepics or conda install -c conda-forge pyepics","cause":"Missing PyEpics package for EPICS communication.","error":"ModuleNotFoundError: No module named 'epics'"},{"fix":"Verify PV exists and network is reachable. Increase timeout via 'timeout' parameter in EpicsSignal(..., timeout=10).","cause":"EPICS PV not available or network issue.","error":"TimeoutError: Connection to PV '...' timed out after 2.00 seconds"},{"fix":"Use 'from ophyd import Component'","cause":"Direct import from internal module instead of top-level.","error":"ImportError: cannot import name 'Component' from 'ophyd.device'"},{"fix":"Replace with 'signal.set(value)' and use status objects or await.","cause":"Deprecated function removed or renamed.","error":"AttributeError: 'EpicsSignal' object has no attribute 'set_and_wait'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}