Open JosephMontoya-TRI opened 3 years ago
I think the reason for this is simply that the hash database is incomplete.
There are two sets of hashes, a "file" hash (checks the POTCAR is byte-to-byte identical) and a "data" hash (which is a bit more permissive, e.g. if there are changes in comment strings etc.)
The data hash matches, but the file match does not, hence it is in error. The warning message should probably be less extreme, i.e. acknowledge the possibility that the pymatgen database is incomplete.
The warning does not appear on set construction since only the "data" hash is checked.
Suggested remedy here is:
A separate issue here is that PotcarSingle.identify_potcar()
returns (['PBE'], ['runelements', 'C'])
for reasons that are not clear to me.
Hm, I think the runelements
is simply because there was an older VASP POTCAR that identified itself as such (or perhaps a parsing bug).
Ok, I mis-spoke previously. I think this is a round-trip issue due to some logic in Potcar.from_file
. The file itself is correct.
I have a fix which is to hash the str(PotcarSingle)
rather than PotcarSingle.data
. The failing file hash is because PotcarSingle.data
removes a trailing newline.
Describe the bug Round trip Potcar parsing results in a warning that's not present when writing input.
To Reproduce
Expected behavior No warning if input set is written without a warning.
Desktop (please complete the following information):
Additional context Believe this is related to the regex parsing of PotcarSingle from a multiple potcar file, or perhaps on the write itself, which may leave out a trailing line break present in the original file.
On the write - the PotcarData contains a trailing line break, but not on the read.