Skip to content

Commit

Permalink
CLI: Fix import of StructureData from QE input file (#1018)
Browse files Browse the repository at this point in the history
The click option already returns a file handle, so the command
itself should not try to open it again, which excepts.
  • Loading branch information
bastonero committed Mar 27, 2024
1 parent b7f17cf commit 3440623
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/aiida_quantumespresso/cli/data/structure.py
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 3440623

Please sign in to comment.