pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

Out of date example using Interstitial in documentation

Open katerinavr opened this issue 4 years ago • 2 comments

Describe the bug The example given in the documentation making use of pymatgen.analysis.defects.core.Interstitial seems to be outdated or incorrect. Following the example shown on the installation page yields to the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: __init__() got an unexpected keyword argument 'radii'

To Reproduce

See the last code snippet at https://pymatgen.org/installation.html.

from pymatgen.analysis.defects.core import Interstitial
from pymatgen.core.structure import Structure

structure = Structure.from_file('/path/to/file')
radii, valences = {}, {}

for element in structure.composition.elements:
    radii[element.symbol] = element.atomic_radius
    valence = element.group  # Just a first guess..
    if element.group > 12:
        valence -= 10
    valences[element.symbol] = valence

interstitial = Interstitial(structure, radii=radii, valences=valences)

If you could please provide an up-to-date method of using this class that would be really helpful

Regards

katerinavr avatar Mar 04 '21 15:03 katerinavr

@mbkumar can you update pls?

shyuep avatar Mar 04 '21 16:03 shyuep

@shyuep,

There are two parts. a) The installation for Zeo++, which could be still valid. b) The validation example which uses the Interstitial class is outdated. The defects subpackage was rewritten by Shyam and Danny. They were using a new algorithm introduced by Nils Zimmerman for interstitials.

So my suggestion would be to rewrite the interstitial generation example using the latest defects code and move it to a new subsection titled "Defects" if not already present. And leave the rest of the Zeo++ section intact after removing/relocating the example code.

@shyamd, could you please take a look at the non-working example and write a new canonical example for interstitial generation.

Bharat

mbkumar avatar Mar 04 '21 21:03 mbkumar