abinit / abipy

Open-source library for analyzing the results produced by ABINIT
http://abinit.github.io/abipy
Other
117 stars 96 forks source link

Delay imports of `Poscar` and `Chgcar` of `pymatgen.io.vasp.outputs` #275

Closed sphuber closed 1 year ago

sphuber commented 1 year ago

This is imported in abipy.core.fields which is automatically imported when abipy is imported and this can raise the error:

FileNotFoundError: [Errno 2] No such file or directory: '..pymatgen/io/vasp/potcar_summary_stats.json.gz'

The absence of this file should not make it impossible to merely import abipy and so the imports of Poscar and Chgcar are relegated to inside the scope where they are actually used.

gmatteo commented 1 year ago

Thanks for the fix.