File tree 3 files changed +20
-2
lines changed
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -279,10 +279,12 @@ def get_output_structure(self):
279
279
if "Begin final coordinates" in line :
280
280
if 'new unit-cell volume' in next (fp ):
281
281
# unit cell allowed to change
282
- next (fp ) # blank line
282
+ cellheader = next (fp )
283
+ # skip irrelevant lines (density/blank line/etc)
284
+ while 'CELL_PARAMETER' not in cellheader :
285
+ cellheader = next (fp )
283
286
# get the final unit cell
284
287
unit_cell = []
285
- cellheader = next (fp )
286
288
if 'bohr' in cellheader .lower ():
287
289
cell_conv_factor = bohr_to_angstrom
288
290
elif 'angstrom' in cellheader .lower ():
Original file line number Diff line number Diff line change 5
5
import os
6
6
import shutil
7
7
8
+
8
9
class TestPWSCFParser (unittest .TestCase ):
9
10
10
11
def get_parser (self ,name ):
@@ -33,6 +34,8 @@ def test_Au_nscf(self):
33
34
self .assertAlmostEqual (fin_volume .scalars [0 ].value , 16.978781940985 )
34
35
self .assertEqual (fin_volume .units , 'Angstrom^3/cell' )
35
36
37
+ delete_example ('Au.nscf' )
38
+
36
39
def test_NaF (self ):
37
40
# Parse the results
38
41
parser = self .get_parser ('NaF.scf' )
@@ -158,6 +161,19 @@ def test_TiO2(self):
158
161
159
162
# Delete the data
160
163
delete_example ('TiO2.vcrelax' )
164
+
165
+ def test_FeO (self ):
166
+ # Parse the results
167
+ parser = self .get_parser ('FeO.vc-relax' )
168
+
169
+ strc = parser .get_output_structure ()
170
+ self .assertAlmostEqual (strc .cell [0 ][0 ], 1.319092613 )
171
+ self .assertAlmostEqual (strc .cell [2 ][1 ], - 1.523156949 )
172
+ self .assertEquals (['Fe' , 'O' ], strc .get_chemical_symbols ())
173
+ self .assertEquals ('FeO' , parser .get_composition ())
174
+
175
+ # Delete the data
176
+ delete_example ('FeO.vc-relax' )
161
177
162
178
def test_VS2 (self ):
163
179
# Parse the results
You can’t perform that action at this time.
0 commit comments