Skip to content

Commit

Permalink
CLI: fix import of StructureData from QE input file
Browse files Browse the repository at this point in the history
The command line to import the structure from a
Quantum ESPRESSO pw.x input file was broken, as
the command would already read the file.
This is now fixed.
  • Loading branch information
bastonero committed Mar 27, 2024
1 parent b7f17cf commit e5d8840
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/aiida_quantumespresso/cli/data/structure.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ def cmd_import(filename, dry_run):
"""Import a `StructureData` from a Quantum ESPRESSO input file."""
from aiida_quantumespresso.tools.pwinputparser import PwInputFile

with open(filename, 'r', encoding='utf-8') as input_file:
parser = PwInputFile(input_file.read())
parser = PwInputFile(filename.read())
structure = parser.get_structuredata()
formula = structure.get_formula()

Expand Down

0 comments on commit e5d8840

Please sign in to comment.