Skip to content

Commit

Permalink
For aiidateam#991 we moved functionality to a new repository qe-tools…
Browse files Browse the repository at this point in the history
…. This is now in the optional requirements. also update command-line for verdi data structure import using the qeinputparser
  • Loading branch information
lekah committed Nov 10, 2017
1 parent cc9d06b commit 89e8c00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions aiida/cmdline/commands/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,15 +1413,23 @@ def _import_pwi(self, filename, **kwargs):
Imports a structure from a quantumespresso input file.
"""
from os.path import abspath
from aiida.tools.codespecific.quantumespresso.qeinputparser import get_structuredata_from_qeinput
try:
from qe_tools.parsers.qeinputparser import QeInputFile
except ImportError:
import sys
print ("You have not installed the package qe-tools. \n"
"You can install it with: pip install qe-tools")
sys.exit(0)

dont_store = kwargs.pop('dont_store')
view_in_ase = kwargs.pop('view')

print 'importing structure from: \n {}'.format(abspath(filename))
filepath = abspath(filename)

try:
new_structure = get_structuredata_from_qeinput(filepath=filepath)
inputparser = QeInputFile(filepath)
new_structure = inputparser.get_structuredata()

if not dont_store:
new_structure.store()
Expand Down
1 change: 1 addition & 0 deletions setup_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
'PyMySQL==0.7.9', # required by ICSD tools
'PyCifRW==3.6.2.1',
'seekpath==1.6.0',
'qe-tools==1.0',
# support for the AiiDA CifData class. Update to version 4 ddoes
# break tests
],
Expand Down

0 comments on commit 89e8c00

Please sign in to comment.