pyyeti.cla.DR_Results.merge¶
- DR_Results.merge(results_iter, rename_dict=None)[source]¶
Merge CLA results together into a larger
DR_Resultshierarchy.- Parameters:
results_iter (iterable) – Iterable of
DR_Resultsitems to merge. (Can be list, tuple, generator expression, or other Python iterable.)rename_dict (dict; optional) – Used to rename entries in final self results structure. The key is old name and the value is the new name. See example below.
- Returns:
events (list) – List of event names in the order provided by results_iter.
Notes
This routine is sort of an inverse of
split(). The name of each event is extracted from theDR_Resultsdata structure. The approach to get the name is as follows. Note that ‘SC_atm’ is just an example; this routine will simply use first element it finds. Let results be the current instance ofDR_Results:If any element of results is a SimpleNamespace:
event = results['SC_atm'].eventElse, if any element from results is another
DR_Resultsstructure, then:If
results['extreme']exists:event = results['extreme']['SC_atm'].eventElse
event = ', '.join(key for key in results)
Else, raise TypeError
Example usage:
# merge "liftoff" and "meco" results and rename the # liftoff results from "LO" to "Liftoff": from pyyeti import cla results = cla.DR_Results() results.merge( ( cla.load(fn) for fn in [ "../liftoff/results.pgz", "../meco/results.pgz", ] ), {"LO": "Liftoff"}, ) results.strip_hists() results.form_extreme() results["extreme"].rpttab() cla.save("results.pgz", results)