rsr.rsr.update_refs¶
- rsr.rsr.update_refs(min_comps_st, refs_dict, refs_mat, row_names, verbose=False, return_removed=False)[source]¶
Insert a new reference into the store, removing any it dominates.
Converts
min_comps_stto a reference matrix, checks whether it is already a subset of any existing reference (in which case nothing is updated), and otherwise removes existing references that are subsets of the new one before appending it.- Parameters:
min_comps_st – Minimised component-state dictionary representing the new reference.
refs_dict – Current list of reference dictionaries.
refs_mat – Current reference tensor of shape
(n_refs, n_var, n_state).row_names – Component names matching the rows of
refs_mat.verbose – If True, print a note when the new reference is dominated or when existing references are removed.
return_removed – If True, also return the list of existing reference dictionaries that were overridden (removed because they are dominated by the new reference).
- Returns:
By default a tuple
(refs_dict, refs_mat)updated in place-equivalent form. Ifreturn_removedis True, a triple(refs_dict, refs_mat, removed_dicts)whereremoved_dictsis the list of overridden existing references (empty when the new reference is itself dominated and discarded).