filters
filters#
- catlas.filters.adsorbate_filter(config, dask_df, sankey)#
Filters adsorbate structures according to rules specified in a config.
- Parameters
config (dict) – dictionary specifying what criteria to filter on
dask_df (dask.dataframe.core.DataFrame) – adsorbates to filter
sankey (catlas.sankey.sankey_utils.Sankey) – a sankey object to update as adsorbates are filtered
- Returns
a dataframe of filtered adsorbates catlas.sankey.sankey_utils.Sankey: the input sankey object with added information
- Return type
dask.dataframe.core.DataFrame
- catlas.filters.bulk_filter(config, dask_df, sankey=None, initial_bulks=None)#
Filters a dask dataframe of bulk structures according to rules specified in a config yml.
- Parameters
config (dict) – dict describing what bulks to filter
dask_df (dask.core.frame.DataFrame) – bulk materials to select from
sankey (catlas.sankey.sankey_utils.Sankey) – object that records the number of bulks and filtered bulks
initial_bulks (int) – the initial number of bulks
- Returns
filtered bulk materials catlas.sankey.sankey_utils.Sankey: the input Sankey object with added info
- Return type
dask.core.frame.DataFrame
- catlas.filters.predictions_filter(bag_partition, config)#
Filter surfaces based on their predicted adsorption energies.
- Parameters
bag_partition (Iterable[dict]) – a partition of a Dask Bag. Each partition should contain columns “bulk_id”, “slab_millers”, “slab_shift”, “slab_top”, “adsorbate_smiles”, “filter_reason”, and a column whose name is the same as the value in the “filter_column” field of the input config.
config (dict) – a dictionary specifying how to filter predictions
sankey (catlas.sankey.sankey_utils.Sankey) – a Sankey object to update with prediction filters.
- Returns
- an updated version of the input Bag partition. Contains an updated
column “filter_reason” that has been modified to include rows filtered out according to the input config.
- Return type
Iterable[dict]
- catlas.filters.slab_filter(bag_partition, config)#
Filters a slab according to rules specified in a config.
- Parameters
bag_partition (Iterable[dict]) – unfiltered bag partition of enumerated slabs
config (dict) – dict containing slab filtering criteria
- Returns
filtered bag partition
- Return type
Iterable[dict]