Skip to content

Commit ea7eefb

Browse files
authored
Merge pull request #167 from ISISComputingGroup/fix_rename_workflows
Update workflows & fix pyright issues
2 parents cbbcae6 + 75d8967 commit ea7eefb

File tree

6 files changed

+129
-96
lines changed

6 files changed

+129
-96
lines changed

.github/workflows/Lint-and-test.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
name: Lint-and-test
22
on: [pull_request, workflow_call]
33
jobs:
4-
call-linter-workflow:
5-
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
6-
with:
7-
compare-branch: origin/main
8-
python-ver: '3.11'
94
tests:
105
runs-on: ${{ matrix.os }}
116
strategy:
@@ -20,6 +15,12 @@ jobs:
2015
python-version: ${{ matrix.version }}
2116
- name: install requirements
2217
run: pip install -e .[dev]
18+
- name: run ruff check
19+
run: python -m ruff check
20+
- name: run ruff format
21+
run: python -m ruff format --check
22+
- name: run pyright
23+
run: python -m pyright
2324
- name: run pytest
2425
env:
2526
MPLBACKEND: agg
@@ -28,7 +29,7 @@ jobs:
2829
if: ${{ always() }}
2930
runs-on: ubuntu-latest
3031
name: Final Results
31-
needs: [call-linter-workflow, tests]
32+
needs: [tests]
3233
steps:
3334
- run: exit 1
3435
# see https://stackoverflow.com/a/67532120/4907315

.github/workflows/test-against-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: test-against-main
1+
name: future-dependency-compatibility-test
22
on:
33
schedule:
44
- cron: "0 0 * * *"

src/ibex_bluesky_core/devices/block.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,24 @@
66
from dataclasses import dataclass
77
from typing import Generic, TypeVar
88

9-
from bluesky.protocols import Locatable, Location, NamedMovable, Triggerable
9+
from bluesky.protocols import (
10+
HasName,
11+
Locatable,
12+
Location,
13+
Movable,
14+
NamedMovable,
15+
Triggerable,
16+
)
1017
from ophyd_async.core import (
18+
CALCULATE_TIMEOUT,
1119
AsyncStatus,
20+
CalculatableTimeout,
1221
SignalDatatype,
1322
SignalR,
1423
SignalRW,
1524
StandardReadable,
1625
StandardReadableFormat,
26+
WatchableAsyncStatus,
1727
observe_value,
1828
wait_for_value,
1929
)
@@ -311,7 +321,7 @@ async def locate(self) -> Location[T]:
311321
}
312322

313323

314-
class BlockMot(Motor):
324+
class BlockMot(Motor, Movable[float], HasName):
315325
"""Device representing an IBEX block pointing at a motor."""
316326

317327
def __init__(
@@ -369,6 +379,15 @@ def __repr__(self) -> str:
369379
"""Debug representation of this block."""
370380
return f"{self.__class__.__name__}(name={self.name})"
371381

382+
def set( # pyright: ignore
383+
self, value: float, timeout: CalculatableTimeout = CALCULATE_TIMEOUT
384+
) -> WatchableAsyncStatus[float]:
385+
"""Pass through set to superclass.
386+
387+
This is needed so that type-checker correctly understands the type of set.
388+
"""
389+
return super().set(value, timeout)
390+
372391

373392
def block_r(datatype: type[T], block_name: str) -> BlockR[T]:
374393
"""Get a local read-only block for the current instrument.

src/ibex_bluesky_core/plans/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ def _inner() -> Generator[Msg, None, None]:
6868

6969

7070
def _set_up_fields_and_icc(
71-
block: NamedMovable[Any], dae: "SimpleDae", model: FitMethod, periods: bool, save_run: bool
71+
block: NamedMovable[Any],
72+
dae: "SimpleDae",
73+
model: FitMethod | None,
74+
periods: bool,
75+
save_run: bool,
7276
) -> ISISCallbacks:
7377
fields = [block.name]
7478
if periods:

0 commit comments

Comments
 (0)