Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linting #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ophyd_async/devices/areadetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ async def stage(self) -> None:

@AsyncStatus.wrap
async def trigger(self) -> None:
await self.drv.acquire.set(1)
await self.drv.acquire.set(True)


class FileWriteMode(str, Enum):
Expand Down Expand Up @@ -160,7 +160,7 @@ async def flush_and_publish(self, hdf: NDFileHDF):
event_count = num_captured - self._last_emitted
if event_count:
self._append_datum(event_count)
await hdf.flush_now.set(1)
await hdf.flush_now.set(True)
self._last_flush = time.monotonic()
if time.monotonic() - self._last_flush > FRAME_TIMEOUT:
raise TimeoutError(f"{hdf.name}: writing stalled on frame {num_captured}")
Expand Down Expand Up @@ -273,7 +273,7 @@ async def complete(self) -> None:
@AsyncStatus.wrap
async def unstage(self) -> None:
# Already done a caput callback in _capture_status, so can't do one here
await self.hdf.capture.set(0, wait=False)
await self.hdf.capture.set(False, wait=False)
assert self._capture_status, "Stage not run"
await self._capture_status
await super().unstage()
5 changes: 4 additions & 1 deletion src/ophyd_async/devices/panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from p4p.client.thread import Context

from ophyd_async.core.backends import SimSignalBackend
from ophyd_async.core.backends.signal_backend import SignalBackend
from ophyd_async.core.devices import Device, DeviceVector
from ophyd_async.core.signals import (
Signal,
Expand Down Expand Up @@ -215,7 +216,9 @@ async def _make_block(
signal = self._make_signal(entry, args[0] if len(args) > 0 else None)

else:
backend = SimSignalBackend(args[0] if len(args) > 0 else None, block_pv)
backend: SignalBackend = SimSignalBackend(
args[0] if len(args) > 0 else None, block_pv
)
signal = SignalX(backend) if not origin else origin(backend)

setattr(block, sig_name, signal)
Expand Down
10 changes: 6 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import pytest
from bluesky.run_engine import RunEngine, TransitionError

RECORD = str(Path(__file__).parent / "devices" / "db" / "panda.db")
current_folder = Path(__file__).parent

RECORD = str(current_folder / "devices" / "db" / "panda.db")
INCOMPLETE_BLOCK_RECORD = str(
Path(__file__).parent / "devices" / "db" / "incomplete_block_panda.db"
current_folder / "devices" / "db" / "incomplete_block_panda.db"
)
INCOMPLETE_RECORD = str(Path(__file__).parent / "devices" / "db" / "incomplete_panda.db")
EXTRA_BLOCKS_RECORD = str(Path(__file__).parent / "devices" / "db" / "extra_blocks_panda.db")
INCOMPLETE_RECORD = str(current_folder / "devices" / "db" / "incomplete_panda.db")
EXTRA_BLOCKS_RECORD = str(current_folder / "devices" / "db" / "extra_blocks_panda.db")


@pytest.fixture(scope="function")
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/test_area_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import bluesky.plans as bp
import bluesky.preprocessors as bpp
import pytest

from ophyd_async.core.device_collector import DeviceCollector
from ophyd_async.core.signals import set_sim_put_proceeds, set_sim_value

from ophyd_async.devices.areadetector import (
ADDriver,
FileWriteMode,
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/test_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import pytest
from bluesky.protocols import Reading

from ophyd_async.core.device_collector import DeviceCollector
from ophyd_async.core.signals import set_sim_put_proceeds, set_sim_value

from ophyd_async.devices import motor

# Long enough for multiple asyncio event loop cycles to run so
Expand Down
2 changes: 1 addition & 1 deletion tests/devices/test_panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import numpy as np
import pytest
from ophyd_async.core.device_collector import DeviceCollector

from ophyd_async.core.device_collector import DeviceCollector
from ophyd_async.devices.panda import PandA, PVIEntry, SeqTable, SeqTrigger, pvi_get


Expand Down
Loading