Breaking Changes
EpicsCAIOCoptionsparameter removed - Theoptionsparameter has been removed fromEpicsCAIOC(pv_prefix, controller_api, options=...)- Pass EPICS options via the transport config instead.
AttrR.update()validates before calling callbacks - If validation fails, an error is logged and the value is not updated.DATATYPE_DTYPESremoved - Replaced by theDTypeunion.- use
DTypeinstead.
- use
bind_loggerremoved from public API -bind_loggerhas been removedfrom fastcs.logging import bind_logger; bind_logger(...)->from fastcs.logging import logger
ControllerVectoris now generic onController_TControllerVectormust now be parameterised with a specificController
add_on_update_callback(always=False)-alwaysflag added toAttrR.add_on_update_callbackto 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 wasalways=True.
Fixes
AttrRWsetpoint callbacks called with validated value - Sync setpoint callbacks inAttrRWnow receiveself._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. This allows serving 2D waveforms in PVA alongside CA.
New Features
AttrR.wait_for_value/wait_for_predicate- New async methods onAttrRto 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 allDataTypesubclasses to compare values correctly (e.g. usingnp.array_equalfor array types).DTypeunion type - Replaces the oldDATATYPE_DTYPEStuple.DTypeis a proper union type alias;DType_Tis nowTypeVar("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.connectmethods must now setself._connected = True, andController.reconnectshould be implemented to restore the connection for scan tasks - by defaultreconnectwill just start the scan tasks again reconnect()can be called in the interactive shell, or a driver can implement a@scanmethod that checks for disconnect and automatically handles reconnection.
- Note: To make use of this overridden
- Logger uses file path and line numbers - Log messages now include source file path and line number for easier debugging.
Other
- Package rename:
FastCS→fastcs
What's Changed
- Escape
<in logging extras so they aren't treated as colour tags by @GDYendell in #279 - Improve Attribute hint validation and add Controller hint validation by @GDYendell in #281
- Log exceptions in failed scan tasks by @GDYendell in #282
- Add AttrR wait_for_value by @GDYendell in #284
- Correctly implement DType and DType_T by @GDYendell in #285
- Add DataType equal and all_equal helpers by @GDYendell in #289
- Fix command buttons in pva transport by @GDYendell in #294
- Refactor Methods to allow overridding
@commandmethods by @GDYendell in #293 - Implement Waveform by @GDYendell in #247
- Pass precision to widget for Int and Float by @GDYendell in #299
- Windows: add guards for some methods that don't work/exist on windows by @Tom-Willemsen in #295
- Set AttrW after Put in pva transport by @shihab-dls in #292
- Update to copier template 5.0.1 by @GDYendell in #302
- Add historical ADRs by @GDYendell in #305
- Add access_mode property to Attribute classes (#260) by @GDYendell in #307
- Add
alwaysflag to add_on_update_callback by @shihab-dls in #311 - Call sync setpoint callbacks with validated value by @GDYendell in #315
- Improve String validation by @GDYendell in #317
- Handle unsupported Waveforms with warning messages by @GDYendell in #316
- Remove unused options parameter from EpicsCAIOC by @JamesOHeaDLS in #322
- Pass attribute instead of datatype into _get_read_widget by @jacob720 in #321
- Refactor EPICS CA record creation by @ajgdls in #319
- 313 make logger use file path and line by @JamesOHeaDLS in #323
- Log error when AttrR fails to validate value in update by @GDYendell in #330
- Validate hinted methods by @shihab-dls in #320
- Make ControllerVector generic on Controller_T by @shihab-dls in #326
- Improve handling of failed scan tasks and allow reconnect by @GDYendell in #332
- Update to copier 5.0.2 and rename FastCS -> fastcs by @GDYendell in #335
New Contributors
- @Tom-Willemsen made their first contribution in #295
- @jacob720 made their first contribution in #321
Full Changelog: 0.11.3...0.12.0