Skip to content

Releases: DiamondLightSource/fastcs

0.12.0

09 Mar 11:47
afcbf45

Choose a tag to compare

Breaking Changes

  • EpicsCAIOC options parameter removed - The options parameter has been removed from EpicsCAIOC(pv_prefix, controller_api, options=...)
    • Pass EPICS options via the transport config instead.
  • on_update is now blocking by default - Previously on_update callbacks were non-blocking; they are now awaited before proceeding. This can change timing behaviour.
  • AttrR.update() validates before calling callbacks - If validation fails, an error is logged and the value is not updated.
  • DATATYPE_DTYPES removed - Replaced by the DType union.
    • use DType instead.
  • bind_logger removed from public API - bind_logger has been removed
    • from fastcs.logging import bind_logger; bind_logger(...) -> `from fastcs.logging import logger
  • ControllerVector is now generic on Controller_T
    • ControllerVector must now be parameterised with a specific Controller
  • add_on_update_callback(always=False) - always flag added to AttrR.add_on_update_callback to let callbacks fire even when the value hasn't changed. The default is now to not fire the callback if the value has not changed, the previous behaviour was always=True.

Fixes

  • AttrRW setpoint callbacks called with validated value - Sync setpoint callbacks in AttrRW now receive self._value (the validated value) rather than the raw input.
  • 2D+ Waveforms skipped in EPICS CA - Multi-dimensional waveforms are skipped (with a warning) in the EPICS CA transport rather than raising an error or being handled incorrectly.

New Features

  • AttrR.wait_for_value / wait_for_predicate - New async methods on AttrR to block until an attribute reaches a target value or satisfies a custom predicate, with a timeout.
  • DataType.equal / DataType.all_equal - Static helper methods on all DataType subclasses to compare values correctly (e.g. using np.array_equal for array types).
  • DType union type - Replaces the old DATATYPE_DTYPES tuple. DType is a proper union type alias; DType_T is now TypeVar("DType_T", bound=DType).
  • Improved scan task handling / reconnect - Scan tasks are now paused on exception and can be restarted with Controller.reconnect, rather than requiring restarting the entire application.
    • Note: To make use of this overridden Controller.connect methods must now set self._connected = True, and Controller.reconnect should be implemented to restore the connection for scan tasks - by default reconnect will just start the scan tasks again
    • reconnect() can be called in the interactive shell, or a driver can implement a @scan method that checks for disconnect and automatically handles reconnection.
  • Logger uses file path and line numbers - Log messages now include source file path and line number for easier debugging.

Other

  • Package rename: FastCSfastcs

What's Changed

New Contributors

Full Changelog: 0.11.3...0.12.0

0.12.0a2

05 Mar 15:29
5fc0836

Choose a tag to compare

0.12.0a2 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: 0.12.0a1...0.12.0a2

0.12.0a1

22 Dec 14:32
aad1a85

Choose a tag to compare

0.12.0a1 Pre-release
Pre-release

What's Changed

Full Changelog: 0.11.3...0.12.0a1

0.11.3

02 Dec 10:41
db37f8b

Choose a tag to compare

What's Changed

Full Changelog: 0.11.2...0.11.3

0.11.2

01 Dec 14:43
1a11c3a

Choose a tag to compare

What's Changed

Full Changelog: 0.11.1...0.11.2

0.11.1

27 Nov 14:44
56dccba

Choose a tag to compare

What's Changed

  • Add stdio-socket to dependencies for use in containers by @GDYendell in #276

Full Changelog: 0.11.0...0.11.1

0.11.0

24 Nov 16:02
0f75fa1

Choose a tag to compare

Summary

  • Updater, Sender and Handler have been replaced with AttributeIO and AttributeIORef
    • This removes the circular dependency of Controller -> Attribute -> Handler -> Controller and simplifies the API for writing drivers
  • TransportOptions and TransportAdapter merged into Transport. Transports are now constructed with options and passed into FastCS directly
  • Backend merged into FastCS
  • SubControllers have been removed. There is now no special handling required for controllers that will be registered as sub controllers - Controller can be registered as a sub controller.
  • Controllers are now attributes of a parent Controller and can be registered and accessed with the dot accessor
  • @put methods have been removed
  • New Controller.disconnect hook added to allow clean up just before the application stops
  • New logging and tracing frameworks
    • Use fastcs.logging.logger for debug, info, warning, error with nice formatting
    • Call fastcs.logging.configure_logging to enable logging (default level info)
    • Use Tracer for trace level logging that can be configured on the console at runtime per object (e.g. attr.enable_tracing()). Some classes (Attribute, AttributeIO, Controller) inherit this, so they have self.log_event for trace messages. For other cases inherit Tracer or add a module level Tracer
    • Call fastcs.logging.configure_logging(LogLevel.TRACE) so that enabled trace logging is displayed
  • Attribute(description=) will now be passed to pvi to use as the label hover text
  • ControllerVector added to represent a set of sub controllers distinguished by and index. e.g. Odin: N FrameProcessors or PandA: N CALC blocks.
  • Type hints on controller classes are now validated at runtime to check they have been populated
  • Simplified module structure
  • Many other fixes and improvements

Breaking Changes

  • Packaging
    • Update fastcs requirement to include the desired transports, e.g. fastcs[epicsca]
  • Handlers
    • Split classes inheriting Updater / Sender / Handler into AttributeIORef with the static properties and AttributeIO with update and send (previously put) methods
    • Remove initialise method
    • Update Controller to create instances of the AttributeIOs required by its attributes. Pass down to any sub controllers that also need them. The connection used by the IO can be passed in at this point (or anything else required) to use in update and send instead of being passed the whole controller
    • Update created attributes to take io_ref=MyAttributeIORef() instead of handler/sender/updater=MyHandler()
  • Attributes
    • Remove SimpleHandler() from attributes - this is now the default behavior if an attribute is not passed io_ref
    • Change attr.set -> attr.update
    • Change attr.process -> attr.put(sync_setpoint=True)
    • Change attr.process_without_display_update -> attr.put
    • Change attr.update_display_without_process -> attr.put
    • Change attr.add_on_set_callback -> attr.add_on_update_callback
    • Change attr.add_write_display_callback -> attr.add_sync_setpoint_callback
    • Change attr.add_process_callback -> attr.add_on_put_callback
  • Transport
    • Update to pass (e.g.) EpicsCATransport instead of EpicsTransportOptions, with the same arguments, to FastCS
    • Remove calls to create_docs and create_gui. If options for these are provided then these methods will be called automatically
  • SubController
    • Update any classes inheriting SubController to inherit Controller
    • Change register_sub_controller -> add_sub_controller or assignment with the dot accessor (self.<sub_controller_name> = <sub_controller>)
  • Controller
    • Attempting to overwrite an Attribute now raises a RuntimeError, even if the type and access mode match. To statically type hint an Attribute to be validated during initialisation, only specify the type hint on the class - do not create a default instance, e.g. attr: AttrRW[int], not attr = AttrRW(Int()).
    • Controller.attributes is now a read-only view. Use Controller.add_attribute("<attr_name>", <attr>) or direct assignment (controller.<attr_name> = <attr>) to create Attributes, which will perform validation and attach them to the controller to use in the interactive shell.
  • Imports
    • from fastcs.attribute_io -> from fastcs.attributes
    • from fastcs.attribute_io_ref -> from fastcs.attributes
    • from fastcs.controller -> from fastcs.controllers
    • from fastcs.cs_methods -> from fastcs.methods
    • from fastcs.transport -> from fastcs.transports
    • from fastcs.wrappers -> from fastcs.methods
    • from fastcs.attributes import ONCE -> from fastcs.util import ONCE
    • fastcs.transport.epics.options import EpicsGUIOptions, EpicsIOCOptions -> from fastcs.transports.epics import EpicsGUIOptions, EpicsIOCOptions
    • from fastcs.transport.epics.ca.transport import EpicsCATransport -> from fastcs.transports.epics.ca import EpicsCATransport
    • Rename from fastcs.datatypes import T -> from fastcs.datatypes import DType_T

What's Changed

New Contributors

Full Changelog: 0.10.1...0.11.0

0.11.0a4

18 Nov 15:28
7ddd7d2

Choose a tag to compare

0.11.0a4 Pre-release
Pre-release

Breaking Changes

  • Attempting to overwrite an Attribute now raises a RuntimeError, even if the type and access mode match. To statically type hint an Attribute to be validated during initialisation, only specify the type hint on the class - do not create a default instance, e.g. attr: AttrRW[int], not attr = AttrRW(Int()).
  • Controller.attributes is now a read-only view. Use Controller.add_attribute("<attr_name>", <attr>) or direct assignment (controller.<attr_name> = <attr>) to create Attributes, which will perform validation and attach them to the controller to use in the interactive shell.

What's Changed

Full Changelog: 0.11.0a3...0.11.0a4

0.11.0a3

12 Nov 16:06
aecb4c3

Choose a tag to compare

0.11.0a3 Pre-release
Pre-release

What's Changed

Full Changelog: 0.11.0a2...0.11.0a3

0.11.0a2

07 Nov 14:36
0f785f4

Choose a tag to compare

0.11.0a2 Pre-release
Pre-release

What's Changed

Full Changelog: 0.11.0a1...0.11.0a2