Skip to content

Commit

Permalink
Merge branch 'main' into dark_current_shutter
Browse files Browse the repository at this point in the history
  • Loading branch information
canismarko authored Dec 16, 2024
2 parents 18a004c + 389c4d5 commit dc4093e
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies:
- bluesky-adaptive
- bluesky >=1.8.1
- ophyd >=1.6.3
- ophyd-async >=0.8.0a5
- ophyd-async >=0.9.0a1
- apstools == 1.6.20 # Leave at 1.6.20 until this is fixed: https://github.com/BCDA-APS/apstools/issues/1022
- pcdsdevices # For extra signal types
- pydm >=1.18.0
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/tests/test_grid_scan_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest
from bluesky_queueserver_api import BPlan
from ophyd_async.core import set_mock_value
from ophyd_async.testing import set_mock_value
from qtpy import QtCore

from firefly.plans.grid_scan import GridScanDisplay
Expand Down
2 changes: 1 addition & 1 deletion src/firefly/tests/test_line_scan_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from bluesky_queueserver_api import BPlan
from ophyd_async.core import set_mock_value
from ophyd_async.testing import set_mock_value
from qtpy import QtCore

from firefly.plans.line_scan import LineScanDisplay
Expand Down
34 changes: 17 additions & 17 deletions src/haven/devices/srs570.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,27 +302,27 @@ class GainMode(StrictEnum):
LOW_DRIFT = "LOW DRIFT"

class SensValue(StrictEnum):
_1 = "1"
_2 = "2"
_5 = "5"
_10 = "10"
_20 = "20"
_50 = "50"
_100 = "100"
_200 = "200"
_500 = "500"
ONE = "1"
TWO = "2"
FIVE = "5"
TEN = "10"
TWENTY = "20"
FIFTY = "50"
ONE_HUNDRED = "100"
TWO_HUNDRED = "200"
FIVE_HUNDRED = "500"

class SensUnit(StrictEnum):
pA_V = "pA/V"
nA_V = "nA/V"
uA_V = "uA/V"
mA_V = "mA/V"
PICOAMP_PER_VOLT = "pA/V"
NANOAMP_PER_VOLT = "nA/V"
MICROAMP_PER_VOLT = "uA/V"
MILLIAMP_PER_VOLT = "mA/V"

class OffsetUnit(StrictEnum):
pA = "pA"
nA = "nA"
uA = "uA"
mA = "mA"
PICOAMP = "pA"
NANOAMP = "nA"
MICROAMP = "uA"
MILLIAMP = "mA"

def __init__(self, prefix: str, name: str = ""):
"""
Expand Down
5 changes: 1 addition & 4 deletions src/haven/devices/xray_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(
stop_signal: Signal,
done_signal: Signal = None,
name: str = "",
min_move: float = 0.0,
):
with self.add_children_as_readables(StandardReadableFormat.HINTED_SIGNAL):
self.readback = epics_signal_rw(float, f"{prefix}M.VAL")
Expand All @@ -64,7 +63,7 @@ def __init__(
self.done = derived_signal_r(
int, derived_from={"parent_signal": done_signal}
)
super().__init__(name=name, min_move=min_move)
super().__init__(name=name)


class PlanarUndulator(StandardReadable):
Expand Down Expand Up @@ -115,7 +114,6 @@ def __init__(self, prefix: str, name: str = ""):
actuate_signal=self.start_button,
stop_signal=self.stop_button,
done_signal=self.busy,
min_move=0.010,
)
self.energy_taper = UndulatorPositioner(
prefix=f"{prefix}TaperEnergy",
Expand All @@ -128,7 +126,6 @@ def __init__(self, prefix: str, name: str = ""):
actuate_signal=self.start_button,
stop_signal=self.stop_button,
done_signal=self.busy,
min_move=0.004,
)
self.gap_taper = UndulatorPositioner(
prefix=f"{prefix}TaperGap",
Expand Down
4 changes: 2 additions & 2 deletions src/haven/positioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def __init__(
self.put_complete = put_complete
super().__init__(name=name)

def set_name(self, name: str):
def set_name(self, name: str, *args, **kwargs):
super().set_name(name)
# Readback should be named the same as its parent in read()
self.readback.set_name(name)
self.readback.set_name(name, *args, **kwargs)

def watch_done(
self, value, done_event: asyncio.Event, started_event: asyncio.Event
Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_energy_positioner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

import pytest
from ophyd_async.core import get_mock_put, set_mock_value
from ophyd_async.testing import get_mock_put, set_mock_value

from haven.devices.energy_positioner import EnergyPositioner
from haven.devices.xray_source import BusyStatus
Expand Down
3 changes: 2 additions & 1 deletion src/haven/tests/test_ion_chamber.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import numpy as np
import pytest
from numpy.testing import assert_allclose
from ophyd_async.core import TriggerInfo, assert_value, get_mock_put, set_mock_value
from ophyd_async.core import TriggerInfo
from ophyd_async.testing import assert_value, get_mock_put, set_mock_value

from haven.devices.ion_chamber import IonChamber

Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import pytest
from bluesky.protocols import Flyable
from ophyd_async.core import get_mock_put
from ophyd_async.testing import get_mock_put

from haven.devices.motor import HavenMotor
from haven.devices.motor import Motor as AsyncMotor
Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_positioner.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import asyncio

import pytest
from ophyd_async.core import get_mock_put, set_mock_value
from ophyd_async.epics.core import epics_signal_r, epics_signal_rw, epics_signal_x
from ophyd_async.testing import get_mock_put, set_mock_value

from haven.positioner import Positioner

Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_save_motor_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import pandas as pd
import pytest
import time_machine
from ophyd_async.core import set_mock_value
from ophyd_async.testing import set_mock_value
from tiled.adapters.mapping import MapAdapter
from tiled.adapters.xarray import DatasetAdapter
from tiled.client import Context, from_context
Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_shutter.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest
from ophyd.utils.errors import ReadOnlyError
from ophyd_async.core import get_mock_put, set_mock_value
from ophyd_async.testing import get_mock_put, set_mock_value

from haven.devices.shutter import PssShutter, ShutterState

Expand Down
3 changes: 2 additions & 1 deletion src/haven/tests/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from unittest.mock import MagicMock

import pytest
from ophyd_async.core import Device, DeviceVector, get_mock_put
from ophyd_async.core import Device, DeviceVector
from ophyd_async.core._signal import soft_signal_rw
from ophyd_async.epics.core import epics_signal_rw, epics_signal_x
from ophyd_async.testing import get_mock_put

from haven.devices.signal import derived_signal_rw, derived_signal_x

Expand Down
4 changes: 2 additions & 2 deletions src/haven/tests/test_srs570.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest import mock

import pytest
from ophyd_async.core import get_mock_put
from ophyd_async.testing import get_mock_put

from haven.devices.srs570 import GainSignal, SRS570PreAmplifier

Expand Down Expand Up @@ -112,7 +112,7 @@ async def preamp():

async def test_preamp_signals(preamp):
# Check the enums
await preamp.sensitivity_value.set(SRS570PreAmplifier.SensValue._5)
await preamp.sensitivity_value.set(SRS570PreAmplifier.SensValue.FIVE)


@pytest.mark.parametrize("gain_mode", gain_modes)
Expand Down
2 changes: 1 addition & 1 deletion src/haven/tests/test_xray_source.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import asyncio

import pytest
from ophyd_async.core import get_mock_put, set_mock_value
from ophyd_async.testing import get_mock_put, set_mock_value

from haven.devices.xray_source import BusyStatus, PlanarUndulator

Expand Down

0 comments on commit dc4093e

Please sign in to comment.