Repository navigation
StructureGraph.map_indices #4557
Replies: 1 comment
|
You don't need it, though: node from pymatgen.core import Structure
from pymatgen.analysis.graphs import StructureGraph
from pymatgen.analysis.local_env import JmolNN
s = Structure.from_file("my.cif")
sg = StructureGraph.from_local_env_strategy(s, JmolNN())
for i in sg.graph.nodes:
site = sg.structure[i] # same order as s
print(i, site.label, site.specie, site.frac_coords)On a NaCl CIF with If this solves it, please mark it as the answer so others with the same problem can find it. |
Uh oh!
There was an error while loading. Please reload this page.
Hi I am trying to map the node indices from the StructureGraph produced by StructureGraph.with_local_env_strategy(structure, JmolNN()) to the atom indices from the original CIF file. How can I get this information? I've seen the function StructureGraph.map_indices() on GitHub but it's not on the documentation and I can't use it in my code. I have the latest version of pymatgen available on conda (1.3.0).
All reactions