From 7a81b4676e20d6954e2ba6bf074c6fbb2e8d35d0 Mon Sep 17 00:00:00 2001 From: wakonig_k Date: Sun, 22 Mar 2026 19:13:19 +0100 Subject: [PATCH] fix: typos --- ophyd_devices/devices/areadetector/plugins.py | 2 +- ophyd_devices/devices/dxp.py | 4 ++-- ophyd_devices/devices/panda_box/README.md | 2 +- ophyd_devices/devices/panda_box/panda_box.py | 2 +- ophyd_devices/interfaces/base_classes/bec_device_base.py | 6 +++--- .../interfaces/base_classes/ophyd_rotation_base.py | 6 +++--- ophyd_devices/interfaces/protocols/bec_protocols.py | 8 ++++---- ophyd_devices/sim/sim_camera.py | 2 +- ophyd_devices/sim/sim_data.py | 2 +- ophyd_devices/sim/sim_flyer.py | 4 ++-- ophyd_devices/sim/sim_frameworks/device_proxy.py | 3 +-- ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py | 2 +- ophyd_devices/sim/sim_frameworks/slit_proxy.py | 2 +- ophyd_devices/sim/sim_monitor.py | 2 +- ophyd_devices/sim/sim_positioner.py | 6 +++--- ophyd_devices/sim/sim_signals.py | 2 +- ophyd_devices/sim/sim_waveform.py | 2 +- ophyd_devices/utils/socket.py | 2 +- 18 files changed, 29 insertions(+), 30 deletions(-) diff --git a/ophyd_devices/devices/areadetector/plugins.py b/ophyd_devices/devices/areadetector/plugins.py index 0b244e1..8c95a05 100644 --- a/ophyd_devices/devices/areadetector/plugins.py +++ b/ophyd_devices/devices/areadetector/plugins.py @@ -6,7 +6,7 @@ # This module contains: # - Classes like `StatsPlugin_V{X}{Y}` that are design to be counterparts to -# AreaDetector verion X.Y. +# AreaDetector version X.Y. # # isort: skip_file diff --git a/ophyd_devices/devices/dxp.py b/ophyd_devices/devices/dxp.py index 51536b9..3ca16ba 100644 --- a/ophyd_devices/devices/dxp.py +++ b/ophyd_devices/devices/dxp.py @@ -98,7 +98,7 @@ ROI_RANGE = range(0, 8) class EpicsMCARecord(_EpicsMCARecord): - """EpicsMCARecord with addtional fields""" + """EpicsMCARecord with additional fields""" # Calibration values calo = Cpt(EpicsSignal, ".CALO", kind=Kind.config) @@ -130,7 +130,7 @@ class EpicsDXPFalcon(Device): preset_triggers = Cpt(EpicsSignalWithRBV, "PresetTriggers") preset_real_time = Cpt(EpicsSignalWithRBV, "PresetReal") - # Couting statistics + # Counting statistics elapsed_live_time = Cpt(EpicsSignalRO, "ElapsedLiveTime", lazy=True) elapsed_real_time = Cpt(EpicsSignalRO, "ElapsedRealTime", lazy=True) elapsed_trigger_live = Cpt(EpicsSignalRO, "ElapsedTriggerLiveTime", lazy=True) diff --git a/ophyd_devices/devices/panda_box/README.md b/ophyd_devices/devices/panda_box/README.md index 95cdd80..a8d57b1 100644 --- a/ophyd_devices/devices/panda_box/README.md +++ b/ophyd_devices/devices/panda_box/README.md @@ -1,5 +1,5 @@ # PandaBox Integration -Short Doumentation of the PandaBox Device Integration in Ophyd Devices +Short Documentation of the PandaBox Device Integration in Ophyd Devices ## Overview diff --git a/ophyd_devices/devices/panda_box/panda_box.py b/ophyd_devices/devices/panda_box/panda_box.py index fb3cf2e..9c23664 100644 --- a/ophyd_devices/devices/panda_box/panda_box.py +++ b/ophyd_devices/devices/panda_box/panda_box.py @@ -746,7 +746,7 @@ class PandaBox(PSIDeviceBase): """ Convert the data from a FrameData object into a dictionary with expected OPHYD read format, e.g. signal {signal_name: {"value": [...]}}. Please be aware that if - this method is overriden by child classes, you need to make sure that the key names + this method is overridden by child classes, you need to make sure that the key names in the FrameData is converted to the expected names in the data signal. This includes replacing dots in the original PandaBox keys with underscores using "block_name_mapping" from the utils, and using the key mapping provided through the signal_alias mapping. diff --git a/ophyd_devices/interfaces/base_classes/bec_device_base.py b/ophyd_devices/interfaces/base_classes/bec_device_base.py index bcfb9eb..97e8017 100644 --- a/ophyd_devices/interfaces/base_classes/bec_device_base.py +++ b/ophyd_devices/interfaces/base_classes/bec_device_base.py @@ -384,7 +384,7 @@ class BECDeviceBase(Device): """ Hook for beamline specific logic during class initialization. - Please to not set any of the class's signals during intialisation, but + Please do not set any of the class's signals during initialisation, but instead use the wait_for_connection. """ self.custom_prepare.on_init() @@ -411,7 +411,7 @@ class BECDeviceBase(Device): Stage is idempotent, if staged twice it should raise (we let ophyd.Device handle the raise here). Other that that, we reset the stopped property in case the device was stopped before, and - pull the latest scan metadata from BEC. Ater that, we allow for beamline specific logic to + pull the latest scan metadata from BEC. After that, we allow for beamline specific logic to be implemented through the custom_prepare.on_stage method. Returns: @@ -456,7 +456,7 @@ class BECDeviceBase(Device): softwareTrigger needs to be set to True, which will indicate to BEC that the device should be triggered from the software during the scan. - Custom logic should be implemented non-blocking, i.e. be fast, or implemented asynchroniously. + Custom logic should be implemented non-blocking, i.e. be fast, or implemented asynchronously. Returns: DeviceStatus: DeviceStatus object that BEC will use to check if the trigger was successful. diff --git a/ophyd_devices/interfaces/base_classes/ophyd_rotation_base.py b/ophyd_devices/interfaces/base_classes/ophyd_rotation_base.py index a351d29..ae3ee62 100644 --- a/ophyd_devices/interfaces/base_classes/ophyd_rotation_base.py +++ b/ophyd_devices/interfaces/base_classes/ophyd_rotation_base.py @@ -11,8 +11,8 @@ from ophyd_devices.utils.bec_utils import ConfigSignal logger = bec_logger.logger -class OphtyRotationBaseError(Exception): - """Exception specific for implmenetation of rotation stages.""" +class OphydRotationBaseError(Exception): + """Exception specific for implementation of rotation stages.""" class OphydRotationBase(BECRotationProtocol, ABC): @@ -98,7 +98,7 @@ class EpicsRotationBase(OphydRotationBase, EpicsMotor): self.set_current_position(new_val) except Exception as exc: error_msg = f"Failed to set new position {new_val} from {cur_val} on device {self.name} with error {exc}" - raise OphtyRotationBaseError(error_msg) from exc + raise OphydRotationBaseError(error_msg) from exc return logger.info( f"Did not apply mod360 for device {self.name} with has_mod={self.has_mod360} and allow_mod={self.allow_mod360.get()}" diff --git a/ophyd_devices/interfaces/protocols/bec_protocols.py b/ophyd_devices/interfaces/protocols/bec_protocols.py index 90ff554..fcd5672 100644 --- a/ophyd_devices/interfaces/protocols/bec_protocols.py +++ b/ophyd_devices/interfaces/protocols/bec_protocols.py @@ -1,7 +1,7 @@ """This module provides a range of protocols that describe the expected interface for different types of devices. -The protocols below can be used as teamplates for functionality to be implemeted +The protocols below can be used as templates for functionality to be implemented by different type of devices. They further facilitate runtime checks on devices and provide a minimum set of properties required for a device to be loadable by BEC. @@ -100,7 +100,7 @@ class BECBaseProtocol(Protocol): """ def clear_sub(self, cb: callable, event_type: str = None): - """Clear subscription, given the origianl callback fucntion + """Clear subscription, given the original callback function Args: cb (callable) : Callback @@ -263,7 +263,7 @@ class BECDeviceProtocol(BECBaseProtocol, Protocol): """Staged property to indicate if the device is staged.""" def stage(self) -> list[object]: - """Stage method to prepare the device for an upcoming acquistion. + """Stage method to prepare the device for an upcoming acquisition. This prepares a device for an upcoming acquisition, i.e. it is the first method for which the scan parameters are known and the device can be configured. @@ -286,7 +286,7 @@ class BECDeviceProtocol(BECBaseProtocol, Protocol): """Unstage method to cleanup after the acquisition. It can also be used to implement checks whether the acquisition was successful, - inform BEC that the file has been succesfully written, or raise upon receiving + inform BEC that the file has been successfully written, or raise upon receiving feedback that the scan did not finish successful. Unstaging is not idempotent. If called twice it should simply resolve. diff --git a/ophyd_devices/sim/sim_camera.py b/ophyd_devices/sim/sim_camera.py index 97f5e2b..df10114 100644 --- a/ophyd_devices/sim/sim_camera.py +++ b/ophyd_devices/sim/sim_camera.py @@ -68,7 +68,7 @@ class SimCamera(PSIDeviceBase, SimCameraControl): Parameters ---------- - name (string) : Name of the device. This is the only required argmuent, passed on to all signals of the device. + name (string) : Name of the device. This is the only required argument, passed on to all signals of the device. precision (integer) : Precision of the readback in digits, written to .describe(). Default is 3 digits. sim_init (dict) : Dictionary to initiate parameters of the simulation, check simulation type defaults for more details. parent : Parent device, optional, is used internally if this signal/device is part of a larger device. diff --git a/ophyd_devices/sim/sim_data.py b/ophyd_devices/sim/sim_data.py index 9682141..f56ec5e 100644 --- a/ophyd_devices/sim/sim_data.py +++ b/ophyd_devices/sim/sim_data.py @@ -92,7 +92,7 @@ class SimulatedDataBase(ABC): - execute_simulation_method: execute a method from the simulated data class or reroute execution to device proxy class - select_model: select the active simulation model - - params: get the parameters for the active simulation mdoel + - params: get the parameters for the active simulation model - sim_models: get the available simulation models - update_sim_state: update the simulated state of the device """ diff --git a/ophyd_devices/sim/sim_flyer.py b/ophyd_devices/sim/sim_flyer.py index 77b2e40..0fc936d 100644 --- a/ophyd_devices/sim/sim_flyer.py +++ b/ophyd_devices/sim/sim_flyer.py @@ -17,7 +17,7 @@ logger = bec_logger.logger class SimFlyer(Device, FlyerInterface): - """A simulated device mimicing any 2D Flyer device (position, temperature, rotation). + """A simulated device mimicking any 2D Flyer device (position, temperature, rotation). The corresponding simulation class is sim_cls=SimulatedPositioner, more details on defaults within the simulation class. @@ -25,7 +25,7 @@ class SimFlyer(Device, FlyerInterface): Parameters ---------- - name (string) : Name of the device. This is the only required argmuent, passed on to all signals of the device. + name (string) : Name of the device. This is the only required argument, passed on to all signals of the device. precision (integer) : Precision of the readback in digits, written to .describe(). Default is 3 digits. parent : Parent device, optional, is used internally if this signal/device is part of a larger device. kind : A member the Kind IntEnum (or equivalent integer), optional. Default is Kind.normal. See Kind for options. diff --git a/ophyd_devices/sim/sim_frameworks/device_proxy.py b/ophyd_devices/sim/sim_frameworks/device_proxy.py index fb3ed4c..8147645 100644 --- a/ophyd_devices/sim/sim_frameworks/device_proxy.py +++ b/ophyd_devices/sim/sim_frameworks/device_proxy.py @@ -54,8 +54,7 @@ class DeviceProxy(BECDeviceBase, ABC): def _compute(self, device_name: str, *args, **kwargs) -> any: """ The purpose of this method is to compute the readback value for the signal of the device - that this proxy is attached to. This method is meant to be overriden by the user. - P + that this proxy is attached to. This method is meant to be overridden by the user. Args: device_name (str): Name of the device. diff --git a/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py b/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py index 7703849..c938e1b 100644 --- a/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py +++ b/ophyd_devices/sim/sim_frameworks/h5_image_replay_proxy.py @@ -13,7 +13,7 @@ from ophyd_devices.sim.sim_frameworks.device_proxy import DeviceProxy class H5ImageReplayProxy(DeviceProxy): """This Proxy class can be used to replay images from an h5 file. - If the number of requested images is larger than the number of available iamges, + If the number of requested images is larger than the number of available images, the images will be replayed from the beginning. An example for the configuration of this is device is in ophyd_devices.configs.ophyd_devices_simulation.yaml diff --git a/ophyd_devices/sim/sim_frameworks/slit_proxy.py b/ophyd_devices/sim/sim_frameworks/slit_proxy.py index 96e6652..b75b893 100644 --- a/ophyd_devices/sim/sim_frameworks/slit_proxy.py +++ b/ophyd_devices/sim/sim_frameworks/slit_proxy.py @@ -7,7 +7,7 @@ from ophyd_devices.sim.sim_frameworks.device_proxy import DeviceProxy class SlitProxy(DeviceProxy): """ - Simulation framework to immitate the behaviour of slits. + Simulation framework to imitate the behaviour of slits. This device is a proxy that is meant to override the behaviour of a SimCamera. You may use this to simulate the effect of slits on the camera image. diff --git a/ophyd_devices/sim/sim_monitor.py b/ophyd_devices/sim/sim_monitor.py index 24be75c..67cdf20 100644 --- a/ophyd_devices/sim/sim_monitor.py +++ b/ophyd_devices/sim/sim_monitor.py @@ -27,7 +27,7 @@ class SimMonitor(ReadOnlySignal): Parameters ---------- - name (string) : Name of the device. This is the only required argmuent, + name (string) : Name of the device. This is the only required argument, passed on to all signals of the device. precision (integer) : Precision of the readback in digits, written to .describe(). Default is 3 digits. diff --git a/ophyd_devices/sim/sim_positioner.py b/ophyd_devices/sim/sim_positioner.py index aaece4a..2c87071 100644 --- a/ophyd_devices/sim/sim_positioner.py +++ b/ophyd_devices/sim/sim_positioner.py @@ -21,16 +21,16 @@ logger = bec_logger.logger class SimPositioner(Device, PositionerBase): """ - A simulated device mimicing any 1D Axis device (position, temperature, rotation). + A simulated device mimicking any 1D Axis device (position, temperature, rotation). >>> motor = SimPositioner(name="motor") Parameters ---------- - name (string) : Name of the device. This is the only required argmuent, passed on to all signals of the device.\ + name (string) : Name of the device. This is the only required argument, passed on to all signals of the device.\ Optional parameters: ---------- - delay (int) : If 0, execution of move will be instant. If 1, exectution will depend on motor velocity. Default is 1. + delay (int) : If 0, execution of move will be instant. If 1, execution will depend on motor velocity. Default is 1. update_frequency (int) : Frequency in Hz of the update of the simulated state during a move. Default is 2 Hz. precision (integer) : Precision of the readback in digits, written to .describe(). Default is 3 digits. limits (tuple) : Tuple of the low and high limits of the positioner. Overrides low/high_limit_travel is specified. Default is None. diff --git a/ophyd_devices/sim/sim_signals.py b/ophyd_devices/sim/sim_signals.py index 850d117..c0f54e3 100644 --- a/ophyd_devices/sim/sim_signals.py +++ b/ophyd_devices/sim/sim_signals.py @@ -22,7 +22,7 @@ class SetableSignal(Signal): The signal will store the value in sim_state of the SimulatedData class of the parent device. It will also return the value from sim_state when get is called. Compared to the ReadOnlySignal, this signal can be written to. - The setable signal inherits from the Signal class of ophyd, thus the class attribute needs to be + The settable signal inherits from the Signal class of ophyd, thus the class attribute needs to be initiated as a Component (class from ophyd). >>> signal = SetableSignal(name="signal", parent=parent, value=0) diff --git a/ophyd_devices/sim/sim_waveform.py b/ophyd_devices/sim/sim_waveform.py index 914d117..35cf3c3 100644 --- a/ophyd_devices/sim/sim_waveform.py +++ b/ophyd_devices/sim/sim_waveform.py @@ -58,7 +58,7 @@ class SimWaveform(Device): Parameters ---------- - name (string) : Name of the device. This is the only required argmuent, passed on to all signals of the device. + name (string) : Name of the device. This is the only required argument, passed on to all signals of the device. precision (integer) : Precision of the readback in digits, written to .describe(). Default is 3 digits. sim_init (dict) : Dictionary to initiate parameters of the simulation, check simulation type defaults for more details. parent : Parent device, optional, is used internally if this signal/device is part of a larger device. diff --git a/ophyd_devices/utils/socket.py b/ophyd_devices/utils/socket.py index 217212c..c7d4b5d 100644 --- a/ophyd_devices/utils/socket.py +++ b/ophyd_devices/utils/socket.py @@ -87,7 +87,7 @@ class SocketSignal(abc.ABC, Signal): for reading from and writing to a socket, as well as handling callbacks and subscriptions in a way that prevents recursive calls. Children should implement the `_socket_get` and `_socket_set` methods to define the specific logic for interacting with the socket. `get` and `put` methods should not be - overriden by children to ensure proper callback handling. + overridden by children to ensure proper callback handling. Args: name (str): The name of the signal.