Skip to content

Alternate Beampath object solution? #18

Description

@kabanaty

Quoting @eloise-nebula's comment from PR #4.

It looks like this code works, but I think I might have solved this problem in a different way. Check out this from my slac-db latest PR slaclab/slac-db#37:

def _build_devices(area, device_type):
    devices = slac_db.device.get_devices(
        area=area, device_type=device_type
    )
    for d in devices:
        if device_type == "INST" and not d.startswith("PMT"):
            continue
        if device_type == "LCAV":
            r = slac_db.oracle.get_device_row(d)
            if r["engineering name"] != "TRANS_DEFL":
                continue
        cs = _build_controls_information(d)
        meta = _build_metadata(area, device_type, d)
        yield d, {
            "controls_information": cs,
            "metadata": meta,
        }

We can rebuild YAML files by area and device type with massively reduced boilerplate. It's already been tested against the current YAML file base. I think it solves a lot of problems this PR is trying to solve.

Metadata

Metadata

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