Skip to content

0.8.0

Latest
Compare
Choose a tag to compare
@github-actions github-actions released this 19 Dec 11:27

Breaking Changes

  • Specific interfaces (e.g. EPICS, Tango) now inherit a new TransportAdapter class and Backend has been repurposed as the internal logic where a controller is combined with a transport. Module fastcs.backends -> fastcs.transport
    • To update: Replace backends with transport in imports. Some internals of specific transports have also been moved around.
  • Mapping has been removed. This was already made unnecessary in the public API, but drivers could still be using it.
    • To update: Controller should be passed directly where Mapping was used previously.

New Features

  • Rest and GraphQL transports (backend has been renamed to transport)
  • New API to simplify the main entrypoint of drivers. This will automatically create a schema for the controller, as well as any available transports, as CLI arguments so that the parameters can be provided by a yaml config. This may be streamlined even more in a future release by adding a main entrypoint to FastCS itself by providing an additional argument to define what controller to import.
from fastcs import launch
from controller import MyController
...

def main():
    launch(MyController)


if __name__ == "__main__":
    main()

Or, to expose configuration as CLI options, use the FastCS class to run the application

...
app = typer.Typer()

@app.command()
def ioc(pv_prefix: str, ip: str, port: int):
    controller = MyController(ip, port)
    options = EpicsOptions(ioc=EpicsIOCOptions(pv_prefix=pv_prefix))
    FastCS(controller, options).run()


if __name__ == "__main__":
    app()
  • New root_attribute field on SubController. If set, this attribute will be added to the parent controller to represent the state of the SubController overall.
  • BaseController.attributes dict that can be used in preference to setattr(...) to add attributes during initialisation.
  • New Attribute.initial_value to set the attribute to something other than the default for its datatype.
  • Update.update_period is now nullable. If set to None (now the default) then the update method will not be called.
  • Allow attributes created without a Handler to allow setting and getting values internally without the need to send anything to a device
  • New Attribute.description to add a description for the attribute to the value / ui / docs of the transport (depending on the transport)
  • New Attribute.add_update_datatype_callback to enable a transport to add hooks to be run by the attribute when its datatype changes at runtime

What's Changed

New Contributors

Full Changelog: 0.7.0...0.8.0