bluesky / ophyd

hardware abstraction in Python with an emphasis on EPICS
https://blueskyproject.io/ophyd
BSD 3-Clause "New" or "Revised" License
49 stars 78 forks source link

TYPO should be lower case to be consistent with others in this module #1211

Closed prjemian closed 1 week ago

prjemian commented 1 week ago

Somehow, this missed testing. A long time ago.

    tetramm = TetrAMM("8idTetra:QUAD1:", name="tetramm")
    for axis in "x y".split():
        for attr_name in "offset offset_calc scale".split():
            getattr(tetramm, f"position_{attr_name}_{axis}").kind = "config"
AttributeError: position_scale_y
prjemian commented 1 week ago

We can get by without this change (which might break existing usage) with:

    for attr_name in tetramm.component_names:
        attr = getattr(tetramm, attr_name)
        if attr_name.startswith("current_"):
            for ch_name in attr.component_names:
                getattr(attr, ch_name).kind = "config"
        elif attr_name.startswith("position_"):
            attr.kind = "config"

But for sure, all these components need to be kind="config".