Skip to content

Commit

Permalink
feat: add get_structure_graph helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Maik Jablonka committed Jul 28, 2022
1 parent ed8e86f commit 53fceb4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/structuregraph_helpers/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
NearNeighbors,
VoronoiNN,
)
from pymatgen.core import Structure

_THIS_DIR = os.path.dirname(os.path.abspath(__file__))

Expand Down Expand Up @@ -49,6 +50,8 @@
"ATRCutoffDictNN",
"LICutoffDictNN",
"get_local_env_method",
"get_structure_graph",
"construct_clean_graph",
)


Expand Down Expand Up @@ -93,6 +96,11 @@ def get_local_env_method(method: str) -> NearNeighbors:
return VoronoiNN()


def get_structure_graph(structure: Structure, method: str = "vesta") -> StructureGraph:
"""Get a structure graph for a structure."""
return StructureGraph.with_local_env_strategy(structure, get_local_env_method(method))


def get_nx_graph_from_edge_tuples(edge_tuples: Iterable[Tuple[int, int]]) -> nx.Graph:
"""Create a undirected graph from a list of edge tuples.
Expand Down

0 comments on commit 53fceb4

Please sign in to comment.