Skip to content

Commit 8e04b07

Browse files
committed
feat: add scan modifier
1 parent b86a457 commit 8e04b07

2 files changed

Lines changed: 14 additions & 17 deletions

File tree

bec_testing_plugin/scans/scan_customization/scan_components.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,8 @@
55
These components can be used to encapsulate reusable logic, interact with devices, or perform specific actions during the scan lifecycle.
66
"""
77

8-
98
from bec_server.scan_server.scans.scan_components import ScanComponents
109

1110

12-
1311
class BecTestingPluginScanComponents(ScanComponents):
1412
"""Scan components for bec_testing_plugin."""

bec_testing_plugin/scans/scan_customization/scan_modifier.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@
77
modifier plugin that runs multiple actions in sequence with conditional logic to determine which actions to run based on the scan context.
88
"""
99

10-
from bec_server.scan_server.scans.scan_modifier import ScanModifier, scan_hook_impl
10+
from typing import Any
1111

12+
from bec_server.scan_server.scans.scan_modifier import ScanModifier
1213

1314

1415
class BecTestingPluginScanModifier(ScanModifier):
1516
"""
1617
Scan modifier for bec_testing_plugin.
17-
18+
1819
By inheriting from the ScanModifier base class, you get access to currently running scan (self.scan), the devices (self.dev), the scan info (self.scan_info),
1920
the scan components (self.components) and the scan actions (self.actions).
2021
"""
2122

22-
def __init__(self, **kwargs):
23-
"""Initialize the scan modifier."""
24-
super().__init__(**kwargs)
25-
26-
# Example of running code before the scan stage for a specific scan
27-
# @scan_hook_impl("stage", "before")
28-
# def before_stage(self):
29-
# """Run before the stage hook."""
30-
# self.actions.send_client_info("Custom stage logic executed by ScanModifier.")
31-
# if self.scan_info.scan_name == "example_scan":
32-
# self.dev.samx.set(20)
33-
34-
23+
# @staticmethod
24+
# def scan_signature_overrides(
25+
# scan_name: str, arguments: dict[str, Any | None], defaults: dict[str, Any]
26+
# ) -> tuple[dict, dict]:
27+
# if "relative" in arguments:
28+
# arguments.pop("relative", None)
29+
# defaults["relative"] = False
30+
# if scan_name == "custom_testing_scan":
31+
# arguments.pop("settling_time", None)
32+
# defaults.pop("settling_time", None)
33+
# return arguments, defaults

0 commit comments

Comments
 (0)