labthings_fastapi.computed_properties ===================================== .. py:module:: labthings_fastapi.computed_properties .. autoapi-nested-parse:: Computed properties. A computed property is like a functional property, but it only depends on properties which are observable. This means LabThings is able to recompute it whenever its dependencies change, allowing it to be observed. Functions --------- .. autoapisummary:: labthings_fastapi.computed_properties.computed_property Module Contents --------------- .. py:function:: computed_property(fget: collections.abc.Callable[[labthings_fastapi.properties.Owner], labthings_fastapi.properties.Value]) -> ComputedProperty[labthings_fastapi.properties.Owner, labthings_fastapi.properties.Value] Decorate a method as a computed property. Computed properties are simple functional properties that only depend on other properties of their host Thing. Unlike functional properties, it's possible to observe them for changes, and LabThings will recalculate them automatically when their dependencies change. See :ref:`computed_properties` for full details of how computed properties work and how to use them. :param fget: the getter function, which must depend only on observable properties. :return: a computed property descriptor.