Skip to content

proper procedure for changing setable default #191

Description

@ddkohler

In lab, there was some confusion about how to change a setable, as it is has some differences from working with tunes. Namely, there is no safeguarding alterations to setables--they can be freely changed on an instrument without calling an associated transition or recording its history. Perhaps unintentionally, changing a setable is not considered an update to an instrument, and so you cannot update an instrument by just changing the setable value.

For now, we think the best practice is to wrap the change with an update_merge, that is:

new = attune.Instrument(**old.as_dict())
new.setables["SHG_Crystall"] = 42
newer = attune.update_merge(old, new)
attune.store(newer)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions