Skip to content
Merged
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion src/ophyd_async/epics/pmac/_pmac_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
DEFAULT_TIMEOUT,
AsyncStatus,
Device,
Reference,
error_if_none,
gather_dict,
observe_value,
Expand Down Expand Up @@ -52,13 +53,17 @@ class PmacTrajectoryTriggerLogic(
Flyable,
):
def __init__(self, pmac: PmacIO, name: str = "") -> None:
self.pmac = pmac
self._pmac_ref = Reference(pmac)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just do:

Suggested change
self._pmac_ref = Reference(pmac)
self.pmac_ref = Reference(pmac)

and remove the @property? Then everywhere that references .pmac should use .pmac_ref().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

self._next_pvt: PVT | None
self._loaded: int = 0
self._trajectory_status: AsyncStatus | None = None
self._prepare_context: PmacPrepareContext | None = None
super().__init__(name=name)

@property
def pmac(self) -> PmacIO:
return self._pmac_ref()

@AsyncStatus.wrap
async def prepare(self, value: Spec[Motor]):
path = Path(value.calculate())
Expand Down
Loading