filter_uids

Full name: ase2sprkkr.asr.database.duplicates.filter_uids

ase2sprkkr.asr.database.duplicates.filter_uids(all_rows, duplicate_ids, ops_and_keys, uid_key)[source]

Get most important rows according to filterstring.

Parameters:
  • all_rows (dict) – Dictionary with key=uid and value=row.

  • duplicate_ids (iterable) – Set of possible duplicate materials.

  • ops_and_keys (List[Tuple(str, str)]) – List of filters where the first element of the tuple is the comparison operator and the second is the to compare i.e.: [(‘<’, ‘energy’)]. Other accepted operators are {‘<=’, ‘>=’, ‘>’, ‘<’, ‘==’}. Additional filters can be added to construct more complex filters, i.e., [(‘<’, ‘energy’), (‘<=’, ‘natoms’)] means that a material is only picked if no other materials with lower energy AND fewer or same number of atoms exists.

  • uid_key (str) – The UID key of the database connection which the duplicate_ids parameters are refererring to.

Returns:

filtered_uids – Set of filtered uids.

Return type:

set