diff --git a/bec_ipython_client/bec_ipython_client/callbacks/live_table.py b/bec_ipython_client/bec_ipython_client/callbacks/live_table.py index 747500857..88b98d864 100644 --- a/bec_ipython_client/bec_ipython_client/callbacks/live_table.py +++ b/bec_ipython_client/bec_ipython_client/callbacks/live_table.py @@ -31,7 +31,7 @@ def sort_devices(devices, scan_devices) -> list: class LiveUpdatesTable(LiveUpdatesBase): - """Live updates for scans using a table and a scan progess bar. + """Live updates for scans using a table and a scan progress bar. Args: bec (BECClient): client instance diff --git a/bec_ipython_client/bec_ipython_client/main.py b/bec_ipython_client/bec_ipython_client/main.py index ec3268c74..cc2e760a4 100644 --- a/bec_ipython_client/bec_ipython_client/main.py +++ b/bec_ipython_client/bec_ipython_client/main.py @@ -46,7 +46,7 @@ def _wait_for_server(self): # pylint: disable=no-member cmdline_args = self._BECClient__init_params["config"].config.get("cmdline_args") # set stderr logger level to SUCCESS (will not show messages <= INFO level) - # (see issue #318), except if user explicitely asked for another level from cmd line + # (see issue #318), except if user explicitly asked for another level from cmd line if not cmdline_args or not cmdline_args.get("log_level"): # pylint: disable=protected-access bec_logger._stderr_log_level = "SUCCESS" diff --git a/bec_ipython_client/bec_ipython_client/signals.py b/bec_ipython_client/bec_ipython_client/signals.py index c5ecba32d..ea0392e5d 100644 --- a/bec_ipython_client/bec_ipython_client/signals.py +++ b/bec_ipython_client/bec_ipython_client/signals.py @@ -102,7 +102,7 @@ def handle_signals(self): def _procedure_mode(self): # Catch it here to only kill scans which were started here - print("SIGINT recieved in procedure mode. Sending scan abort request and exiting.") + print("SIGINT received in procedure mode. Sending scan abort request and exiting.") self.bec.queue.request_scan_abortion() # Let the procedure worker shut itself down raise KeyboardInterrupt diff --git a/bec_lib/bec_lib/alarm_handler.py b/bec_lib/bec_lib/alarm_handler.py index b2bf2563b..72b68701f 100644 --- a/bec_lib/bec_lib/alarm_handler.py +++ b/bec_lib/bec_lib/alarm_handler.py @@ -47,7 +47,7 @@ def __init__(self, alarm: messages.AlarmMessage, severity: Alarms, handled=False def __str__(self) -> str: msg = self.alarm.info.compact_error_message or self.alarm.info.error_message return ( - f"An alarm has occured. Severity: {self.severity.name}.\n{self.alarm_type}.\n\t" + f"An alarm has occurred. Severity: {self.severity.name}.\n{self.alarm_type}.\n\t" f" {msg}" ) diff --git a/bec_lib/bec_lib/bec_service.py b/bec_lib/bec_lib/bec_service.py index 1bdc33d34..9659effbb 100644 --- a/bec_lib/bec_lib/bec_service.py +++ b/bec_lib/bec_lib/bec_service.py @@ -268,7 +268,7 @@ def _update_service_info(self): try: self._send_service_status() except Exception: - # exception is not explicitely specified, + # exception is not explicitly specified, # because it depends on the underlying connector pass @@ -342,7 +342,7 @@ def _get_metrics(self): self.connector.set_and_publish(MessageEndpoints.metrics(self._service_name), msg) # pylint: disable=broad-except except Exception: - # exception is not explicitely specified, + # exception is not explicitly specified, # because it depends on the underlying connector pass diff --git a/bec_lib/bec_lib/callback_handler.py b/bec_lib/bec_lib/callback_handler.py index 8dfb67d80..80dbcf116 100644 --- a/bec_lib/bec_lib/callback_handler.py +++ b/bec_lib/bec_lib/callback_handler.py @@ -46,7 +46,7 @@ def __init__(self, id: int, event_type: EventType, func: Callable, sync: bool) - @threadlocked def run(self, *args, **kwargs) -> None: - """Run the callback function. If sync is True, the callback is run immediately. Otherwise, the callback is added to a queue and exectued in the next poll.""" + """Run the callback function. If sync is True, the callback is run immediately. Otherwise, the callback is added to a queue and executed in the next poll.""" if not self.sync: self._run_cb(*args, **kwargs) return diff --git a/bec_lib/bec_lib/client.py b/bec_lib/bec_lib/client.py index a09ab6bcd..883b2ad0a 100644 --- a/bec_lib/bec_lib/client.py +++ b/bec_lib/bec_lib/client.py @@ -275,7 +275,7 @@ def _load_scans(self): def load_high_level_interface(self, module_name: str) -> None: """Load a high level interface module. Runs a callback of type `EventType.NAMESPACE_UPDATE` - to inform clients about added objects in the namesapce. + to inform clients about added objects in the namespace. Args: module_name (str): The name of the module to load diff --git a/bec_lib/bec_lib/dap_plugin_objects.py b/bec_lib/bec_lib/dap_plugin_objects.py index bc9f44699..1ab172637 100644 --- a/bec_lib/bec_lib/dap_plugin_objects.py +++ b/bec_lib/bec_lib/dap_plugin_objects.py @@ -180,7 +180,7 @@ class DAPPluginObjectAutoRun(DAPPluginObject): @property def auto_run(self): """ - Set to True to start a continously running worker. + Set to True to start a continuously running worker. """ return self._plugin_config.get("auto_run", False) diff --git a/bec_lib/bec_lib/dap_plugins.py b/bec_lib/bec_lib/dap_plugins.py index f3da42574..906e60568 100644 --- a/bec_lib/bec_lib/dap_plugins.py +++ b/bec_lib/bec_lib/dap_plugins.py @@ -30,7 +30,7 @@ def refresh(self): """ Refresh the list of available DAP plugins. This is useful if new plugins have been added after the client has been initialized. This method is called automatically when the client is initialized. - A call to this method is indempotent, meaning it can be called multiple times without side effects. + A call to this method is idempotent, meaning it can be called multiple times without side effects. """ self._import_dap_plugins() diff --git a/bec_lib/bec_lib/device.py b/bec_lib/bec_lib/device.py index 4c8bf0586..44b4dcdba 100644 --- a/bec_lib/bec_lib/device.py +++ b/bec_lib/bec_lib/device.py @@ -1221,7 +1221,7 @@ def set_input_signals(self, *signals) -> None: The signals need to be valid signals and match the computation of the compute method. Args: - signals : All signals to be added for the comput method + signals : All signals to be added for the compute method >>> dev..set_input_signals(dev.bpm4i.readback, dev.bpm5i.readback) """ diff --git a/bec_lib/bec_lib/endpoints.py b/bec_lib/bec_lib/endpoints.py index b6a43615a..da2bdf759 100644 --- a/bec_lib/bec_lib/endpoints.py +++ b/bec_lib/bec_lib/endpoints.py @@ -884,7 +884,7 @@ def device_instructions(): @staticmethod def device_instructions_response(): """ - Endpoint for device instruction repsonses. This endpoint is used by the device + Endpoint for device instruction responses. This endpoint is used by the device server to publish responses to device instructions, typically sent by the scan server using a messages.DeviceInstructionResponse message. The messages are used to inform interested services about the status of device instructions. @@ -1150,7 +1150,7 @@ def service_response(RID: str): def service_request(): """ Endpoint for service request. This endpoint is used to - request e.g. resarts of the bec server. + request e.g. restarts of the bec server. Returns: EndpointInfo: Endpoint for service request. diff --git a/bec_lib/bec_lib/logger.py b/bec_lib/bec_lib/logger.py index 201efb3a8..dad1fd610 100644 --- a/bec_lib/bec_lib/logger.py +++ b/bec_lib/bec_lib/logger.py @@ -221,7 +221,7 @@ def _logger_callback(self, msg): except Exception: # connector disconnected? # just ignore the error here... - # Exception is not explicitely specified, + # Exception is not explicitly specified, # because it depends on the connector pass diff --git a/bec_lib/bec_lib/macro_update_handler.py b/bec_lib/bec_lib/macro_update_handler.py index 8d7ed6220..7f06018bc 100644 --- a/bec_lib/bec_lib/macro_update_handler.py +++ b/bec_lib/bec_lib/macro_update_handler.py @@ -146,7 +146,7 @@ def load_all_user_macros(self) -> None: """Load all macros from the `macros` directory. Runs a callback of type `EventType.NAMESPACE_UPDATE` - to inform clients about added objects in the namesapce. + to inform clients about added objects in the namespace. """ self.forget_all_user_macros() macro_files = [] @@ -219,7 +219,7 @@ def forget_all_user_macros(self) -> None: """unload / remove loaded user macros from builtins. Files will remain untouched. Runs a callback of type `EventType.NAMESPACE_UPDATE` - to inform clients about removing objects from the namesapce. + to inform clients about removing objects from the namespace. """ for name, obj in self.macros.items(): diff --git a/bec_lib/bec_lib/messages.py b/bec_lib/bec_lib/messages.py index cd87a88d9..c1a23b34f 100644 --- a/bec_lib/bec_lib/messages.py +++ b/bec_lib/bec_lib/messages.py @@ -789,7 +789,7 @@ def check_data(cls, v: np.ndarray): if v.ndim == 3 and v.shape[2] == 3: return v raise ValueError( - f"Invalid dimenson {v.ndim} for numpy array. Must be a 2D array or 3D array for rgb v.shape[2]=3." + f"Invalid dimension {v.ndim} for numpy array. Must be a 2D array or 3D array for rgb v.shape[2]=3." ) @@ -827,7 +827,7 @@ def check_data(cls, v: np.ndarray): raise ValueError(f"Invalid array type: {type(v)}. Must be a numpy array.") if v.ndim == 1: return v - raise ValueError(f"Invalid dimenson {v.ndim} for numpy array. Must be a 1D array.") + raise ValueError(f"Invalid dimension {v.ndim} for numpy array. Must be a 1D array.") class DevicePreviewMessage(BECMessage): diff --git a/bec_lib/bec_lib/redis_connector.py b/bec_lib/bec_lib/redis_connector.py index eb12c6412..da66d17ed 100644 --- a/bec_lib/bec_lib/redis_connector.py +++ b/bec_lib/bec_lib/redis_connector.py @@ -1391,7 +1391,7 @@ def blocking_list_pop_to_set_add( side: Literal["LEFT", "RIGHT"] = "LEFT", timeout_s: float | None = None, ) -> _BecMsgT | None: - """Block for up to timeout seconds to pop an item from 'list_enpoint' on side `side`, + """Block for up to timeout seconds to pop an item from 'list_endpoint' on side `side`, and add it to 'set_endpoint'. Returns the popped item, or None if waiting timed out. """ for ep, ops in [(list_endpoint, MessageOp.LIST), (set_endpoint, MessageOp.SET)]: diff --git a/bec_lib/bec_lib/request_items.py b/bec_lib/bec_lib/request_items.py index f02336731..aea780332 100644 --- a/bec_lib/bec_lib/request_items.py +++ b/bec_lib/bec_lib/request_items.py @@ -73,7 +73,7 @@ def decision_pending(self, val: bool) -> None: @classmethod def from_response(cls, scan_manager: ScanManager, response: messages.RequestResponseMessage): - """initialize a request item from a RequestReponseMessage / response message""" + """initialize a request item from a RequestResponseMessage / response message""" scan_req = cls( scan_manager=scan_manager, requestID=response.metadata["RID"], diff --git a/bec_lib/tests/test_alarm_handler.py b/bec_lib/tests/test_alarm_handler.py index d05217198..50a391695 100644 --- a/bec_lib/tests/test_alarm_handler.py +++ b/bec_lib/tests/test_alarm_handler.py @@ -43,7 +43,7 @@ def test_alarm_base_printing(msg): alarm_msg = AlarmBase(alarm=msg, severity=Alarms.MAJOR) # Test __str__ method - expected_str = f"An alarm has occured. Severity: MAJOR.\n{msg.info.exception_type}.\n\t {msg.info.compact_error_message}" + expected_str = f"An alarm has occurred. Severity: MAJOR.\n{msg.info.exception_type}.\n\t {msg.info.compact_error_message}" assert str(alarm_msg) == expected_str # Test pretty_print method (just ensure it runs without error) diff --git a/bec_lib/tests/test_dap_plugins.py b/bec_lib/tests/test_dap_plugins.py index c9e64c2c2..207459b2d 100644 --- a/bec_lib/tests/test_dap_plugins.py +++ b/bec_lib/tests/test_dap_plugins.py @@ -436,7 +436,7 @@ def test_dap_wait_for_dap_response_waits_for_RID(dap): dap.GaussianModel._wait_for_dap_response(request_id="1234", timeout=0.1) -def test_dap_wait_for_dap_respnse_returns(dap): +def test_dap_wait_for_dap_response_returns(dap): dap._parent.connector.get.return_value = messages.DAPResponseMessage( success=True, data=({}, None), metadata={"RID": "1234"} ) diff --git a/bec_lib/tests/test_device_manager.py b/bec_lib/tests/test_device_manager.py index f45bd295c..d5c69a598 100644 --- a/bec_lib/tests/test_device_manager.py +++ b/bec_lib/tests/test_device_manager.py @@ -121,7 +121,7 @@ def test_get_devices_with_tags(test_config_yaml, dm_with_devices): dev_names = {dev.name for dev in dev_list} assert dev_names == set(devices) - assert len(device_manager.devices.get_devices_with_tags("someting")) == 0 + assert len(device_manager.devices.get_devices_with_tags("something")) == 0 def test_get_software_triggered_devices(test_config_yaml, dm_with_devices): diff --git a/bec_lib/tests/test_messaging_service.py b/bec_lib/tests/test_messaging_service.py index f59643de5..70552de78 100644 --- a/bec_lib/tests/test_messaging_service.py +++ b/bec_lib/tests/test_messaging_service.py @@ -166,7 +166,7 @@ def test_scilog_messaging_service_send_image_attachment( assert attachment.data == b"\x89PNG\r\n\x1a\n" -def test_messaging_service_attachement_raises_if_too_large(scilog_message, tmp_path): +def test_messaging_service_attachment_raises_if_too_large(scilog_message, tmp_path): # Create a temporary file larger than 5MB file_path = tmp_path / "large_file.bin" with open(file_path, "wb") as f: diff --git a/bec_server/bec_server/data_processing/image_analysis_service.py b/bec_server/bec_server/data_processing/image_analysis_service.py index 51b22a50f..fad8ac435 100644 --- a/bec_server/bec_server/data_processing/image_analysis_service.py +++ b/bec_server/bec_server/data_processing/image_analysis_service.py @@ -42,7 +42,7 @@ def __init__(self, *args, **kwargs): def configure(self, scan_item=None, device=None, images=None, return_type=None, **kwargs): # TODO Add type hints for np.ndarray and list[np.ndarray] do not work yet in the signature_serializer - # This will be adressed in a different MR, issue is created #395 + # This will be addressed in a different MR, issue is created #395 # scan_item: ScanItem | str = None, # device: DeviceBase | str = None, # images: np.ndarray | list[np.ndarray] | None = None, diff --git a/bec_server/bec_server/device_server/devices/devicemanager.py b/bec_server/bec_server/device_server/devices/devicemanager.py index 5d033ddd7..8857aaa7c 100644 --- a/bec_server/bec_server/device_server/devices/devicemanager.py +++ b/bec_server/bec_server/device_server/devices/devicemanager.py @@ -791,7 +791,7 @@ def _obj_callback_device_monitor_2d( DEPRECATED: Use _obj_callback_preview instead. Callback for ophyd monitor events. Sends the data to redis. - Introduces a check of the data size, and incoporates a limit which is defined in max_size (in MB) + Introduces a check of the data size, and incorporates a limit which is defined in max_size (in MB) Args: obj (OphydObject): ophyd object @@ -830,7 +830,7 @@ def _obj_callback_device_monitor_1d( DEPRECATED: Use _obj_callback_preview instead. Callback for ophyd monitor events. Sends the data to redis. - Introduces a check of the data size, and incoporates a limit which is defined in max_size (in MB) + Introduces a check of the data size, and incorporates a limit which is defined in max_size (in MB) Args: obj (OphydObject): ophyd object @@ -955,7 +955,7 @@ def _obj_callback_file_event( obj (OphydObject): ophyd object file_path (str): file path to the created file done (bool): if the file is done - successfull (bool): if the file was created successfully + successful (bool): if the file was created successfully file_type (str): Optional, file type. Default is h5. hinted_h5_entry (dict[str, str] | None): Optional, hinted h5 entry. Please check FileMessage for more details """ diff --git a/bec_server/bec_server/procedures/manager.py b/bec_server/bec_server/procedures/manager.py index a2cf45159..9f6d5487d 100644 --- a/bec_server/bec_server/procedures/manager.py +++ b/bec_server/bec_server/procedures/manager.py @@ -301,7 +301,7 @@ def shutdown(self): MessageEndpoints.procedure_request(), None, self._process_queue_request ) self._conn.shutdown() - # cancel futures by hand to give us the opportunity to detatch them from redis if they have started + # cancel futures by hand to give us the opportunity to detach them from redis if they have started with self.lock: for entry in self._active_workers.values(): cancelled = entry["future"].cancel() diff --git a/bec_server/bec_server/scan_server/scan_queue.py b/bec_server/bec_server/scan_server/scan_queue.py index 6f39e30c7..5d8c10d5e 100644 --- a/bec_server/bec_server/scan_server/scan_queue.py +++ b/bec_server/bec_server/scan_server/scan_queue.py @@ -307,7 +307,7 @@ def scan_interception(self, scan_mod_msg: messages.ScanQueueModificationMessage) @requires_queue def set_pause(self, scan_id=None, queue="primary", parameter: dict | None = None) -> None: # pylint: disable=unused-argument - """pause the queue and the currenlty running instruction queue""" + """pause the queue and the currently running instruction queue""" que = self.queues[queue] with AutoResetCM(que): if que.worker_status == InstructionQueueStatus.RUNNING: diff --git a/bec_server/bec_server/scan_server/scan_stubs.py b/bec_server/bec_server/scan_server/scan_stubs.py index 92e3a520d..e39877870 100644 --- a/bec_server/bec_server/scan_server/scan_stubs.py +++ b/bec_server/bec_server/scan_server/scan_stubs.py @@ -933,7 +933,7 @@ def send_rpc( self, device: str, func_name: str, *args, metadata=None, rpc_id=None, **kwargs ) -> Generator[messages.DeviceInstructionMessage, None, ScanStubStatus]: """ - Perfrom an RPC (remote procedure call) on a device. + Perform an RPC (remote procedure call) on a device. For blocking calls, use :func:`send_rpc_and_wait`. Any additional arguments and keyword arguments will be passed on to the RPC function. diff --git a/bec_server/bec_server/scan_server/scans.py b/bec_server/bec_server/scan_server/scans.py index 1549429f0..dff71a199 100644 --- a/bec_server/bec_server/scan_server/scans.py +++ b/bec_server/bec_server/scan_server/scans.py @@ -1399,7 +1399,7 @@ def _calculate_atol(self): raise ScanAbortion( f"Motor {self.device} is moving too fast with the calculated tolerance. Consider reducing speed {self.motor_velocity} or increasing the atol {self.atol}" ) - # the lower udate limit is 100ms, so we set the atol to 0.2s/v if the atol is smaller + # the lower update limit is 100ms, so we set the atol to 0.2s/v if the atol is smaller self.atol = max(self.atol, 2 * 1 / update_freq * self.motor_velocity) def _calculate_offset(self): @@ -2046,7 +2046,7 @@ def run(self): yield from self.stubs.trigger(min_wait=self.exp_time) -class InteractiveReadMontiored(ScanComponent): +class InteractiveReadMonitored(ScanComponent): scan_name = "_interactive_read_monitored" required_kwargs = {"point_id": ScanArgType.INT} diff --git a/bec_server/tests/tests_scan_server/test_scan_server_queue.py b/bec_server/tests/tests_scan_server/test_scan_server_queue.py index f17740945..c1158a2eb 100644 --- a/bec_server/tests/tests_scan_server/test_scan_server_queue.py +++ b/bec_server/tests/tests_scan_server/test_scan_server_queue.py @@ -873,7 +873,7 @@ def test_increase_scan_number(scan_queue_msg, is_scan): assert req_block_queue.scan_queue.queue_manager.parent.scan_number == 20 -def test_pull_request_block_non_empyt_rb(): +def test_pull_request_block_non_empty_rb(): req_block_queue = RequestBlockQueue(mock.MagicMock(), mock.MagicMock()) scan_queue_msg = messages.ScanQueueMessage( scan_type="grid_scan", @@ -888,7 +888,7 @@ def test_pull_request_block_non_empyt_rb(): rbqs.assert_not_called() -def test_pull_request_block_empyt_rb(): +def test_pull_request_block_empty_rb(): req_block_queue = RequestBlockQueue(mock.MagicMock(), mock.MagicMock()) with mock.patch.object(req_block_queue, "request_blocks_queue") as rbqs: with pytest.raises(StopIteration): diff --git a/bec_server/tests/tests_scan_server/test_scan_stubs.py b/bec_server/tests/tests_scan_server/test_scan_stubs.py index 3ed23576b..4ab51e9bd 100644 --- a/bec_server/tests/tests_scan_server/test_scan_stubs.py +++ b/bec_server/tests/tests_scan_server/test_scan_stubs.py @@ -115,7 +115,7 @@ def mock_rpc_func(*args, **kwargs): def test_stage(stubs): - """Test that staging wihtout a device is not blocking, the status object should resolve.""" + """Test that staging without a device is not blocking, the status object should resolve.""" # Have only rtx in the device manager with async readout priority devices = list(stubs._device_manager.devices.values()) for device in devices: diff --git a/bec_server/tests/tests_scan_server/test_scans.py b/bec_server/tests/tests_scan_server/test_scans.py index 72ce9045a..50c293983 100644 --- a/bec_server/tests/tests_scan_server/test_scans.py +++ b/bec_server/tests/tests_scan_server/test_scans.py @@ -16,7 +16,7 @@ DeviceRPC, FermatSpiralScan, HexagonalScan, - InteractiveReadMontiored, + InteractiveReadMonitored, InteractiveTrigger, LineScan, ListScan, @@ -1976,7 +1976,7 @@ def test_OpenInteractiveScan(scan_assembler): ] -def test_InteractiveReadMontiored(scan_assembler): +def test_InteractiveReadMonitored(scan_assembler): scan_msg = messages.ScanQueueMessage( scan_type="_interactive_scan_trigger", parameter={"args": {"samx": []}, "kwargs": {"relative": True, "exp_time": 0.1}}, @@ -1985,7 +1985,7 @@ def test_InteractiveReadMontiored(scan_assembler): args = unpack_scan_args(scan_msg.content["parameter"]["args"]) kwargs = scan_msg.content["parameter"]["kwargs"] request = scan_assembler( - InteractiveReadMontiored, *args, parameter=scan_msg.content["parameter"], **kwargs + InteractiveReadMonitored, *args, parameter=scan_msg.content["parameter"], **kwargs ) ref_list = list(request.run()) diff --git a/docs/source/developer/scans/scan_structure.md b/docs/source/developer/scans/scan_structure.md index 95381d15b..36b5be880 100644 --- a/docs/source/developer/scans/scan_structure.md +++ b/docs/source/developer/scans/scan_structure.md @@ -96,7 +96,7 @@ For each position in the scan, the method `_at_each_point` is called, providing 1. Let the device settle for a specified time (default: `settling_time=0`). 1. Send out a trigger and wait at least for the specified time (`min_wait`). 1. Read out all devices that are on `readout_priority="monitored"` and are currently enabled and assign the readout to the `point_id`. -1. Increase the `poind_id` by one. +1. Increase the `point_id` by one. ```{important} The `point_id` is an identifier for the current point in the scan. It is used later on to bundle and correlate device readings. It is crucial that the `point_id` is increased by one for each point in the scan as as seen in the default implementation of the `_at_each_point` method.