Skip to content

Notes on BEST PRACTICES DRAFT #2

Description

@danielballan

This is excellent! Just a couple notes from a quick read....

Under Tenet 3:

name = "CL_calibration_{energy_energy}eV_pd{pin_diode_current2_mean_value}_bpm2{xbpm2_sumX}_bpm3{xbpm3_sumX}_"
@bpp.run_decorator(md={'sample_name': name})

IMO that should be a sample dict not a sample name string with a bunch of content glommed into an underscore-separated bundle.

Under the canonical shape, avoid calling ophyd methods like position and put() directly in a plan. These methods perform I/O directly, rather than emitting a Msg describing what they want the RunEngine to do. Direct ophyd calls break tools that consume the plan to check it without the intent to actually touch hardware.

That is:

                incident_angle.put(piezo.th.position)

should be

                pos = yield from rd(piezo.th.readback)  # I'm guessing about 'readback'
                yield from abs_set(incident_angle, pos)

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