diff --git a/socs/agents/lakeshore240/agent.py b/socs/agents/lakeshore240/agent.py index e5462a3c6..494b33959 100644 --- a/socs/agents/lakeshore240/agent.py +++ b/socs/agents/lakeshore240/agent.py @@ -5,14 +5,14 @@ import traceback import warnings from dataclasses import dataclass -from typing import ( Any, Dict, Optional, ) +from typing import Any, Dict, Optional import txaio # type: ignore from ocs import ocs_agent, site_config from ocs.ocs_twisted import Pacemaker from socs.Lakeshore.Lakeshore240 import Module -from socs.util import BaseAction, register_task_from_action, OcsOpReturnType +from socs.util import BaseAction, OcsOpReturnType, register_task_from_action txaio.use_twisted() @@ -26,6 +26,7 @@ class LS240Action(BaseAction): def process(self, module: Module) -> None: raise NotImplementedError + @dataclass class UploadCalCurve(LS240Action): """upload_cal_curve(channel, filename) @@ -50,6 +51,7 @@ def process(self, module: Module) -> None: time.sleep(0.1) raise Exception("TEST") + @dataclass class SetValues(LS240Action): """set_values(channel, sensor=None, auto_range=None, range=None,\ @@ -108,6 +110,7 @@ def process(self, module: Module) -> None: ) time.sleep(0.1) + class LS240_Agent: def __init__( self, diff --git a/socs/util.py b/socs/util.py index 0f57f8e7e..70b8f3841 100644 --- a/socs/util.py +++ b/socs/util.py @@ -1,18 +1,8 @@ -import hashlib import dataclasses -from typing import ( - Optional, - Dict, - Any, - Type, - Callable, - Tuple, - get_origin, - get_args, - Union, - TypeVar, -) +import hashlib import time +from typing import (Any, Callable, Dict, Optional, Tuple, Type, TypeVar, Union, + get_args, get_origin) from ocs import ocs_agent