@@ -59,7 +59,7 @@ class IntensityGenerator(ProfileGenerator):
5959 """A class for calculating intensity using the Debye equation.
6060
6161 Calculating intensity from a structure is difficult in general. This class
62- takes a diffpy.Structure .Structure instance and from that generates a
62+ takes a diffpy.structure .Structure instance and from that generates a
6363 theoretical intensity signal. Unlike the example in gaussianrecipe.py, the
6464 intensity generator is not simple. It must take a structure object and some
6565 Parameters, and from that generate a signal. At the same time, the
@@ -93,7 +93,7 @@ def setStructure(self, strufile):
9393 """Set the structure used in the calculation.
9494
9595 strufile -- The name of a structure file. A
96- diffpy.Structure .Structure object will be created from
96+ diffpy.structure .Structure object will be created from
9797 the file, and that object will be passed to the 'iofq'
9898 function whenever it is called.
9999
@@ -102,7 +102,7 @@ def setStructure(self, strufile):
102102 DiffpyStructureParSet is a ParameterSet object that organizes and gives
103103 attribute access to Parameters and ParameterSets adapted from a diffpy
104104 Structure object. The Parameters embedded in the DiffpyStructureParSet
105- are proxies for attributes of the diffpy.Structure .Structure object
105+ are proxies for attributes of the diffpy.structure .Structure object
106106 that is needed by the 'iofq' function. The Parameters will be
107107 accessible by name under the 'phase' attribute of this generator, and
108108 are organized hierarchically:
@@ -130,21 +130,21 @@ def setStructure(self, strufile):
130130 - Uiso
131131 - etc.
132132
133- The diffpy.Structure .Structure instance is held within the
133+ The diffpy.structure .Structure instance is held within the
134134 DiffpyStructureParSet as the 'stru' attribute.
135135
136136 """
137137 # Load the structure from file
138- from diffpy .Structure import Structure
138+ from diffpy .structure import Structure
139139 stru = Structure ()
140140 stru .read (strufile )
141141
142142 # Create a ParameterSet designed to interface with
143- # diffpy.Structure .Structure objects that organizes the Parameter
143+ # diffpy.structure .Structure objects that organizes the Parameter
144144 # hierarchy. Note that the DiffpyStructureParSet holds a handle to the
145145 # loaded structure that we use in the __call__ method below.
146146 #
147- # We pass the diffpy.Structure .Structure instance, and give the
147+ # We pass the diffpy.structure .Structure instance, and give the
148148 # DiffpyStructureParSet the name "phase".
149149 parset = DiffpyStructureParSet ("phase" , stru )
150150
@@ -158,7 +158,7 @@ def __call__(self, q):
158158
159159 This ProfileGenerator will be used in a FitContribution that will be
160160 optimized to fit some data. By the time this function is evaluated,
161- the diffpy.Structure .Structure instance has been updated by the
161+ the diffpy.structure .Structure instance has been updated by the
162162 optimizer via the DiffpyStructureParSet defined in setStructure. Thus,
163163 we need only call iofq with the internal structure object.
164164
@@ -353,7 +353,7 @@ def iofq(S, q):
353353 I(Q) = 2 sum(i,j) f_i(Q) f_j(Q) sinc(rij Q) exp(-0.5 ssij Q**2)
354354 (The exponential term is the Debye-Waller factor.)
355355
356- S -- A diffpy.Structure .Structure instance. It is assumed that the
356+ S -- A diffpy.structure .Structure instance. It is assumed that the
357357 structure is that of an isolated scatterer. Periodic boundary
358358 conditions are not applied.
359359 q -- The q-points to calculate over.
@@ -378,14 +378,14 @@ def iofq(S, q):
378378 pairdict = {}
379379 elcount = {}
380380 n = len (S )
381- for i in xrange (n ):
381+ for i in range (n ):
382382
383383 # count the number of each element
384384 eli = S [i ].element
385385 m = elcount .get (eli , 0 )
386386 elcount [eli ] = m + 1
387387
388- for j in xrange ( i + 1 , n ):
388+ for j in range ( i + 1 , n ):
389389
390390 elj = S [j ].element
391391
@@ -473,7 +473,7 @@ def makeData(strufile, q, datname, scale, a, Uiso, sig, bkgc, nl = 1):
473473
474474 """
475475
476- from diffpy .Structure import Structure
476+ from diffpy .structure import Structure
477477 S = Structure ()
478478 S .read (strufile )
479479
@@ -507,7 +507,7 @@ def makeData(strufile, q, datname, scale, a, Uiso, sig, bkgc, nl = 1):
507507 y = numpy .random .poisson (y * nl ) / nl
508508
509509 # Now save it
510- numpy .savetxt (datname , zip ( q , y , u ))
510+ numpy .savetxt (datname , numpy . transpose ([ q , y , u ] ))
511511 return
512512
513513
0 commit comments