Description, motivation and use case
RFHolder already resolves named RF plants and exposes frequency and voltage from DEFAULT_RF_PLANT. The original holder proposal expresses this default RF plant as rf.masterclock, which makes its role explicit and leaves room for other RF plants under the same holder.
This improves readability in control applications that operate on the machine master clock while still supporting named RF plants.
Proposed solution
Add rf.masterclock, returning the RF plant configured as DEFAULT_RF_PLANT:
rf.masterclock.frequency exposes its frequency access.
rf.masterclock.voltage exposes its total-voltage access.
rf.get(name) continues to resolve other RF plants by name.
Retain rf.frequency and rf.voltage as backward-compatible aliases for the corresponding masterclock accessors. Raise a clear PyAMLException when DEFAULT_RF_PLANT is absent.
Describe alternatives you've considered
Keeping only rf.frequency and rf.voltage is compact but hides which configured RF plant they refer to. Making masterclock a separate object would duplicate the RFPlant API and create unnecessary synchronization concerns.
Example
masterclock = sr.live.rf.masterclock
masterclock.frequency.set(499.654e6)
masterclock.voltage.set(2.5e6)
same_frequency = sr.live.rf.frequency
spare_rf_plant = sr.live.rf.get("SPARE_RF_PLANT")
Additional context
Parent issue: ElementHolder API refurbishment #199.
The current RFHolder already implements get(name), frequency, and voltage. This issue introduces the explicit default-plant façade proposed in #199 while retaining the current shortcuts.
Checklist
Description, motivation and use case
RFHolderalready resolves named RF plants and exposes frequency and voltage fromDEFAULT_RF_PLANT. The original holder proposal expresses this default RF plant asrf.masterclock, which makes its role explicit and leaves room for other RF plants under the same holder.This improves readability in control applications that operate on the machine master clock while still supporting named RF plants.
Proposed solution
Add
rf.masterclock, returning the RF plant configured asDEFAULT_RF_PLANT:rf.masterclock.frequencyexposes its frequency access.rf.masterclock.voltageexposes its total-voltage access.rf.get(name)continues to resolve other RF plants by name.Retain
rf.frequencyandrf.voltageas backward-compatible aliases for the corresponding masterclock accessors. Raise a clearPyAMLExceptionwhenDEFAULT_RF_PLANTis absent.Describe alternatives you've considered
Keeping only
rf.frequencyandrf.voltageis compact but hides which configured RF plant they refer to. Makingmasterclocka separate object would duplicate theRFPlantAPI and create unnecessary synchronization concerns.Example
Additional context
Parent issue: ElementHolder API refurbishment #199.
The current
RFHolderalready implementsget(name),frequency, andvoltage. This issue introduces the explicit default-plant façade proposed in #199 while retaining the current shortcuts.Checklist