ocpapi.workflows.filter#

Classes#

keep_all_slabs

Adslab filter than returns all slabs.

keep_slabs_with_miller_indices

Adslab filter that keeps any slabs with the configured miller indices.

prompt_for_slabs_to_keep

Adslab filter than presents the user with an interactive prompt to choose

Module Contents#

class ocpapi.workflows.filter.keep_all_slabs#

Adslab filter than returns all slabs.

async __call__(adslabs: list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]) list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]#
class ocpapi.workflows.filter.keep_slabs_with_miller_indices(miller_indices: Iterable[tuple[int, int, int]])#

Adslab filter that keeps any slabs with the configured miller indices. Slabs with other miller indices will be ignored.

_unique_millers: set[tuple[int, int, int]]#
async __call__(adslabs: list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]) list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]#
class ocpapi.workflows.filter.prompt_for_slabs_to_keep#

Adslab filter than presents the user with an interactive prompt to choose which of the input slabs to keep.

static _sort_key(adslab: fairchem.demo.ocpapi.client.AdsorbateSlabConfigs) tuple[tuple[int, int, int], float, str]#

Generates a sort key from the input adslab. Returns the miller indices, shift, and top/bottom label so that they will be sorted by those values in that order.

async __call__(adslabs: list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]) list[fairchem.demo.ocpapi.client.AdsorbateSlabConfigs]#