Skip to content

Commit 582d129

Browse files
authored
Merge pull request #48 from maxhutch/bugfix/handle-qe-nscf
Handing missing energy in QE parser to support non-self-consistent calculations
2 parents 990c51d + 8564e76 commit 582d129

File tree

6 files changed

+34
-7
lines changed

6 files changed

+34
-7
lines changed

.travis.yml

+22-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,33 @@ language: python
22

33
python:
44
- '2.7'
5-
- '3.3'
65
- '3.4'
76
- '3.5'
87
- '3.6'
98

109
install:
11-
- pip install -r requirements.txt
12-
- python setup.py install
10+
- sudo apt-get update
11+
# We do this conditionally because it saves us some downloading if the
12+
# version is the same.
13+
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
14+
wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
15+
else
16+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
17+
fi
18+
- bash miniconda.sh -b -p $HOME/miniconda
19+
- export PATH="$HOME/miniconda/bin:$PATH"
20+
- hash -r
21+
- conda config --set always_yes yes --set changeps1 no
22+
- conda update -q conda
23+
# Useful for debugging any issues with conda
24+
- conda info -a
25+
26+
# Replace dep1 dep2 ... with your dependencies
27+
- conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION numpy nose
28+
- source activate test-environment
29+
- pip install -r requirements.txt
30+
- pip install --no-deps -e .
31+
- which nosetests
1332

1433
script: nosetests
1534

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A Python library for extracting the input settings and results from Density Func
77
Requirements
88
------------
99

10-
Python 2.7 or >=3.3, with dependencies listed in [requirements.txt](https://github.com/CitrineInformatics/pif-dft/blob/master/requirements.txt)
10+
Python 2.7 or >=3.4, with dependencies listed in [requirements.txt](https://github.com/CitrineInformatics/pif-dft/blob/master/requirements.txt)
1111

1212
Installation
1313
------------

dfttopif/parsers/pwscf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def get_total_energy(self):
8484
if "!" in line and "total energy" in line:
8585
energy = line.split()[4:]
8686
return Property(scalars=float(energy[0]), units=energy[1])
87-
raise Exception('%s not found in %s'%('! & total energy',os.path.join(self._directory, self.outputf)))
87+
return None
8888

8989
@Value_if_true
9090
def is_relaxed(self):

dfttopif/parsers/vasp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import os
55
from ase.calculators.vasp import Vasp
66
from ase.io.vasp import read_vasp, read_vasp_out
7-
from pypif.obj.common.value import Value
8-
from pypif.obj.common.file_reference import FileReference
7+
from pypif.obj import Value, FileReference
8+
99

1010
class VaspParser(DFTParser):
1111
'''

examples/pwscf/Au.nscf.tar.gz

4.17 KB
Binary file not shown.

tests/parsers/test_pwscf.py

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ def get_parser(self,name):
1212
unpack_example(os.path.join('examples', 'pwscf', name+'.tar.gz'))
1313
return PwscfParser(name)
1414

15+
def test_Au_nscf(self):
16+
"""Test that a NSCF calculation is even parseable"""
17+
# Parse the results
18+
parser = self.get_parser('Au.nscf')
19+
20+
# Test the settings
21+
self.assertEquals('PWSCF', parser.get_name())
22+
1523
def test_NaF(self):
1624
# Parse the results
1725
parser = self.get_parser('NaF.scf')

0 commit comments

Comments
 (0)