airsspy.analysis.collect#
Data collection and analysis utilities for AIRSS search results.
Provides functions for collecting RES file data into DataFrames,
reading ca command output, combining similar structures via cryan,
and computing minsep ranges from ensembles.
Module Contents#
Functions#
Read from a stream of RES file contents and return lists of TitlInfo and Atoms objects. |
|
Read results from the |
|
Collect a list of RESFile objects into a DataFrame. |
|
Reduce similar structures using the |
|
Create ranged minseps from an ensemble of minsep entries. |
|
Create ComputedEntry objects from a DataFrame containing structure data. |
|
Write all structures in a DataFrame into RES format for export. |
|
Convert a stress tensor to isostatic pressure in GPa. |
API#
- airsspy.analysis.collect.read_stream(stream) tuple[list, list][source]#
Read from a stream of RES file contents and return lists of TitlInfo and Atoms objects.
Args: stream: Iterable of lines from concatenated RES files.
Returns: Tuple of (titl_list, atoms_list).
- airsspy.analysis.collect.read_ca(lines: list[str]) pandas.DataFrame[source]#
Read results from the
cacommand into a DataFrame.Args: lines: String lines as returned by the
cacommand.Returns: A DataFrame with columns for label, pressure, volume, enthalpy, spin info, formula, symmetry, etc.
- airsspy.analysis.collect.collect_res_in_df(res_collection: list[airsspy.restools.RESFile], norm_mode: str = 'per_atom') pandas.DataFrame[source]#
Collect a list of RESFile objects into a DataFrame.
Args: res_collection: A collection of RESFile objects. norm_mode: Normalisation mode for energy and volume.
"per_atom"(default) or"per_formula_unit".Returns: A DataFrame with collected data from the RESFile objects.
- airsspy.analysis.collect.combine_res_cryan(dframe: pandas.DataFrame, thres: float = 0.1, ntop: int = 30) pandas.DataFrame[source]#
Reduce similar structures using the
cryancommand.Args: dframe: DataFrame with a
rescolumn containing RESFile objects. thres: Threshold for combining structures. ntop: The number of top structures to be returned.Returns: A DataFrame of output from the
cryancommand.
- airsspy.analysis.collect.get_minsep_range(minseps: list[dict[str, float]], cap: Optional[tuple[float, float]] = None) dict[str, list[float]][source]#
Create ranged minseps from an ensemble of minsep entries.
Args: minseps: A list of minsep dictionaries (species pair -> distance). cap: Optional (min, max) cap for distances.
Returns: A dictionary mapping species pairs to [min, max] ranges.
- airsspy.analysis.collect.get_entry(dataframe: pandas.DataFrame, pmg_col: str = 'pmg_struct', label_col: str = 'label', uuid_col: str = 'uuid', umap_col: str = 'umap', xc_col: str = 'functional', eng_col: str = 'energy') list[pymatgen.entries.computed_entries.ComputedEntry][source]#
Create ComputedEntry objects from a DataFrame containing structure data.
Args: dataframe: DataFrame with structure and energy data. pmg_col: Column name for pymatgen Structure objects. label_col: Column name for structure labels. uuid_col: Column name for UUIDs. umap_col: Column name for Hubbard U mapping. xc_col: Column name for functional labels. eng_col: Column name for energy values.
Returns: A list of ComputedEntry objects.
- airsspy.analysis.collect.export_dataframe_as_res(dataframe: pandas.DataFrame, comment: str = 'VASP export', extra_comments: Optional[list] = None, stress_key: Optional[str] = None) None[source]#
Write all structures in a DataFrame into RES format for export.
Creates an
exports/directory and writes one.resfile per row.Args: dataframe: DataFrame with structure and energy data. Must have
pmg_struct_relaxed,energy_per_atom,volume_per_fu,nform_refine, andlabelcolumns. comment: Comment to include in REM lines. extra_comments: Additional REM comment strings. stress_key: Column name for stress data (optional).