Skip to content

Commit

Permalink
(#117) (#45) update sim motor
Browse files Browse the repository at this point in the history
  • Loading branch information
dperl-dls committed Apr 19, 2024
1 parent c0ab271 commit 493ba2a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ophyd_async/core/async_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def _notify_watchers_from(self, iterator: AsyncIterator[WatcherUpdate[T]])
async for update in iterator:
self._last_update = (
update
if update.time_elapsed is None
if update.time_elapsed is not None
else replace(update, time_elapsed=time.monotonic() - self._start)
)
for watcher in self._watchers:
Expand Down
2 changes: 1 addition & 1 deletion src/ophyd_async/sim/demo/sim_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def set(self, new_position: float, timeout: Optional[float] = None) -> AsyncStat
"""
watchers: List[Callable] = []
coro = asyncio.wait_for(self._move(new_position, watchers), timeout=timeout)
return AsyncStatus(coro, watchers)
return AsyncStatus(coro)

async def _move(self, new_position: float, watchers: List[Callable] = []):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/sim/demo/test_sim_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ async def test_move_sim_in_plan():
RE = RunEngine()

async with DeviceCollector():
m1 = SimMotor("M1", "sim_motor1")
m2 = SimMotor("M2", "sim_motor2")
m1 = SimMotor("M1")
m2 = SimMotor("M2")

my_plan = spiral_square([], m1, m2, 0, 0, 4, 4, 10, 10)

Expand Down

0 comments on commit 493ba2a

Please sign in to comment.