ophyd_async.core.save_device#

ophyd_async.core.save_device(device: ~ophyd_async.core.device.Device, path: str, sorter: ~typing.Callable[[~typing.Dict[str, ~typing.Any]], ~typing.Sequence[~typing.Dict[str, ~typing.Any]]] = <function all_at_once>, ignore: ~typing.List[str] | None = None)[source]#

Plan that saves the state of all PV’s on a device using a sorter.

The default sorter assumes all saved PVs can be loaded at once, and therefore can be saved at one time, i.e. all PVs will appear on one list in the resulting yaml file.

This can be a problem, because when the yaml is ingested with ophyd_async.core.load_device(), it will set all of those PVs at once. However, some PV’s need to be set before others - this is device specific.

Therefore, users should consider the order of device loading and write their own sorter algorithms accordingly.

See ophyd_async.panda.phase_sorter() for a valid implementation of the sorter.

Parameters:
  • device (Device) – The device whose PVs should be saved.

  • path (str) – The path where the resulting yaml should be saved to

  • sorter (Callable[[Dict[str, Any]], Sequence[Dict[str, Any]]])

  • ignore (Optional[List[str]])