From 8004191dfa366134b54d22c5685b8ead9bb86780 Mon Sep 17 00:00:00 2001
From: "Joern Ungermann (IEK-7 FZ-Juelich)" <j.ungermann@fz-juelich.de>
Date: Tue, 9 Jul 2013 13:11:47 +0200
Subject: [PATCH] fixed some pep8 violations

---
 pyramid/analytic.py    | 16 ++++++++--------
 pyramid/numcore/c1.pyx | 14 +++++++-------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/pyramid/analytic.py b/pyramid/analytic.py
index 979f0f0..c123042 100644
--- a/pyramid/analytic.py
+++ b/pyramid/analytic.py
@@ -64,10 +64,10 @@ def phase_mag_disc(dim, res, beta, center, radius, height, b_0=1):
     '''
     # Function for the phase:
     def phiMag(x, y):
-        r = np.hypot(x-x0, y-y0)
+        r = np.hypot(x - x0, y - y0)
         r[center[1], center[2]] = 1E-30
-        result = coeff * Lz * ((y-y0) * np.cos(beta) - (x-x0) * np.sin(beta))
-        result *= np.where(r <= R, 1, (R/r)**2)
+        result = coeff * Lz * ((y - y0) * np.cos(beta) - (x - x0) * np.sin(beta))
+        result *= np.where(r <= R, 1, (R / r) ** 2)
         return result
     # Process input parameters:
     z_dim, y_dim, x_dim = dim
@@ -97,10 +97,10 @@ def phase_mag_sphere(dim, res, beta, center, radius, b_0=1):
     '''
     # Function for the phase:
     def phiMag(x, y):
-        r = np.hypot(x-x0, y-y0)
+        r = np.hypot(x - x0, y - y0)
         r[center[1], center[2]] = 1E-30
-        result = coeff * R**3/r**2 * ((y-y0) * np.cos(beta) - (x-x0) * np.sin(beta))
-        result *= np.where(r > R, 1, (1-(1-(r/R)**2)**(3./2.)))
+        result = coeff * R ** 3 / r ** 2 * ((y - y0) * np.cos(beta) - (x - x0) * np.sin(beta))
+        result *= np.where(r > R, 1, (1 - (1 - (r / R) ** 2) ** (3. / 2.)))
         return result
     # Process input parameters:
     z_dim, y_dim, x_dim = dim
@@ -109,8 +109,8 @@ def phase_mag_sphere(dim, res, beta, center, radius, b_0=1):
     R = res * radius
     coeff = - 2./3. * pi * b_0 / PHI_0
     # Create grid:
-    x = np.linspace(res/2, x_dim*res-res/2, num=x_dim)
-    y = np.linspace(res/2, y_dim*res-res/2, num=y_dim)
+    x = np.linspace(res / 2, x_dim * res - res / 2, num=x_dim)
+    y = np.linspace(res / 2, y_dim * res - res / 2, num=y_dim)
     xx, yy = np.meshgrid(x, y)
     # Return phase:
     return phiMag(xx, yy)
diff --git a/pyramid/numcore/c1.pyx b/pyramid/numcore/c1.pyx
index bfa8239..55c48e9 100644
--- a/pyramid/numcore/c1.pyx
+++ b/pyramid/numcore/c1.pyx
@@ -1,13 +1,13 @@
 import math
 
-def great_circle(float lon1,float lat1,float lon2,float lat2):
+def great_circle(float lon1, float lat1, float lon2, float lat2):
     cdef float radius = 3956.0 
     cdef float pi = 3.14159265
-    cdef float x = pi/180.0
-    cdef float a,b,theta,c
+    cdef float x = pi / 180.0
+    cdef float a, b, theta,c
 
-    a = (90.0-lat1)*(x)
-    b = (90.0-lat2)*(x)
-    theta = (lon2-lon1)*(x)
+    a = (90.0 - lat1) * (x)
+    b = (90.0 - lat2) * (x)
+    theta = (lon2 - lon1) * (x)
     c = math.acos((math.cos(a)*math.cos(b)) + (math.sin(a)*math.sin(b)*math.cos(theta)))
-    return radius*c
\ No newline at end of file
+    return radius*c
-- 
GitLab