Skip to content

Reading and writing POTCAR files is broken #3068

@henriquemiranda

Description

@henriquemiranda

Description

Reading and writing POTCAR file with the Potcar class from pymatgen.io.vasp seems broken.

Repro

To reproduce the problem, I start with a file:

POTCAR

 PAW Sb 04Feb1998
  5.00000000000000
 [...]
  0.000000000000E+00  0.000000000000E+00  0.000000000000E+00
 End of Dataset
  PAW Te 03Oct2001
   6.00000000000000
 [...]
  0.000000000000E+00  0.000000000000E+00  0.000000000000E+00 0.000000000000E+00  0.000000000000E+00
 End of Dataset

I use the following script to copy the POTCAR:

from pymatgen.io.vasp import Potcar
potcar = Potcar.from_file('POTCAR')
potcar.write_file('POTCAR_NEW')

the resulting file becomes:
POTCAR_NEW

 PAW Sb 04Feb1998
  5.00000000000000
 [...]
  0.000000000000E+00  0.000000000000E+00  0.000000000000E+00End of Dataset
  PAW Te 03Oct2001
   6.00000000000000
 [...]
  0.000000000000E+00  0.000000000000E+00  0.000000000000E+00 0.000000000000E+00  0.000000000000E+00End of Dataset

Expected behavior

I would expect the files in POTCAR_NEW to be the same as the ones in POTCAR

Problem

The problem originated after #2910 was merged.
Perhaps @jmmshn and @janosh have some insight.
From the discussion, it looks like the relevant tests were broken by these changes and then deactivated.

I also mention @MichaelWolloch since he knows about the handling of the hashes of the POTCAR files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ioInput/output functionalityneeds discussionNeeds discussion to agree on actionable next stepsvaspVienna Ab initio Simulation Package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions