Documentation: Mention that docstrings are automatically parsed for attributes and feed into AttributeConfiguration.description

From https://tango-controls.slack.com/archives/C034P7HLE3U/p1731417810566899:

It already works that way for the simple case of an attribute defined with the decorator syntax, and > no description kwarg.

def test_attribute_info():

class TestDevice(Device):
    @attribute
    def my_attr1(self) -> float:
        """This is the docstring for my_attr1"""
        return 1.5

    my_attr2 = attribute()

    def read_my_attr2(self) -> float:
        """This docstring won't be used as the description"""
        return 2.5

with DeviceTestContext(TestDevice) as proxy:
    cfg1 = proxy.get_attribute_config("my_attr1")
    assert cfg1.description == "This is the docstring for my_attr1"
    cfg2 = proxy.get_attribute_config("my_attr2")
    assert cfg2.description == "No description"

Can you show an example of the form you want to use? Maybe it could be done...

Assignee Loading
Time tracking Loading