CederGroupHub / chgnet

Pretrained universal neural network potential for charge-informed atomistic modeling https://chgnet.lbl.gov
https://doi.org/10.1038/s42256-023-00716-3
Other
232 stars 62 forks source link

[Bug]: vasp_utils.py , parse_vasp_dir function gives me error when parsing file. #147

Closed ignaciomigliaro closed 6 months ago

ignaciomigliaro commented 6 months ago

Email (Optional)

ignaciomigliaro@outlook.com

Version

0.3.5

Which OS(es) are you using?

What happened?

  1. I am attempting to run the parse_vasp_dir function, I have a directory that contains all of the necessary files, I know they are fully converged. Here are the files I'm attempting to run, I removed the wavefunction and charge files because of size. test.zip

Code snippet

# ./my_vasp_calc_dir contains vasprun.xml OSZICAR etc.
dataset_dict = parse_vasp_dir(file_root="/home/USER/NbOC/test")
print(list(dataset_dict))

Log output

RuntimeError                              Traceback (most recent call last)
Cell In[2], line 4
      1 from chgnet.utils import parse_vasp_dir
      3 # ./my_vasp_calc_dir contains vasprun.xml OSZICAR etc.
----> 4 dataset_dict = parse_vasp_dir(file_root="/home/nacho/NbOC/test")
      5 print(list(dataset_dict))

File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\chgnet\utils\vasp_utils.py:151, in parse_vasp_dir(file_root, check_electronic_convergence)
    148         dataset["stress"].append(ionic_step["stress"])
    150 if dataset["uncorrected_total_energy"] == []:
--> 151     raise RuntimeError(f"No data parsed from {file_root}!")
    153 return dataset

RuntimeError: No data parsed from /home/USER/NbOC/test!

Code of Conduct

ignaciomigliaro commented 6 months ago

For anyone having the same error, the solution is that the calculation did not have magnetic moments, make sure to add ISPIN = 2, and MAGMOM keyword in INCAR.

BowenD-UCB commented 6 months ago

Thanks for the report. The code is supposed to be able to parse VASP output without MAGMOM, I will look into this issue later