pcdshub / happi

Heuristic Access to Positions of Photon Instruments
https://pcdshub.github.io/happi/master
Other
13 stars 29 forks source link

ENH: add post-md-set hook to loader #308

Closed tangkong closed 1 year ago

tangkong commented 1 year ago

Description

Adds a hook to allow code to be run on the object after the .md attribute is set. This would allow the loaded object to interact with its metadata.

Motivation and Context

Most recently https://github.com/pcdshub/pcdsdevices/pull/1132/, but also the lightpath input/output branches setting in pcdsdevices previously (link)

Previously, we've hooked the .md setter to do some operations after happi attempts to set the .md attribute. This has caused (me) confusion, and unless thoroughly annotated the purpose of the setter is not clear (mostly to me with my goldfish memory)

How Has This Been Tested?

Added a quick test

Where Has This Been Documented?

Here, and pre-release notes eventually

Pre-merge checklist

tangkong commented 1 year ago

This dropped off my radar, whoops. Added the docs