diff --git a/crystalpy/util/ComplexAmplitudePhotonBunch.py b/crystalpy/util/ComplexAmplitudePhotonBunch.py index 23f61c3..3342b9c 100644 --- a/crystalpy/util/ComplexAmplitudePhotonBunch.py +++ b/crystalpy/util/ComplexAmplitudePhotonBunch.py @@ -233,7 +233,7 @@ def __init__(self, complex_amplitude_photons=None): energy = numpy.zeros(n) Esigma = numpy.zeros(n) Epi = numpy.zeros(n) - for el,i in enumerate(complex_amplitude_photons): + for i,el in enumerate(complex_amplitude_photons): energy[i] = el.energy() Esigma[i] = el.getComplexAmplitudeS() Epi[i] = el.getComplexAmplitudeP() diff --git a/crystalpy/util/PhotonBunch.py b/crystalpy/util/PhotonBunch.py index 42811ad..8965c5a 100644 --- a/crystalpy/util/PhotonBunch.py +++ b/crystalpy/util/PhotonBunch.py @@ -475,7 +475,7 @@ def isMonochromatic(self, places): True if all photons in the bunch have the same energy. """ - return self.energy().allEqual(self.energy()[0]) + return numpy.all(self.energy() == self.energy()[0]) def isUnidirectional(self): """Inquires if all photons in the bunch have the same direction. @@ -607,7 +607,7 @@ def __init__(self, photons=None): else: n = len(photons) energy = numpy.zeros(n) - for el,i in enumerate(photons): + for i,el in enumerate(photons): energy[i] = el.energy() el.unitDirectionVector() if i == 0: diff --git a/crystalpy/util/PolarizedPhotonBunch.py b/crystalpy/util/PolarizedPhotonBunch.py index 8f9e00c..f6576aa 100644 --- a/crystalpy/util/PolarizedPhotonBunch.py +++ b/crystalpy/util/PolarizedPhotonBunch.py @@ -216,7 +216,7 @@ def __init__(self, polarized_photons=None): s1 = numpy.zeros(n) s2 = numpy.zeros(n) s3 = numpy.zeros(n) - for el,i in enumerate(polarized_photons): + for i,el in enumerate(polarized_photons): energy[i] = el.energy() vv = el.unitDirectionVector() ss = el.stokesVector() diff --git a/setup.py b/setup.py index fc0e86d..7cd2ca4 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ setup(name='crystalpy', - version='0.0.16', + version='0.0.17', description='Python crystal polarization calculation', author='Manuel Sanchez del Rio, Edoardo Cappelli, Mark Glass', author_email='srio@esrf.eu',