ezpzbz / aiida-orca

AiiDA Plugin for ORCA
MIT License
7 stars 4 forks source link

Remove Pymatgen dependency, use ASE to read/write XYZ files #54

Closed danielhollas closed 1 year ago

danielhollas commented 1 year ago

Split from #46

The Pymatgen is quite a heavy dependency. Due to unrelated issues in AiiDAlab environment, I had problems with Pymatgen. I looked around and we could get rid of the Pymatgen dependency (and in turn many other transitive dependencies from aiida[atomic_tools]) and use ASE instead for parsing. ASE seems to have much less dependencies,

$ pip show ase
Name: ase
Version: 3.19.3
Requires: matplotlib, numpy, scipy
$ pip show pymatgen
Name: pymatgen
Version: 2022.2.1
Summary: Python Materials Genomics is a robust materials analysis code that defines core object representations for structures and molecules with support for many electronic structure codes. It is currently the core analysis code powering the Materials Project (https://www.materialsproject.org).
Requires: Cython, matplotlib, monty, networkx, numpy, palettable, pandas, plotly, pybtex, requests, ruamel.yaml, scipy, spglib, sympy, tabulate, tqdm, uncertainties

In addition, this PR makes the example scripts in examples/ compatible with AiiDA-2.0 (while preserving compatibility with AiiDA-1.x).

NOTE: Reference data for the parser test needed to be updated. Apparently, Pymatgen was not preserving the order of atoms when reading the XYZ structure from file, and also seemed to have been shifting the coordinates (translating and/or rotating to molecule). I have already reported this in #33. This PR fixes #33, ASE parser preserves the atom ordering and coordinates exactly as they are, besides minor rounding differences.