Skip to content

Commit

Permalink
roll back some changes not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-dot committed Jul 24, 2024
1 parent 4e5b263 commit 9c08079
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 31 deletions.
9 changes: 6 additions & 3 deletions src/dodal/beamlines/i22.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@
)


def saxs() -> PilatusDetector:
return NXSasPilatus(
def saxs(
wait_for_connection: bool = True, fake_with_ophyd_sim: bool = False
) -> PilatusDetector:
return device_instantiation(
NXSasPilatus,
"-EA-PILAT-01:",
name="saxs",
directory_provider=get_directory_provider(),
drv_suffix="CAM:",
hdf_suffix="HDF5:",
metadata_holder=NXSasMetadataHolder(
Expand All @@ -57,6 +59,7 @@ def saxs() -> PilatusDetector:
sensor_thickness=(0.45, "mm"),
distance=(4711.833684146172, "mm"),
),
directory_provider=get_directory_provider(),
)


Expand Down
29 changes: 1 addition & 28 deletions src/dodal/common/beamlines/beamline_utils.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import inspect
from typing import (
Callable,
Dict,
Final,
List,
Optional,
Protocol,
TypeVar,
cast,
)
from typing import Callable, Dict, Final, List, Optional, TypeVar, cast

from bluesky.run_engine import call_in_bluesky_event_loop
from ophyd import Device as OphydV1Device
from ophyd.sim import make_fake_device
from ophyd_async.core import DEFAULT_TIMEOUT
from ophyd_async.core import Device as OphydV2Device
from ophyd_async.core import wait_for_connection as v2_device_wait_for_connection

Expand Down Expand Up @@ -75,23 +65,6 @@ def wait_for_connection(

T = TypeVar("T", bound=AnyDevice)

D = TypeVar("D", bound=OphydV2Device, covariant=True)


class DeviceFactory(Protocol[D]):
def __call__(
self, connect: bool = False, timeout: float = DEFAULT_TIMEOUT
) -> D: ...


F = Callable[[], D]

_device_is_lazy: Dict[DeviceFactory, bool] = {}


def get_device_factories() -> Dict[DeviceFactory, bool]:
return _device_is_lazy.copy()


@skip_device()
def device_instantiation(
Expand Down

0 comments on commit 9c08079

Please sign in to comment.