@@ -54,17 +54,17 @@ def parseLines(self, lines):
5454 stop -= 1
5555 ilines = iter (lines [:stop ])
5656 # read header of PDFFit file
57- for l in ilines :
57+ for line in ilines :
5858 p_nl += 1
59- words = l .split ()
59+ words = line .split ()
6060 if len (words ) == 0 or words [0 ][0 ] == "#" :
6161 continue
6262 elif words [0 ] == "title" :
63- stru .title = l .lstrip ()[5 :].strip ()
63+ stru .title = line .lstrip ()[5 :].strip ()
6464 elif words [0 ] == "scale" :
6565 stru .pdffit ["scale" ] = float (words [1 ])
6666 elif words [0 ] == "sharp" :
67- l1 = l .replace ("," , " " )
67+ l1 = line .replace ("," , " " )
6868 sharp_pars = [float (w ) for w in l1 .split ()[1 :]]
6969 if len (sharp_pars ) < 4 :
7070 stru .pdffit ["delta2" ] = sharp_pars [0 ]
@@ -77,21 +77,21 @@ def parseLines(self, lines):
7777 stru .pdffit ["rcut" ] = sharp_pars [3 ]
7878 elif words [0 ] == "spcgr" :
7979 key = "spcgr"
80- start = l .find (key ) + len (key )
81- value = l [start :].strip ()
80+ start = line .find (key ) + len (key )
81+ value = line [start :].strip ()
8282 stru .pdffit ["spcgr" ] = value
8383 elif words [0 ] == "shape" :
84- self ._parse_shape (l )
84+ self ._parse_shape (line )
8585 elif words [0 ] == "cell" :
8686 cell_line_read = True
87- l1 = l .replace ("," , " " )
87+ l1 = line .replace ("," , " " )
8888 latpars = [float (w ) for w in l1 .split ()[1 :7 ]]
8989 stru .lattice = Lattice (* latpars )
9090 elif words [0 ] == "dcell" :
91- l1 = l .replace ("," , " " )
91+ l1 = line .replace ("," , " " )
9292 stru .pdffit ["dcell" ] = [float (w ) for w in l1 .split ()[1 :7 ]]
9393 elif words [0 ] == "ncell" :
94- l1 = l .replace ("," , " " )
94+ l1 = line .replace ("," , " " )
9595 stru .pdffit ["ncell" ] = [int (w ) for w in l1 .split ()[1 :5 ]]
9696 elif words [0 ] == "format" :
9797 if words [1 ] != "pdffit" :
@@ -100,17 +100,17 @@ def parseLines(self, lines):
100100 elif words [0 ] == "atoms" and cell_line_read :
101101 break
102102 else :
103- self .ignored_lines .append (l )
103+ self .ignored_lines .append (line )
104104 # Header reading finished, check if required lines were present.
105105 if not cell_line_read :
106106 emsg = "%d: file is not in PDFfit format" % p_nl
107107 raise StructureFormatError (emsg )
108108 # Load data from atom entries.
109109 p_natoms = reduce (lambda x , y : x * y , stru .pdffit ["ncell" ])
110110 # we are now inside data block
111- for l in ilines :
111+ for line in ilines :
112112 p_nl += 1
113- wl1 = l .split ()
113+ wl1 = line .split ()
114114 element = wl1 [0 ][0 ].upper () + wl1 [0 ][1 :].lower ()
115115 xyz = [float (w ) for w in wl1 [1 :4 ]]
116116 occ = float (wl1 [4 ])
@@ -176,8 +176,8 @@ def toLines(self, stru):
176176 d_sigo = 0.0
177177 d_sigU = numpy .zeros ((3 , 3 ), dtype = float )
178178 # here we can start
179- l = "title " + stru .title
180- lines .append (l .strip ())
179+ line = "title " + stru .title
180+ lines .append (line .strip ())
181181 lines .append ("format pdffit" )
182182 lines .append ("scale %9.6f" % stru_pdffit ["scale" ])
183183 lines .append (
0 commit comments