megnet.data.local_env module¶
Various NearNeighbors strategies to define local environments of sites in structure/molecule. Most of them are directly from pymatgen.analysis.local_env. The suitable NearNeighbors should have get_nn_info method implemented and this method needs to return a list of dict with each entry having following keys [‘site’, ‘image’, ‘weight’, ‘site_index’]
the weight will be used as the bond attributes in subsequent graph construction
- class AllAtomPairs[source]¶
Bases:
pymatgen.analysis.local_env.NearNeighbors
Get all combinations of atoms as bonds in a molecule
- class MinimumDistanceNNAll(cutoff: float = 4.0)[source]¶
Bases:
pymatgen.analysis.local_env.NearNeighbors
Determine bonded sites by fixed cutoff
- Args:.
- cutoff (float): cutoff radius in Angstrom to look for trial
near-neighbor sites (default: 4.0).
- get_nn_info(structure: pymatgen.core.structure.Structure, n: int) List[Dict] [source]¶
Get all near-neighbor sites as well as the associated image locations and weights of the site with index n using the closest neighbor distance-based method.
- Parameters
structure (Structure) – input structure.
n (integer) – index of site for which to determine near neighbors.
- Returns
- tuples, each one
of which represents a neighbor site, its image location, and its weight.
- Return type
siw (list of tuples (Site, array, float))
- deserialize(config: Dict)[source]¶
Deserialize the config dict to object :param config: (dict) nn_strategy config dict from seralize function
Returns: object