gather_results#

ams.routines.routine.gather_results(rtn: RoutineBase, data_dict: Dict, items: Dict, attr: str, *, group: bool = False)[source]#

Gather routine results into data_dict for export.

Two output shapes, selected by group:

  • group=False (flat): one entry per device, keyed f'{key} {dev}', values rounded to 6 decimals. Used by RoutineBase.export_csv().

  • group=True (nested by owner): one section per owner.class_name with a shared idx list and one entry per key. Used by RoutineBase.export_json().

Parameters:
rtnams.routines.routine.RoutineBase

The routine to gather results from.

data_dictDict

The data dictionary to populate in place.

itemsdict

Items to gather (typically rtn.vars, rtn.exprs, or rtn.exprcs).

attrstr

Attribute to read from each item via rtn.get().

groupbool, keyword-only

Output shape selector — see above.