Skip to content

Error in parsing espresso files (read_espresso_structure) #87

@Walser52

Description

@Walser52

I'm using quantum espresso with shakenbreak and there are one or two issues.

  1. The default espresso file that shakenbreak creates is an espresso relax calculation. HOWEVER, the read_espresso_structure method presumes a vc-relax file. That's because an ordinary relax calculation does not have the "CELL_PARAMETERS (angstrom)" string in its output that read_espresso_structure is looking for.

Solution: Simply make the default files that shakenbreak generates to be vc-relax rather than relax.

  1. The following line:
    atomic_positions = file_content.split("ATOMIC_POSITIONS (angstrom)")[1]
    should be followed up with:
    atomic_positions = atomic_positions.split("Writing output data")[0]

Otherwise the string doesn't parse correctly i.e. float conversion in the following line:

        coordinates = [[float(entry) for entry in line[1:4]] for line in atomic_positions_processed]

fails due to non-numeric input.

I'm using:

shakenbreak version 3.4.2.
python 3.13

If the second error has not been removed then I can go ahead and make a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions