get_atom_environment#

get_atom_environment(graph, atom_idx)[source]#

Get the chemical environment of an atom, including its neighbors.

Parameters:
  • graph (networkx.Graph) – NetworkX graph of the molecule.

  • atom_idx (int) – Index of the atom (node index in the graph).

Returns:

environment

Tuple describing the atom’s environment:

(symbol, degree, tuple of sorted neighbor symbols)

where:
  • symbol (str): Atomic symbol of the atom.

  • degree (int): Number of bonds (degree) for the atom.

  • tuple of neighbor symbols (tuple of str): Sorted atomic symbols of neighboring atoms.

Return type:

tuple