Depending on the source of the structure the return value for “Site.specie” is either an specie object or an element object. When I’m working with a database of pymatgen structures this seems to vary depending on the data source. This causes inconsistent behaviour with attempting to access the atomic number with .Z as specie.Z and specie.element.Z can report different values for some structures. Sometimes site.Z can report huge numbers like 9145449639597878252 where as site.element.Z would behave properly for these samples. Handling these different possibilites has proven challenging
Have I missed something or is there a more robust way to extract the atomic number from any structure?